[Bf-blender-cvs] [26ccd7424f3] PSketch-279: Cleanup: Rename bbone value cache names

Joshua Leung noreply at git.blender.org
Tue May 8 18:03:49 CEST 2018


Commit: 26ccd7424f3fda065c1b57832e518bcc92da5631
Author: Joshua Leung
Date:   Tue Jan 2 16:31:55 2018 +1300
Branches: PSketch-279
https://developer.blender.org/rB26ccd7424f3fda065c1b57832e518bcc92da5631

Cleanup: Rename bbone value cache names

We weren't gaining anything from converting to arrays and then back again,
so let's just use the same naming scheme as used in the actual bones.

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

M	source/blender/editors/armature/pose_sculpt.c

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

diff --git a/source/blender/editors/armature/pose_sculpt.c b/source/blender/editors/armature/pose_sculpt.c
index 90b9cefee1f..130ac6a85c3 100644
--- a/source/blender/editors/armature/pose_sculpt.c
+++ b/source/blender/editors/armature/pose_sculpt.c
@@ -144,13 +144,23 @@ typedef struct tAffectedBone {
 	bPoseChannel *pchan;		/* bone in question */
 	float fac;					/* (last) strength factor applied to this bone */
 	
-	float oldloc[3];            /* transform values at start of operator (to be restored before each modal step) */
+	/* transform values at start of operator (to be restored before each modal step) */
+	float oldloc[3];
 	float oldrot[3];
 	float oldscale[3];
 	float oldquat[4];
 	float oldangle;
 	float oldaxis[3];
 	
+	/* original bendy bone values */
+	float curveInX;
+	float curveInY;
+	float curveOutX;
+	float curveOutY;
+	float roll1, roll2;
+	float ease1, ease2;
+	float scaleIn, scaleOut;
+	
 	float bbcurvein[2];         /* original bendy bone vals - x/y components are grouped together here */
 	float bbcurveout[2];
 	float bbroll[2];            /* original bendy bone vals - we group the head/tail or 1/2 versions together */
@@ -861,16 +871,16 @@ static tAffectedBone *verify_bone_is_affected(tPoseSculptingOp *pso, bPoseChanne
 		copy_v3_v3(tab->oldaxis, pchan->rotAxis);
 		tab->oldangle = pchan->rotAngle;
 		
-		tab->bbcurvein[0] = pchan->curveInX;
-		tab->bbcurvein[1] = pchan->curveInY;
-		tab->bbcurveout[0] = pchan->curveOutX;
-		tab->bbcurveout[1] = pchan->curveOutY;
-		tab->bbroll[0] = pchan->roll1;
-		tab->bbroll[1] = pchan->roll2;
-		tab->bbease[0] = pchan->ease1;
-		tab->bbease[1] = pchan->ease2;
-		tab->bbscale[0] = pchan->scaleIn;
-		tab->bbscale[1] = pchan->scaleOut;
+		tab->curveInX = pchan->curveInX;
+		tab->curveInY = pchan->curveInY;
+		tab->curveOutX = pchan->curveOutX;
+		tab->curveOutY = pchan->curveOutY;
+		tab->roll1 = pchan->roll1;
+		tab->roll2 = pchan->roll2;
+		tab->ease1 = pchan->ease1;
+		tab->ease2 = pchan->ease2;
+		tab->scaleIn = pchan->scaleIn;
+		tab->scaleOut = pchan->scaleOut;
 		
 		// TODO: custom props?
 	}
@@ -1558,20 +1568,20 @@ static void psculpt_brush_restore_apply(tPoseSculptingOp *pso, bPoseChannel *pch
 		float bb_fac = psculpt_brush_calc_bendybone_influence(pso, dist, sco1, sco2, &do_head, &do_tail);
 		
 		if (do_head) {
-			pchan->curveInX = interpf(tab->bbcurvein[0], pchan->curveInX, bb_fac);
-			pchan->curveInY = interpf(tab->bbcurvein[1], pchan->curveInY, bb_fac);
+			pchan->curveInX = interpf(tab->curveInX, pchan->curveInX, bb_fac);
+			pchan->curveInY = interpf(tab->curveInY, pchan->curveInY, bb_fac);
 			
-			pchan->roll1 = interpf(tab->bbroll[0], pchan->roll1, bb_fac);
-			pchan->ease1 = interpf(tab->bbease[0], pchan->ease1, bb_fac);
-			pchan->scaleIn = interpf(tab->bbscale[0], pchan->scaleIn, bb_fac);
+			pchan->roll1 = interpf(tab->roll1, pchan->roll1, bb_fac);
+			pchan->ease1 = interpf(tab->ease1, pchan->ease1, bb_fac);
+			pchan->scaleIn = interpf(tab->scaleIn, pchan->scaleIn, bb_fac);
 		}
 		if (do_tail) {
-			pchan->curveOutX = interpf(tab->bbcurveout[0], pchan->curveOutX, bb_fac);
-			pchan->curveOutY = interpf(tab->bbcurveout[1], pchan->curveOutY, bb_fac);
+			pchan->curveOutX = interpf(tab->curveOutX, pchan->curveOutX, bb_fac);
+			pchan->curveOutY = interpf(tab->curveOutY, pchan->curveOutY, bb_fac);
 			
-			pchan->roll2 = interpf(tab->bbroll[1], pchan->roll2, bb_fac);
-			pchan->ease2 = interpf(tab->bbease[1], pchan->ease2, bb_fac);
-			pchan->scaleOut = interpf(tab->bbscale[1], pchan->scaleOut, bb_fac);
+			pchan->roll2 = interpf(tab->roll2, pchan->roll2, bb_fac);
+			pchan->ease2 = interpf(tab->ease2, pchan->ease2, bb_fac);
+			pchan->scaleOut = interpf(tab->scaleOut, pchan->scaleOut, bb_fac);
 		}
 	}
 }



More information about the Bf-blender-cvs mailing list