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 /io_scene_gltf2/blender | |
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 'io_scene_gltf2/blender')
-rwxr-xr-x | io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py index 35785c80..d74a5c1d 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py @@ -227,7 +227,8 @@ def __gather_mesh(blender_object, export_settings): modifier.show_viewport = False depsgraph = bpy.context.evaluated_depsgraph_get() - blender_mesh = blender_object.evaluated_get(depsgraph).to_mesh() + blender_mesh_owner = blender_object.evaluated_get(depsgraph) + blender_mesh = blender_mesh_owner.to_mesh() for prop in blender_object.data.keys(): blender_mesh[prop] = blender_object.data[prop] skip_filter = True @@ -247,7 +248,7 @@ def __gather_mesh(blender_object, export_settings): result = gltf2_blender_gather_mesh.gather_mesh(blender_mesh, vertex_groups, modifiers, skip_filter, export_settings) if export_settings[gltf2_blender_export_keys.APPLY]: - bpy.data.meshes.remove(blender_mesh) + blender_mesh_owner.to_mesh_clear() return result @@ -308,6 +309,7 @@ def __gather_skin(blender_object, export_settings): # check if any vertices in the mesh are part of a vertex group depsgraph = bpy.context.evaluated_depsgraph_get() + # XXX: ... blender_mesh = blender_object.evaluated_get(depsgraph).to_mesh() if not any(vertex.groups is not None and len(vertex.groups) > 0 for vertex in blender_mesh.vertices): return None |