diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2019-04-20 18:06:31 +0300 |
---|---|---|
committer | Alexander Gavrilov <angavrilov@gmail.com> | 2019-04-23 13:45:03 +0300 |
commit | 624e93bbef8a8a34be822c1a98df131439c32788 (patch) | |
tree | 592fce70ac6a810c6ee4ab9c0c3ce87ebedc14cf /source/blender/editors/armature/pose_transform.c | |
parent | c043ab1cf3bce77248a8d7dfa42b2e9f8f9611aa (diff) |
B-Bones: split the Scale In/Out properties into X and Y values.
As far as I can tell, there is no technical reason why the B-Bone
segment thickness scaling can't be separated into two axes. The
only downside is the increase in complexity of the B-Bone settings,
but this is inevitable due to the increase in flexibility.
Updating the file is somewhat complicated though, because F-Curves
and drivers have to be duplicated and updated to the new names.
Reviewers: campbellbarton
Subscribers: icappiello, jpbouza
Differential Revision: https://developer.blender.org/D4716
Diffstat (limited to 'source/blender/editors/armature/pose_transform.c')
-rw-r--r-- | source/blender/editors/armature/pose_transform.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/source/blender/editors/armature/pose_transform.c b/source/blender/editors/armature/pose_transform.c index 91f0bdc51ad..03984bfdbd8 100644 --- a/source/blender/editors/armature/pose_transform.c +++ b/source/blender/editors/armature/pose_transform.c @@ -170,15 +170,18 @@ static int apply_armature_pose2bones_exec(bContext *C, wmOperator *op) curbone->roll2 += pchan_eval->roll2; curbone->ease1 += pchan_eval->ease1; curbone->ease2 += pchan_eval->ease2; - curbone->scaleIn += pchan_eval->scaleIn; - curbone->scaleOut += pchan_eval->scaleOut; + curbone->scale_in_x *= pchan_eval->scale_in_x; + curbone->scale_in_y *= pchan_eval->scale_in_y; + curbone->scale_out_x *= pchan_eval->scale_out_x; + curbone->scale_out_y *= pchan_eval->scale_out_y; /* reset pose values */ 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; + pchan->scale_in_x = pchan->scale_in_y = 1.0f; + pchan->scale_out_x = pchan->scale_out_y = 1.0f; } /* clear transform values for pchan */ @@ -406,8 +409,10 @@ static bPoseChannel *pose_bone_do_paste(Object *ob, pchan->roll2 = chan->roll2; pchan->ease1 = chan->ease1; pchan->ease2 = chan->ease2; - pchan->scaleIn = chan->scaleIn; - pchan->scaleOut = chan->scaleOut; + pchan->scale_in_x = chan->scale_in_x; + pchan->scale_in_y = chan->scale_in_y; + pchan->scale_out_x = chan->scale_out_x; + pchan->scale_out_y = chan->scale_out_y; /* paste flipped pose? */ if (flip) { @@ -654,8 +659,8 @@ static void pchan_clear_scale(bPoseChannel *pchan) pchan->ease1 = 0.0f; pchan->ease2 = 0.0f; - pchan->scaleIn = 1.0f; - pchan->scaleOut = 1.0f; + pchan->scale_in_x = pchan->scale_in_y = 1.0f; + pchan->scale_out_x = pchan->scale_out_y = 1.0f; } /* clear location of pose-channel */ |