[Bf-blender-cvs] [50838c5871a] PSketch-279: Cleanup: Separate out ease logic into a separate step for easier experimentation
Joshua Leung
noreply at git.blender.org
Tue May 8 18:03:41 CEST 2018
Commit: 50838c5871a2cb0cfa43f44eddcda9300cc0b75a
Author: Joshua Leung
Date: Tue Jan 2 15:58:26 2018 +1300
Branches: PSketch-279
https://developer.blender.org/rB50838c5871a2cb0cfa43f44eddcda9300cc0b75a
Cleanup: Separate out ease logic into a separate step for easier experimentation
===================================================================
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 03ecb29c914..9973ccf185b 100644
--- a/source/blender/editors/armature/pose_sculpt.c
+++ b/source/blender/editors/armature/pose_sculpt.c
@@ -1608,13 +1608,11 @@ static void psculpt_brush_push_apply(tPoseSculptingOp *pso, bPoseChannel *pchan,
mul_v3_v3fl(vec, delta, fac);
- /* apply curve endpoint effects to the components directly
+ /* Apply curve endpoint effects to the components directly
* (since it should be in bone space):
* - delta.x = bone.bbone_x
* - delta.z = bone.bbone_y
*
- * - delta.y = easing
- *
* Note: After some testing, it seems best to do this with
* no influence scaling, or else the brush just feels
* "mushy" to use...
@@ -1623,14 +1621,30 @@ static void psculpt_brush_push_apply(tPoseSculptingOp *pso, bPoseChannel *pchan,
if (do_head) {
if (do_x) pchan->curveInX += delta[0];
if (do_z) pchan->curveInY += delta[2];
-
- if (do_ease) pchan->ease1 += delta[1] * fac;
}
if (do_tail) {
if (do_x) pchan->curveOutX += delta[0];
if (do_z) pchan->curveOutY += delta[2];
-
- if (do_ease) pchan->ease2 -= delta[1] * fac;
+ }
+
+ /* Map "delta.y" to easing (if shift is pressed),
+ * to allow pushing the curve from one end to the
+ * other. Unlike the curvein/out, this is modulated
+ * by the falloff/influence settings, to damp out the
+ * effect.
+ */
+ if (do_ease) {
+ /* TODO: allowing pushing past the midpoint on the fly (in a single move
+ * (e.g. by considering the direction/magnitude, instead of simply position)
+ */
+ if (do_head) {
+ /* just add, as this points into the bone (along the natural axis) */
+ pchan->ease1 += delta[1] * fac;
+ }
+ if (do_tail) {
+ /* subtract, as this points into the bone from the tail */
+ pchan->ease2 -= delta[1] * fac;
+ }
}
/* move the endpoints of the bone too? */
More information about the Bf-blender-cvs
mailing list