[Bf-blender-cvs] [5e3b6e951b0] master: Cleanup: minor changes to transform-manipulator

Campbell Barton noreply at git.blender.org
Thu Apr 6 04:02:57 CEST 2017


Commit: 5e3b6e951b0914010396257b723b1d5331433719
Author: Campbell Barton
Date:   Thu Apr 6 12:00:14 2017 +1000
Branches: master
https://developer.blender.org/rB5e3b6e951b0914010396257b723b1d5331433719

Cleanup: minor changes to transform-manipulator

Match stats_editbone & stats_pchan behavior to avoid confusion.

===================================================================

M	source/blender/editors/transform/transform_manipulator.c

===================================================================

diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c
index 0a984d90ae3..b41b247683f 100644
--- a/source/blender/editors/transform/transform_manipulator.c
+++ b/source/blender/editors/transform/transform_manipulator.c
@@ -143,21 +143,17 @@ static void protectflag_to_drawflags(short protectflag, short *drawflags)
 }
 
 /* for pose mode */
-static void stats_pose(Scene *scene, RegionView3D *rv3d, bPoseChannel *pchan)
+static void stats_pchan(RegionView3D *rv3d, bPoseChannel *pchan)
 {
-	Bone *bone = pchan->bone;
-
-	if (bone) {
-		calc_tw_center(scene, pchan->pose_head);
-		protectflag_to_drawflags(pchan->protectflag, &rv3d->twdrawflag);
-	}
+	protectflag_to_drawflags(pchan->protectflag, &rv3d->twdrawflag);
 }
 
 /* for editmode*/
 static void stats_editbone(RegionView3D *rv3d, EditBone *ebo)
 {
-	if (ebo->flag & BONE_EDITMODE_LOCKED)
+	if (ebo->flag & BONE_EDITMODE_LOCKED) {
 		protectflag_to_drawflags(OB_LOCK_LOC | OB_LOCK_ROT | OB_LOCK_SCALE, &rv3d->twdrawflag);
+	}
 }
 
 /* could move into BLI_math however this is only useful for display/editing purposes */
@@ -530,7 +526,8 @@ static int calc_manipulator_stats(const bContext *C)
 			/* doesn't check selection or visibility intentionally */
 			Bone *bone = pchan->bone;
 			if (bone) {
-				stats_pose(scene, rv3d, pchan);
+				calc_tw_center(scene, pchan->pose_head);
+				stats_pchan(rv3d, pchan);
 				totsel = 1;
 				ok = true;
 			}
@@ -543,7 +540,8 @@ static int calc_manipulator_stats(const bContext *C)
 				for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
 					Bone *bone = pchan->bone;
 					if (bone && (bone->flag & BONE_TRANSFORM)) {
-						stats_pose(scene, rv3d, pchan);
+						calc_tw_center(scene, pchan->pose_head);
+						stats_pchan(rv3d, pchan);
 					}
 				}
 				ok = true;




More information about the Bf-blender-cvs mailing list