diff options
author | Joshua Leung <aligorith@gmail.com> | 2017-11-01 03:38:51 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2017-11-01 04:42:08 +0300 |
commit | a819ef65c07131ddb203a55bd8dc4e3207130b64 (patch) | |
tree | 7d36d859316df3b9ddd46dfba8413ab60795a66c /source/blender/blenkernel/intern | |
parent | 2ae6a93f05e9efb83c943b2782b5d36b3d57f60c (diff) |
Fix for T48988 - Enabling bbone easing for posemode
This fix enables the usage of bbones easing parameters for edit and pose mode seperately. This allows animators to take advantage of the functionality and may eliminate confusion as the parameters now behave similar to other bbone parameters.
Note that splitting the parameters between the modes effectively creates a new parameter set. Blend files of previous versions do not contain this information and will have the values set to 0 on load. As it broke backwards compatibility for pose mode values anyway, I also took the liberty to rename the easing parameters in some places for consistency (which breaks edit mode values).
Reviewers: aligorith
Subscribers: aligorith
Tags: #animation
Differential Revision: https://developer.blender.org/D2796
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/action.c | 5 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/armature.c | 6 |
2 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c index 5bd6085c8f5..5c2fe0bb040 100644 --- a/source/blender/blenkernel/intern/action.c +++ b/source/blender/blenkernel/intern/action.c @@ -870,6 +870,8 @@ static void copy_pose_channel_data(bPoseChannel *pchan, const bPoseChannel *chan pchan->curveInY = chan->curveInY; pchan->curveOutX = chan->curveOutX; pchan->curveOutY = chan->curveOutY; + pchan->ease1 = chan->ease1; + pchan->ease2 = chan->ease2; pchan->scaleIn = chan->scaleIn; pchan->scaleOut = chan->scaleOut; @@ -1361,6 +1363,7 @@ void BKE_pose_rest(bPose *pose) pchan->roll1 = pchan->roll2 = 0.0f; pchan->curveInX = pchan->curveInY = 0.0f; pchan->curveOutX = pchan->curveOutY = 0.0f; + pchan->ease1 = pchan->ease2 = 0.0f; pchan->scaleIn = pchan->scaleOut = 1.0f; pchan->flag &= ~(POSE_LOC | POSE_ROT | POSE_SIZE | POSE_BBONE_SHAPE); @@ -1404,6 +1407,8 @@ bool BKE_pose_copy_result(bPose *to, bPose *from) pchanto->curveInY = pchanfrom->curveInY; pchanto->curveOutX = pchanfrom->curveOutX; pchanto->curveOutY = pchanfrom->curveOutY; + pchanto->ease1 = pchanfrom->ease1; + pchanto->ease2 = pchanfrom->ease2; pchanto->scaleIn = pchanfrom->scaleIn; pchanto->scaleOut = pchanfrom->scaleOut; diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c index 669344e18d7..2edbd088334 100644 --- a/source/blender/blenkernel/intern/armature.c +++ b/source/blender/blenkernel/intern/armature.c @@ -614,8 +614,10 @@ void b_bone_spline_setup(bPoseChannel *pchan, int rest, Mat4 result_array[MAX_BB { const float circle_factor = length * (cubic_tangent_factor_circle_v3(h1, h2) / 0.75f); - const float hlength1 = bone->ease1 * circle_factor; - const float hlength2 = bone->ease2 * circle_factor; + const float combined_ease1 = bone->ease1 + (!rest ? pchan->ease1 : 0.0f); + const float combined_ease2 = bone->ease2 + (!rest ? pchan->ease2 : 0.0f); + const float hlength1 = combined_ease1 * circle_factor; + const float hlength2 = combined_ease2 * circle_factor; /* and only now negate h2 */ mul_v3_fl(h1, hlength1); |