Compare commits
4 Commits
version-1.
...
version-1.
Author | SHA1 | Date | |
---|---|---|---|
68b046c714 | |||
cb20d6ee03 | |||
![]() |
645bdd950f | ||
![]() |
74a5830dae |
@@ -21,7 +21,7 @@
|
|||||||
bl_info = {
|
bl_info = {
|
||||||
'name': 'Blender Cloud',
|
'name': 'Blender Cloud',
|
||||||
"author": "Sybren A. Stüvel, Francesco Siddi, Inês Almeida, Antony Riakiotakis",
|
"author": "Sybren A. Stüvel, Francesco Siddi, Inês Almeida, Antony Riakiotakis",
|
||||||
'version': (1, 5, 1),
|
'version': (1, 5, 2),
|
||||||
'blender': (2, 77, 0),
|
'blender': (2, 77, 0),
|
||||||
'location': 'Addon Preferences panel, and Ctrl+Shift+Alt+A anywhere for texture browser',
|
'location': 'Addon Preferences panel, and Ctrl+Shift+Alt+A anywhere for texture browser',
|
||||||
'description': 'Texture library browser and Blender Sync. Requires the Blender ID addon '
|
'description': 'Texture library browser and Blender Sync. Requires the Blender ID addon '
|
||||||
|
@@ -70,8 +70,12 @@ def active_strip(context):
|
|||||||
|
|
||||||
def selected_shots(context):
|
def selected_shots(context):
|
||||||
"""Generator, yields selected strips if they are Attract shots."""
|
"""Generator, yields selected strips if they are Attract shots."""
|
||||||
|
selected_sequences = context.selected_sequences
|
||||||
|
|
||||||
for strip in context.selected_sequences:
|
if selected_sequences is None:
|
||||||
|
return
|
||||||
|
|
||||||
|
for strip in selected_sequences:
|
||||||
atc_object_id = getattr(strip, 'atc_object_id')
|
atc_object_id = getattr(strip, 'atc_object_id')
|
||||||
if not atc_object_id:
|
if not atc_object_id:
|
||||||
continue
|
continue
|
||||||
@@ -81,6 +85,11 @@ def selected_shots(context):
|
|||||||
|
|
||||||
def all_shots(context):
|
def all_shots(context):
|
||||||
"""Generator, yields all strips if they are Attract shots."""
|
"""Generator, yields all strips if they are Attract shots."""
|
||||||
|
sequence_editor = context.scene.sequence_editor
|
||||||
|
|
||||||
|
if sequence_editor is None:
|
||||||
|
# we should throw an exception, but at least this change prevents an error
|
||||||
|
return []
|
||||||
|
|
||||||
for strip in context.scene.sequence_editor.sequences_all:
|
for strip in context.scene.sequence_editor.sequences_all:
|
||||||
atc_object_id = getattr(strip, 'atc_object_id')
|
atc_object_id = getattr(strip, 'atc_object_id')
|
||||||
@@ -195,7 +204,7 @@ class ToolsPanel(Panel):
|
|||||||
if bpy.ops.attract.submit_selected.poll():
|
if bpy.ops.attract.submit_selected.poll():
|
||||||
row.operator('attract.submit_selected',
|
row.operator('attract.submit_selected',
|
||||||
text='Submit %s' % noun,
|
text='Submit %s' % noun,
|
||||||
icon='MOVE_UP_VEC')
|
icon='TRIA_UP')
|
||||||
else:
|
else:
|
||||||
row.operator(ATTRACT_OT_submit_all.bl_idname)
|
row.operator(ATTRACT_OT_submit_all.bl_idname)
|
||||||
row.operator(AttractShotFetchUpdate.bl_idname,
|
row.operator(AttractShotFetchUpdate.bl_idname,
|
||||||
|
33
setup.py
33
setup.py
@@ -18,11 +18,13 @@
|
|||||||
# ##### END GPL LICENSE BLOCK #####
|
# ##### END GPL LICENSE BLOCK #####
|
||||||
|
|
||||||
import glob
|
import glob
|
||||||
|
import os
|
||||||
import sys
|
import sys
|
||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
import re
|
import re
|
||||||
import pathlib
|
import pathlib
|
||||||
|
import zipfile
|
||||||
|
|
||||||
from distutils import log
|
from distutils import log
|
||||||
from distutils.core import Command
|
from distutils.core import Command
|
||||||
@@ -168,6 +170,34 @@ class BlenderAddonBdist(bdist):
|
|||||||
super().run()
|
super().run()
|
||||||
|
|
||||||
|
|
||||||
|
# noinspection PyAttributeOutsideInit
|
||||||
|
class BlenderAddonFdist(BlenderAddonBdist):
|
||||||
|
"""Ensures that 'python setup.py fdist' creates a plain folder structure."""
|
||||||
|
|
||||||
|
user_options = [
|
||||||
|
('dest-path=', None, 'addon installation path'),
|
||||||
|
]
|
||||||
|
|
||||||
|
def initialize_options(self):
|
||||||
|
super().initialize_options()
|
||||||
|
self.dest_path = None # path that will contain the addon
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
super().run()
|
||||||
|
|
||||||
|
# dist_files is a list of tuples ('bdist', 'any', 'filepath')
|
||||||
|
filepath = self.distribution.dist_files[0][2]
|
||||||
|
|
||||||
|
# if dest_path is not specified use the filename as the dest_path (minus the .zip)
|
||||||
|
assert filepath.endswith('.zip')
|
||||||
|
target_folder = self.dest_path or filepath[:-4]
|
||||||
|
|
||||||
|
print('Unzipping the package on {}.'.format(target_folder))
|
||||||
|
|
||||||
|
with zipfile.ZipFile(filepath, 'r') as zip_ref:
|
||||||
|
zip_ref.extractall(target_folder)
|
||||||
|
|
||||||
|
|
||||||
# noinspection PyAttributeOutsideInit
|
# noinspection PyAttributeOutsideInit
|
||||||
class BlenderAddonInstall(install):
|
class BlenderAddonInstall(install):
|
||||||
"""Ensures the module is placed at the root of the zip file."""
|
"""Ensures the module is placed at the root of the zip file."""
|
||||||
@@ -191,12 +221,13 @@ class AvoidEggInfo(install_egg_info):
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
cmdclass={'bdist': BlenderAddonBdist,
|
cmdclass={'bdist': BlenderAddonBdist,
|
||||||
|
'fdist': BlenderAddonFdist,
|
||||||
'install': BlenderAddonInstall,
|
'install': BlenderAddonInstall,
|
||||||
'install_egg_info': AvoidEggInfo,
|
'install_egg_info': AvoidEggInfo,
|
||||||
'wheels': BuildWheels},
|
'wheels': BuildWheels},
|
||||||
name='blender_cloud',
|
name='blender_cloud',
|
||||||
description='The Blender Cloud addon allows browsing the Blender Cloud from Blender.',
|
description='The Blender Cloud addon allows browsing the Blender Cloud from Blender.',
|
||||||
version='1.5.1',
|
version='1.5.2',
|
||||||
author='Sybren A. Stüvel',
|
author='Sybren A. Stüvel',
|
||||||
author_email='sybren@stuvel.eu',
|
author_email='sybren@stuvel.eu',
|
||||||
packages=find_packages('.'),
|
packages=find_packages('.'),
|
||||||
|
Reference in New Issue
Block a user