[Bf-blender-cvs] [5dd5286995e] master: Apply Pose as Rest Pose: Bendy Bone support

Joshua Leung noreply at git.blender.org
Mon Jan 29 05:22:57 CET 2018


Commit: 5dd5286995e4a924c1a04df812050bf15b980ac2
Author: Joshua Leung
Date:   Mon Jan 29 14:46:03 2018 +1300
Branches: master
https://developer.blender.org/rB5dd5286995e4a924c1a04df812050bf15b980ac2

Apply Pose as Rest Pose: Bendy Bone support

The "Apply Pose as Rest Pose" operator now affects Bendy Bone settings
too, making it possible to use interactive posing tools (e.g. Pose Sculpting
brushes) to get the desired shape for the rest-pose shape of Bendy Bones.
When such posing tools are available, this change makes it easier to get
the desired Bendy Bone shapes, as you are no longer restricted to using
buttons to get the desired effects.

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

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 3707b914ecb..4feb1681349 100644
--- a/source/blender/editors/armature/pose_transform.c
+++ b/source/blender/editors/armature/pose_transform.c
@@ -151,6 +151,28 @@ static int apply_armature_pose2bones_exec(bContext *C, wmOperator *op)
 			curbone->roll = eul[1];
 		}
 		
+		/* combine pose and rest values for bendy bone settings,
+		 * then clear the pchan values (so we don't get a double-up)
+		 */
+		if (pchan->bone->segments > 1) {
+			curbone->curveInX += pchan->curveInX;
+			curbone->curveInY += pchan->curveInY;
+			curbone->curveOutX += pchan->curveOutX;
+			curbone->curveOutY += pchan->curveOutY;
+			curbone->roll1 += pchan->roll1;
+			curbone->roll2 += pchan->roll2;
+			curbone->ease1 += pchan->ease1;
+			curbone->ease2 += pchan->ease2;
+			curbone->scaleIn += pchan->scaleIn;
+			curbone->scaleOut += pchan->scaleOut;
+			
+			pchan->curveInX = pchan->curveOutX = 0.0f;
+			pchan->curveInY = pchan->curveOutY = 0.0f;
+			pchan->roll1 = pchan->roll2 = 0.0f;
+			pchan->ease1 = pchan->ease2 = 0.0f;
+			pchan->scaleIn = pchan->scaleOut = 1.0f;
+		}
+		
 		/* clear transform values for pchan */
 		zero_v3(pchan->loc);
 		zero_v3(pchan->eul);



More information about the Bf-blender-cvs mailing list