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:
authorNBurn <7nburn@gmail.com>2019-01-29 18:54:49 +0300
committerNBurn <7nburn@gmail.com>2019-01-29 18:54:49 +0300
commitd609009748a604c1df2d8babfa4098260666d01a (patch)
tree98150e04df48252889e2fc8e049c13115e0afe72 /animation_add_corrective_shape_key.py
parent5c994fde52196dfe8a7e0db03b6935bac001d353 (diff)
addons: objects.link/unlink syntax update
Changed objects.link and objects.unlink from scene to collection
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')