Fix [#32925] Center cursor (shift+C) crashing blender after duplicating bone in armature edit mode.

Center Cursor uses BKE_object_minmax(), which uses pchans' bone member to check whether a bone is visible or not. But after a duplication, the duplicated pchan->bone are NULL, skiping in this case (as if they were hidden, not optimal but should do the work for now - anyway, using pchan's values in Edit mode does not really make sense, imho).
This commit is contained in:
Bastien Montagne
2012-10-19 19:16:18 +00:00
parent 3fec74ec1a
commit 2256c8e25f

View File

@@ -2300,11 +2300,9 @@ void BKE_object_minmax(Object *ob, float min_r[3], float max_r[3], const short u
bPoseChannel *pchan;
for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
if ((use_hidden == FALSE) && (PBONE_VISIBLE(arm, pchan->bone) == FALSE)) {
/* pass */
}
else {
/* XXX pchan->bone may be NULL for duplicated bones, see duplicateEditBoneObjects() comment
* (editarmature.c:2592)... Skip in this case too! */
if (pchan->bone && !((use_hidden == FALSE) && (PBONE_VISIBLE(arm, pchan->bone) == FALSE))) {
mul_v3_m4v3(vec, ob->obmat, pchan->pose_head);
minmax_v3v3_v3(min_r, max_r, vec);
mul_v3_m4v3(vec, ob->obmat, pchan->pose_tail);