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_fbx | |
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_fbx')
-rw-r--r-- | io_scene_fbx/export_fbx_bin.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/io_scene_fbx/export_fbx_bin.py b/io_scene_fbx/export_fbx_bin.py index e399c807..a64e9a83 100644 --- a/io_scene_fbx/export_fbx_bin.py +++ b/io_scene_fbx/export_fbx_bin.py @@ -2228,7 +2228,10 @@ def fbx_data_from_scene(scene, depsgraph, settings): if backup_pose_positions: depsgraph.update() ob_to_convert = ob.evaluated_get(depsgraph) if settings.use_mesh_modifiers else ob - tmp_me = ob_to_convert.to_mesh() + # NOTE: The dependency graph might be re-evaluating multiple times, which could + # potentially free the mesh created early on. So we put those meshes to bmain and + # free them afterwards. Not ideal but ensures correct ownerwhip. + tmp_me = bpy.data.meshes.new_from_object(ob_to_convert) data_meshes[ob_obj] = (get_blenderID_key(tmp_me), tmp_me, True) # Change armatures back. for armature, pose_position in backup_pose_positions: |