Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2012-12-28 15:19:26 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2012-12-28 15:19:26 +0400
commit06e7c5bfa37ceccfb05c1420cbb3e41a6bc975d5 (patch)
tree53ef1205d00cc457feaf35735c86668bc1ea2996 /render_copy_settings/operator.py
parent868c331064696db061eb0091bd4d7ddacfc951d8 (diff)
Update to render_copy_settings: use new template_list (and now we can have two lists in one panel!)
Yet there is some work to be done on the 'GRID' mode of lists, current layout code is stupid (and nearly unusable)...
Diffstat (limited to 'render_copy_settings/operator.py')
-rw-r--r--render_copy_settings/operator.py27
1 files changed, 9 insertions, 18 deletions
diff --git a/render_copy_settings/operator.py b/render_copy_settings/operator.py
index 31d36ecd..f231ac92 100644
--- a/render_copy_settings/operator.py
+++ b/render_copy_settings/operator.py
@@ -21,14 +21,12 @@
import bpy
from . import presets
-# These operators are only defined because it seems impossible to directly
-# edit properties from UI code…
+# These operators are only defined because it seems impossible to directly edit properties from UI code…
# A sorting func for collections (working in-place).
# XXX Not optimized at all…
-# XXX If some items in the collection do not have the sortkey property,
-# they are just ignored…
+# XXX If some items in the collection do not have the sortkey property, they are just ignored…
def collection_property_sort(collection, sortkey, start_idx=0):
while start_idx + 1 < len(collection):
while not hasattr(collection[start_idx], sortkey):
@@ -49,8 +47,7 @@ def collection_property_sort(collection, sortkey, start_idx=0):
class RenderCopySettingsPrepare(bpy.types.Operator):
- """Prepare internal data for render_copy_settings (gathering all """ \
- """existingrender settings, and scenes)"""
+ """Prepare internal data for render_copy_settings (gathering all existingrender settings, and scenes)"""
bl_idname = "scene.render_copy_settings_prepare"
bl_label = "Render: Copy Settings Prepare"
bl_option = {'REGISTER'}
@@ -62,8 +59,7 @@ class RenderCopySettingsPrepare(bpy.types.Operator):
def execute(self, context):
cp_sett = context.scene.render_copy_settings
- # Get all available render settings, and update accordingly
- # affected_settings…
+ # Get all available render settings, and update accordingly affected_settings…
props = {}
for prop in context.scene.render.bl_rna.properties:
if prop.identifier in {'rna_type'}:
@@ -92,13 +88,11 @@ class RenderCopySettingsPrepare(bpy.types.Operator):
try:
regex = re.compile(cp_sett.filter_scene)
except Exception as e:
- self.report({'ERROR_INVALID_INPUT'}, "The filter-scene "
- "regex did not compile:\n (%s)." % str(e))
+ self.report({'ERROR_INVALID_INPUT'}, "The filter-scene regex did not compile:\n (%s)." % str(e))
return {'CANCELLED'}
except:
regex = None
- self.report({'WARNING'}, "Unable to import the re module. "
- "Regex scene filtering will be disabled!")
+ self.report({'WARNING'}, "Unable to import the re module, regex scene filtering will be disabled!")
scenes = set()
for scene in bpy.data.scenes:
if scene == bpy.context.scene: # Exclude current scene!
@@ -190,12 +184,9 @@ class RenderCopySettings(bpy.types.Operator):
def execute(self, context):
regex = None
cp_sett = context.scene.render_copy_settings
- affected_settings = {sett.strid for sett in cp_sett.affected_settings
- if sett.copy}
- allowed_scenes = {sce.name for sce in cp_sett.allowed_scenes
- if sce.allowed}
- do_copy(context, affected_settings=affected_settings,
- allowed_scenes=allowed_scenes)
+ affected_settings = {sett.strid for sett in cp_sett.affected_settings if sett.copy}
+ allowed_scenes = {sce.name for sce in cp_sett.allowed_scenes if sce.allowed}
+ do_copy(context, affected_settings=affected_settings, allowed_scenes=allowed_scenes)
return {'FINISHED'}