Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <bastien@blender.org>2022-03-15 17:00:19 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2022-03-21 15:21:50 +0300
commit2fc52fb742396bf790395a0327cf77c1c97fd229 (patch)
tree2e64a68bd3da902ceb77f873d63b05ffd0661161
parent18db6ed3c9d386bb178ab887604943298a9bac57 (diff)
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.
-rw-r--r--source/blender/editors/armature/armature_relations.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/editors/armature/armature_relations.c b/source/blender/editors/armature/armature_relations.c
index eebe8a447f7..86a7b02bc3b 100644
--- a/source/blender/editors/armature/armature_relations.c
+++ b/source/blender/editors/armature/armature_relations.c
@@ -393,6 +393,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);