Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_operators/anim.py
| Show First 20 Lines • Show All 106 Lines • ▼ Show 20 Lines | def execute(self, context): | ||||
| if not found: | if not found: | ||||
| for light in bpy.data.lights: | for light in bpy.data.lights: | ||||
| if light.node_tree == ksp.id: | if light.node_tree == ksp.id: | ||||
| id_bpy_path = "bpy.data.lights[\"%s\"].node_tree" % (light.name) | id_bpy_path = "bpy.data.lights[\"%s\"].node_tree" % (light.name) | ||||
| found = True | found = True | ||||
| break | break | ||||
| if not found: | if not found: | ||||
| self.report({'WARN'}, tip_("Could not find material or light using Shader Node Tree - %s") % (ksp.id)) | self.report( | ||||
| {'WARN'}, | |||||
| tip_("Could not find material or light using Shader Node Tree - %s") % | |||||
| (ksp.id)) | |||||
| elif ksp.id.bl_rna.identifier.startswith("CompositorNodeTree"): | elif ksp.id.bl_rna.identifier.startswith("CompositorNodeTree"): | ||||
| # Find compositor nodetree using this node tree... | # Find compositor nodetree using this node tree... | ||||
| for scene in bpy.data.scenes: | for scene in bpy.data.scenes: | ||||
| if scene.node_tree == ksp.id: | if scene.node_tree == ksp.id: | ||||
| id_bpy_path = "bpy.data.scenes[\"%s\"].node_tree" % (scene.name) | id_bpy_path = "bpy.data.scenes[\"%s\"].node_tree" % (scene.name) | ||||
| break | break | ||||
| else: | else: | ||||
| self.report({'WARN'}, tip_("Could not find scene using Compositor Node Tree - %s") % (ksp.id)) | self.report({'WARN'}, tip_("Could not find scene using Compositor Node Tree - %s") % (ksp.id)) | ||||
| ▲ Show 20 Lines • Show All 197 Lines • ▼ Show 20 Lines | def execute(self, _context): | ||||
| # (i.e. walk, wave, jump, etc.) | # (i.e. walk, wave, jump, etc.) | ||||
| # and should be left alone as that's what fake users are for! | # and should be left alone as that's what fake users are for! | ||||
| if not action.fcurves: | if not action.fcurves: | ||||
| # mark action for deletion | # mark action for deletion | ||||
| action.user_clear() | action.user_clear() | ||||
| removed += 1 | removed += 1 | ||||
| self.report({'INFO'}, tip_("Removed %d empty and/or fake-user only Actions") | self.report({'INFO'}, tip_("Removed %d empty and/or fake-user only Actions") | ||||
| % removed) | % removed) | ||||
| return {'FINISHED'} | return {'FINISHED'} | ||||
| class UpdateAnimatedTransformConstraint(Operator): | class UpdateAnimatedTransformConstraint(Operator): | ||||
| """Update f-curves/drivers affecting Transform constraints (use it with files from 2.70 and earlier)""" | """Update f-curves/drivers affecting Transform constraints (use it with files from 2.70 and earlier)""" | ||||
| bl_idname = "anim.update_animated_transform_constraints" | bl_idname = "anim.update_animated_transform_constraints" | ||||
| bl_label = "Update Animated Transform Constraints" | bl_label = "Update Animated Transform Constraints" | ||||
| bl_options = {'REGISTER', 'UNDO'} | bl_options = {'REGISTER', 'UNDO'} | ||||
| ▲ Show 20 Lines • Show All 85 Lines • Show Last 20 Lines | |||||