diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2012-10-19 23:16:18 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2012-10-19 23:16:18 +0400 |
commit | 2256c8e25f597b5499e8bf64dd0fe74c1ea31864 (patch) | |
tree | dbdf42ea5db9da1f181f7b44c1e51d93ebf36f64 /source | |
parent | 3fec74ec1acbd2d8b3491bc44c87ef60c037a4f8 (diff) |
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).
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/object.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index a0d27737705..fd58af34862 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -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); |