From 2c0bceb1f51344ece4be7a41ca93cc72f0151667 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 18 Dec 2012 07:38:02 +0000 Subject: fix for own error in recent commit with active pose mode, depended on an uninitialized flag. --- .../editors/transform/transform_manipulator.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'source') diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c index f848ab9f4dc..6b016bf4303 100644 --- a/source/blender/editors/transform/transform_manipulator.c +++ b/source/blender/editors/transform/transform_manipulator.c @@ -148,10 +148,8 @@ static void stats_pose(Scene *scene, RegionView3D *rv3d, bPoseChannel *pchan) Bone *bone = pchan->bone; if (bone) { - if (bone->flag & BONE_TRANSFORM) { - calc_tw_center(scene, pchan->pose_head); - protectflag_to_drawflags(pchan->protectflag, &rv3d->twdrawflag); - } + calc_tw_center(scene, pchan->pose_head); + protectflag_to_drawflags(pchan->protectflag, &rv3d->twdrawflag); } } @@ -503,9 +501,12 @@ int calc_manipulator_stats(const bContext *C) if ((v3d->around == V3D_ACTIVE) && (pchan = BKE_pose_channel_active(ob))) { /* doesn't check selection or visibility intentionally */ - stats_pose(scene, rv3d, pchan); - totsel = 1; - ok = TRUE; + Bone *bone = pchan->bone; + if (bone) { + stats_pose(scene, rv3d, pchan); + totsel = 1; + ok = TRUE; + } } else { totsel = count_set_pose_transflags(&mode, 0, ob); @@ -513,7 +514,10 @@ int calc_manipulator_stats(const bContext *C) if (totsel) { /* use channels to get stats */ for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) { - stats_pose(scene, rv3d, pchan); + Bone *bone = pchan->bone; + if (bone && (bone->flag & BONE_TRANSFORM)) { + stats_pose(scene, rv3d, pchan); + } } ok = TRUE; } -- cgit v1.2.3