[Bf-blender-cvs] [fd95b6f] BendyBones: Bendy Bones: Fix for Clear Rotation/Scale not affecting the Bendy Bone settings

Joshua Leung noreply at git.blender.org
Tue May 17 16:40:59 CEST 2016


Commit: fd95b6f82ec8f58095da96ebde5ee6f67ba7a664
Author: Joshua Leung
Date:   Wed May 18 02:03:20 2016 +1200
Branches: BendyBones
https://developer.blender.org/rBfd95b6f82ec8f58095da96ebde5ee6f67ba7a664

Bendy Bones: Fix for Clear Rotation/Scale not affecting the Bendy Bone settings

* These operators were still clearing the pchan->bone (i.e. restpose values) instead
  of the pchan values, which may have messed things up quite a bit.
* I've also now included the curve x/y stuff in rotation. While the transform being
  applied to the handles is more like translation, the effect is actually closer
  to rotation of the bone segments. So, on balance, let's try it this way.

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

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

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

diff --git a/source/blender/editors/armature/pose_transform.c b/source/blender/editors/armature/pose_transform.c
index 972238e..df906a3 100644
--- a/source/blender/editors/armature/pose_transform.c
+++ b/source/blender/editors/armature/pose_transform.c
@@ -556,9 +556,9 @@ static void pchan_clear_scale(bPoseChannel *pchan)
 		pchan->size[1] = 1.0f;
 	if ((pchan->protectflag & OB_LOCK_SCALEZ) == 0)
 		pchan->size[2] = 1.0f;
-
-	pchan->bone->scaleIn = 1.0f;
-	pchan->bone->scaleOut = 1.0f;
+	
+	pchan->scaleIn = 1.0f;
+	pchan->scaleOut = 1.0f;
 }
 
 /* clear location of pose-channel */
@@ -669,8 +669,15 @@ static void pchan_clear_rot(bPoseChannel *pchan)
 			zero_v3(pchan->eul);
 		}
 	}
-	pchan->bone->roll1 = 0.0f;
-	pchan->bone->roll2 = 0.0f;
+	
+	/* Clear also Bendy Bone stuff - Roll is obvious, but Curve X/Y stuff is also kindof rotational in nature... */
+	pchan->roll1 = 0.0f;
+	pchan->roll2 = 0.0f;
+	
+	pchan->curveInX = 0.0f;
+	pchan->curveInY = 0.0f;
+	pchan->curveOutX = 0.0f;
+	pchan->curveOutY = 0.0f;
 }
 
 /* clear loc/rot/scale of pose-channel */




More information about the Bf-blender-cvs mailing list