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:
authorCampbell Barton <ideasman42@gmail.com>2021-04-28 06:20:12 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-04-28 06:20:12 +0300
commit6eb2f71875c69f5f6073fed2d285fe8ef662ba03 (patch)
tree4f6f07005cf2baf9e5aaa7d2a7e305f0146fdc04 /source/blender/editors
parenta4191c2d184705e18177b10f1f91eea3243a475c (diff)
Fix T87631: Crash undoing edit-mode bone duplication
Edit mode could leave pose channels in the object that didn't have an associated bone. These are now cleared when freeing edit-mode data.
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/object/object_edit.c7
-rw-r--r--source/blender/editors/util/ed_util.c1
2 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c
index 0894314328e..196b330179b 100644
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@ -55,6 +55,7 @@
#include "IMB_imbuf_types.h"
#include "BKE_anim_visualization.h"
+#include "BKE_armature.h"
#include "BKE_collection.h"
#include "BKE_constraint.h"
#include "BKE_context.h"
@@ -578,6 +579,12 @@ static bool ED_object_editmode_load_free_ex(Main *bmain,
if (free_data) {
ED_armature_edit_free(obedit->data);
+
+ if (load_data == false) {
+ /* Don't keep unused pose channels created by duplicating bones
+ * which may have been deleted/undone, see: T87631. */
+ BKE_pose_channels_clear_with_null_bone(obedit->pose, true);
+ }
}
/* TODO(sergey): Pose channels might have been changed, so need
* to inform dependency graph about this. But is it really the
diff --git a/source/blender/editors/util/ed_util.c b/source/blender/editors/util/ed_util.c
index b80782b51be..a1ff6326644 100644
--- a/source/blender/editors/util/ed_util.c
+++ b/source/blender/editors/util/ed_util.c
@@ -33,6 +33,7 @@
#include "BLT_translation.h"
+#include "BKE_armature.h"
#include "BKE_global.h"
#include "BKE_main.h"
#include "BKE_material.h"