[Bf-blender-cvs] [2156841c8ca] master: Fix T96452: Armature corrupted after undoing 'Join' operation.

Bastien Montagne noreply at git.blender.org
Tue Mar 15 15:02:50 CET 2022


Commit: 2156841c8ca8e754e073ceb14912c7529af891bf
Author: Bastien Montagne
Date:   Tue Mar 15 15:00:19 2022 +0100
Branches: master
https://developer.blender.org/rB2156841c8ca8e754e073ceb14912c7529af891bf

Fix T96452: Armature corrupted after undoing 'Join' operation.

Modified source Armature ID in the join operation was not properly
tagged as such for the depsgraph (and therefore memfile undo)..

Issue caused/revealed by rBe648e388874a.

Should be backported to 3.1 should we make a corrective release.

===================================================================

M	source/blender/editors/armature/armature_relations.c

===================================================================

diff --git a/source/blender/editors/armature/armature_relations.c b/source/blender/editors/armature/armature_relations.c
index 45d64807e65..be4829c02be 100644
--- a/source/blender/editors/armature/armature_relations.c
+++ b/source/blender/editors/armature/armature_relations.c
@@ -377,6 +377,15 @@ int ED_armature_join_objects_exec(bContext *C, wmOperator *op)
         BKE_pose_channels_hash_free(pose);
       }
 
+      /* Armature ID itself is not freed below, however it has been modified (and is now completely
+       * empty). This needs to be told to the depsgraph, it will also ensure that the global
+       * memfile undo system properly detects the change.
+       *
+       * FIXME: Modifying an existing obdata because we are joining an object using it into another
+       * object is a very questionable behavior, which also does not match with other object types
+       * joining. */
+      DEG_id_tag_update_ex(bmain, &curarm->id, ID_RECALC_GEOMETRY);
+
       /* Fix all the drivers (and animation data) */
       BKE_fcurves_main_cb(bmain, joined_armature_fix_animdata_cb, &afd);
       BLI_ghash_free(afd.names_map, MEM_freeN, NULL);



More information about the Bf-blender-cvs mailing list