[Bf-blender-cvs] [0bcada85b36] master: Fix T67212: No smooth blending in "Push Pose from Breakdown" and "Relax Pose to Breakdown"

Sebastian Parborg noreply at git.blender.org
Fri Oct 4 16:39:08 CEST 2019


Commit: 0bcada85b362fcc1874a1bf13ece157870c0fea7
Author: Sebastian Parborg
Date:   Fri Oct 4 16:37:56 2019 +0200
Branches: master
https://developer.blender.org/rB0bcada85b362fcc1874a1bf13ece157870c0fea7

Fix T67212: No smooth blending in "Push Pose from Breakdown" and "Relax Pose to Breakdown"

The previous method produced non smooth interpolation results and it was
very hard to control. (At least for me it seemed to be broken until I
actually took a look at what the code actually did)

Now we simply linearly interpolate between the breakdown position and
the current bone data.

Reviewed By: Sybren, Hjalti

Differential Revision: http://developer.blender.org/D5892

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

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

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

diff --git a/source/blender/editors/armature/pose_slide.c b/source/blender/editors/armature/pose_slide.c
index 616daf94e57..7ed41b5b4d0 100644
--- a/source/blender/editors/armature/pose_slide.c
+++ b/source/blender/editors/armature/pose_slide.c
@@ -368,30 +368,14 @@ static void pose_slide_apply_val(tPoseSlideOp *pso, FCurve *fcu, Object *ob, flo
   switch (pso->mode) {
     case POSESLIDE_PUSH: /* make the current pose more pronounced */
     {
-      /* perform a weighted average here, favoring the middle pose
-       * - numerator should be larger than denominator to 'expand' the result
-       * - perform this weighting a number of times given by the percentage...
-       */
-      /* TODO: maybe a sensitivity ctrl on top of this is needed */
-      int iters = (int)ceil(10.0f * pso->percentage);
-
-      while (iters-- > 0) {
-        (*val) = (-((sVal * w2) + (eVal * w1)) + ((*val) * 6.0f)) / 5.0f;
-      }
+      /* Slide the pose away from the breakdown pose in the timeline */
+      (*val) -= ((sVal * w2) + (eVal * w1) - (*val)) * pso->percentage;
       break;
     }
     case POSESLIDE_RELAX: /* make the current pose more like its surrounding ones */
     {
-      /* perform a weighted average here, favoring the middle pose
-       * - numerator should be smaller than denominator to 'relax' the result
-       * - perform this weighting a number of times given by the percentage...
-       */
-      /* TODO: maybe a sensitivity ctrl on top of this is needed */
-      int iters = (int)ceil(10.0f * pso->percentage);
-
-      while (iters-- > 0) {
-        (*val) = (((sVal * w2) + (eVal * w1)) + ((*val) * 5.0f)) / 6.0f;
-      }
+      /* Slide the pose towards the breakdown pose in the timeline */
+      (*val) += ((sVal * w2) + (eVal * w1) - (*val)) * pso->percentage;
       break;
     }
     case POSESLIDE_BREAKDOWN: /* make the current pose slide around between the endpoints */



More information about the Bf-blender-cvs mailing list