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:
Diffstat (limited to 'animation_add_corrective_shape_key.py')
-rw-r--r--animation_add_corrective_shape_key.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/animation_add_corrective_shape_key.py b/animation_add_corrective_shape_key.py
index 8a9bdb28..c18d3b89 100644
--- a/animation_add_corrective_shape_key.py
+++ b/animation_add_corrective_shape_key.py
@@ -200,12 +200,12 @@ class add_corrective_pose_shape(bpy.types.Operator):
return {'FINISHED'}
-def func_object_duplicate_flatten_modifiers(scene, obj):
- mesh = obj.to_mesh(scene, True, 'PREVIEW')
+def func_object_duplicate_flatten_modifiers(context, obj):
+ mesh = obj.to_mesh(context.scene, True, 'PREVIEW')
name = obj.name + "_clean"
new_object = bpy.data.objects.new(name, mesh)
new_object.data = mesh
- scene.objects.link(new_object)
+ context.collection.objects.link(new_object)
return new_object
@@ -220,10 +220,9 @@ class object_duplicate_flatten_modifiers(bpy.types.Operator):
return context.active_object is not None
def execute(self, context):
- scene = context.scene
obj_act = context.active_object
- new_object = func_object_duplicate_flatten_modifiers(scene, obj_act)
+ new_object = func_object_duplicate_flatten_modifiers(context, obj_act)
# setup the context
bpy.ops.object.select_all(action='DESELECT')