diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-05-16 16:01:17 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-05-16 17:43:14 +0300 |
commit | 901868a4b2fc6e70d9c74119d97c57de132859a3 (patch) | |
tree | 94f96b6fd5f8a1ec509c6551f504cad958c1688f /animation_add_corrective_shape_key.py | |
parent | 2e5b7a4a044ab982af66def583ae16bb563a1357 (diff) |
Update for Depsgraph API changes
Addresses new behavior of object.to_mesh().
This is corresponding part for D4875.
Reviewers: brecht
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D4876
Diffstat (limited to 'animation_add_corrective_shape_key.py')
-rw-r--r-- | animation_add_corrective_shape_key.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/animation_add_corrective_shape_key.py b/animation_add_corrective_shape_key.py index e40a7919..91d57396 100644 --- a/animation_add_corrective_shape_key.py +++ b/animation_add_corrective_shape_key.py @@ -71,7 +71,8 @@ def extract_mapped_coords(ob, shape_verts): totvert = len(shape_verts) depsgraph = context.evaluated_depsgraph_get() - mesh = ob.evaluated_get(depsgraph).to_mesh() + ob_eval = ob.evaluated_get(depsgraph) + mesh = ob_eval.to_mesh() # cheating, the original mapped verts happen # to be at the end of the vertex array @@ -79,7 +80,7 @@ def extract_mapped_coords(ob, shape_verts): arr = [verts[i].co.copy() for i in range(len(verts) - totvert, len(verts))] mesh.user_clear() - bpy.data.meshes.remove(mesh) + ob_eval.to_mesh_clear() return arr @@ -203,7 +204,7 @@ class add_corrective_pose_shape(bpy.types.Operator): def func_object_duplicate_flatten_modifiers(context, obj): depsgraph = context.evaluated_depsgraph_get() - mesh = obj.evaluated_get(depsgraph).to_mesh() + mesh = bpy.data.meshes.new_from_object(obj.evaluated_get(depsgraph)) name = obj.name + "_clean" new_object = bpy.data.objects.new(name, mesh) new_object.data = mesh |