diff options
Diffstat (limited to 'source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc')
-rw-r--r-- | source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc | 37 |
1 files changed, 16 insertions, 21 deletions
diff --git a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc index 20aec0ba5ed..9ed50fafc3d 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc @@ -548,9 +548,13 @@ void update_special_pointers(const Depsgraph *depsgraph, object_cow->runtime.mesh_orig = (Mesh *)object_cow->data; } if (object_cow->type == OB_ARMATURE) { - BKE_pose_remap_bone_pointers((bArmature *)object_cow->data, - object_cow->pose); - update_pose_orig_pointers(object_orig->pose, object_cow->pose); + const bArmature *armature_orig = (bArmature *)object_orig->data; + bArmature *armature_cow = (bArmature *)object_cow->data; + BKE_pose_remap_bone_pointers(armature_cow, object_cow->pose); + if (armature_orig->edbo == NULL) { + update_pose_orig_pointers(object_orig->pose, + object_cow->pose); + } } update_particle_system_orig_pointers(object_orig, object_cow); break; @@ -719,20 +723,19 @@ static void deg_update_copy_on_write_animation(const Depsgraph *depsgraph, } typedef struct ObjectRuntimeBackup { - CurveCache *curve_cache; Object_Runtime runtime; short base_flag; } ObjectRuntimeBackup; /* Make a backup of object's evaluation runtime data, additionally - * male object to be safe for free without invalidating backed up + * make object to be safe for free without invalidating backed up * pointers. */ static void deg_backup_object_runtime( Object *object, ObjectRuntimeBackup *object_runtime_backup) { - /* Store evaluated mesh, and make sure we don't free it. */ + /* Store evaluated mesh and curve_cache, and make sure we don't free it. */ Mesh *mesh_eval = object->runtime.mesh_eval; object_runtime_backup->runtime = object->runtime; BKE_object_runtime_reset(object); @@ -743,9 +746,6 @@ static void deg_backup_object_runtime( if (mesh_eval != NULL && object->data == mesh_eval) { object->data = object->runtime.mesh_orig; } - /* Store curve cache and make sure we don't free it. */ - object_runtime_backup->curve_cache = object->curve_cache; - object->curve_cache = NULL; /* Make a backup of base flags. */ object_runtime_backup->base_flag = object->base_flag; } @@ -757,7 +757,7 @@ static void deg_restore_object_runtime( Mesh *mesh_orig = object->runtime.mesh_orig; object->runtime = object_runtime_backup->runtime; object->runtime.mesh_orig = mesh_orig; - if (object->runtime.mesh_eval != NULL) { + if (object->type == OB_MESH && object->runtime.mesh_eval != NULL) { if (object->id.recalc & ID_RECALC_GEOMETRY) { /* If geometry is tagged for update it means, that part of * evaluated mesh are not valid anymore. In this case we can not @@ -773,19 +773,14 @@ static void deg_restore_object_runtime( /* Do same thing as object update: override actual object data * pointer with evaluated datablock. */ - if (object->type == OB_MESH) { - object->data = mesh_eval; - /* Evaluated mesh simply copied edit_btmesh pointer from - * original mesh during update, need to make sure no dead - * pointers are left behind. - */ - mesh_eval->edit_btmesh = mesh_orig->edit_btmesh; - } + object->data = mesh_eval; + /* Evaluated mesh simply copied edit_btmesh pointer from + * original mesh during update, need to make sure no dead + * pointers are left behind. + */ + mesh_eval->edit_btmesh = mesh_orig->edit_btmesh; } } - if (object_runtime_backup->curve_cache != NULL) { - object->curve_cache = object_runtime_backup->curve_cache; - } object->base_flag = object_runtime_backup->base_flag; } |