From c8cca888518182914e6b4f1b98e0f7b861add08d Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 2 Feb 2022 12:20:03 +0100 Subject: Fix assert in original modifiers pointer update function The issue was happening with a specific file where the ID management code was not fully copying all modifiers because of the extra check in the `BKE_object_support_modifier_type_check()`. While it is arguable that copy-on-write should be a 1:1 copy there is no real need to maintain the per-modifier pointer to its original. Use its SessionUUID to perform lookup in the original datablock. Downside of this approach is that it is a linear lookup instead of direct pointer access, but the upside is that there is less pointers to manage and that the file with unsupported modifiers does behave correct without any asserts. Differential Revision: https://developer.blender.org/D13993 --- source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc | 7 ------- 1 file changed, 7 deletions(-) (limited to 'source/blender/depsgraph/intern') 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 8a3c5c5b776..c2b85caad66 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 @@ -674,12 +674,6 @@ void update_pose_orig_pointers(const bPose *pose_orig, bPose *pose_cow) update_list_orig_pointers(&pose_orig->chanbase, &pose_cow->chanbase, &bPoseChannel::orig_pchan); } -void update_modifiers_orig_pointers(const Object *object_orig, Object *object_cow) -{ - update_list_orig_pointers( - &object_orig->modifiers, &object_cow->modifiers, &ModifierData::orig_modifier_data); -} - void update_nla_strips_orig_pointers(const ListBase *strips_orig, ListBase *strips_cow) { NlaStrip *strip_orig = reinterpret_cast(strips_orig->first); @@ -766,7 +760,6 @@ void update_id_after_copy(const Depsgraph *depsgraph, BKE_gpencil_update_orig_pointers(object_orig, object_cow); } update_particles_after_copy(depsgraph, object_orig, object_cow); - update_modifiers_orig_pointers(object_orig, object_cow); update_proxy_pointers_after_copy(depsgraph, object_orig, object_cow); break; } -- cgit v1.2.3