Fix T44348: Blender crashes when selecting bone from inactive scene in outliner

Pose is not guaranteed to be existing in object, so can't be used for selection
flag clear. Use bones themselves for that.
This commit is contained in:
Sergey Sharybin 2015-04-14 13:24:17 +05:00
parent 8486ee39bd
commit 825b015e92
Notes: blender-bot 2023-02-14 09:15:32 +01:00
Referenced by issue #44348, blender crashes when I click armature bone in outliner.
1 changed files with 5 additions and 3 deletions

View File

@ -554,10 +554,12 @@ static eOLDrawState tree_element_active_bone(
Object *ob = OBACT;
if (ob) {
if (set != OL_SETSEL_EXTEND) {
bPoseChannel *pchannel;
/* single select forces all other bones to get unselected */
for (pchannel = ob->pose->chanbase.first; pchannel; pchannel = pchannel->next)
pchannel->bone->flag &= ~(BONE_TIPSEL | BONE_SELECTED | BONE_ROOTSEL);
Bone *bone;
for (bone = arm->bonebase.first; bone != NULL; bone = bone->next) {
bone->flag &= ~(BONE_TIPSEL | BONE_SELECTED | BONE_ROOTSEL);
do_outliner_bone_select_recursive(arm, bone, false);
}
}
}