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:
authorClément Foucault <foucault.clem@gmail.com>2019-07-15 16:13:33 +0300
committerClément Foucault <foucault.clem@gmail.com>2019-07-15 16:13:45 +0300
commit9db772fe9afea62657ccdfaeda0bff8700c490ef (patch)
treecb504db8ded7d830333045da1b8f856f5a0ef087 /source/blender/blenkernel/intern/action.c
parente66c3589a2a67d880f4d3dbfa7e3ba473c3751b8 (diff)
Fix T66991 Crash when deleting edit bones when pchan is referenced by bendybone
This was caused by loose pointers. This diff takes care of clearing the fields of other bones before deleting the pchan. Reviewers: brecht, sergey Reviewed By: brecht, sergey Differential Revision: https://developer.blender.org/D5258
Diffstat (limited to 'source/blender/blenkernel/intern/action.c')
-rw-r--r--source/blender/blenkernel/intern/action.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c
index 6dd4eefc014..3e3a533275b 100644
--- a/source/blender/blenkernel/intern/action.c
+++ b/source/blender/blenkernel/intern/action.c
@@ -729,6 +729,21 @@ void BKE_pose_channels_hash_free(bPose *pose)
}
}
+static void pose_channels_remove_internal_links(Object *ob, bPoseChannel *unlinked_pchan)
+{
+ LISTBASE_FOREACH (bPoseChannel *, pchan, &ob->pose->chanbase) {
+ if (pchan->bbone_prev == unlinked_pchan) {
+ pchan->bbone_prev = NULL;
+ }
+ if (pchan->bbone_next == unlinked_pchan) {
+ pchan->bbone_next = NULL;
+ }
+ if (pchan->custom_tx == unlinked_pchan) {
+ pchan->custom_tx = NULL;
+ }
+ }
+}
+
/**
* Selectively remove pose channels.
*/
@@ -747,6 +762,7 @@ void BKE_pose_channels_remove(Object *ob,
if (filter_fn(pchan->name, user_data)) {
/* Bone itself is being removed */
BKE_pose_channel_free(pchan);
+ pose_channels_remove_internal_links(ob, pchan);
if (ob->pose->chanhash) {
BLI_ghash_remove(ob->pose->chanhash, pchan->name, NULL, NULL);
}