diff options
Diffstat (limited to 'render_copy_settings/operator.py')
-rw-r--r-- | render_copy_settings/operator.py | 27 |
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'} |