diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2019-04-05 18:40:59 +0300 |
---|---|---|
committer | Alexander Gavrilov <angavrilov@gmail.com> | 2019-04-13 16:27:42 +0300 |
commit | 51c8a6f491d3b21a6c91af6267f58d4f0add58af (patch) | |
tree | d254efa3f8eee0efc31da345a726db971610ee42 /source/blender/blenkernel/BKE_armature.h | |
parent | f7e35d61f826c8e3581b34eea36b8fc39c572bee (diff) |
Fix T37500: implement Bendy bone segment deformation interpolation.
Previously B-Bone deformation mapped every vertex to just one
B-Bone segment. This results in abrupt transformation differences
between the sides of each threshold plane, reducing the quality
of B-Bone deformation and making the use of shape keys impractical.
This commit replaces this approach with a linear blend between
the two closest segment transformations, effectively representing
the B-Bone as two weight-blended plain bones for each vertex.
In order to distribute the interpolation more evenly along the
bone, segment matrices for deformation are now computed at points
between the segments and at the ends of the B-Bone. The computation
also uses the true tangents of the Bezier curve for the orientation.
The nodes at the end of the bone require some special handling to
deal with zero-length Bezier handles caused by a zero ease value.
The Copy Transforms constraint now also smoothly interpolates
rotation and scaling along the bone shape when enabled.
The initial version of the patch was submitted by @Sam200.
Differential Revision: https://developer.blender.org/D4635
Diffstat (limited to 'source/blender/blenkernel/BKE_armature.h')
-rw-r--r-- | source/blender/blenkernel/BKE_armature.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/blenkernel/BKE_armature.h b/source/blender/blenkernel/BKE_armature.h index 09d8cbf933c..7182561a038 100644 --- a/source/blender/blenkernel/BKE_armature.h +++ b/source/blender/blenkernel/BKE_armature.h @@ -184,7 +184,7 @@ void BKE_pchan_bbone_spline_params_get( struct bPoseChannel *pchan, const bool rest, struct BBoneSplineParameters *r_param); void BKE_pchan_bbone_spline_setup( - struct bPoseChannel *pchan, const bool rest, Mat4 result_array[MAX_BBONE_SUBDIV]); + struct bPoseChannel *pchan, const bool rest, const bool for_deform, Mat4 *result_array); void BKE_pchan_bbone_handles_compute( const BBoneSplineParameters *param, @@ -192,13 +192,15 @@ void BKE_pchan_bbone_handles_compute( float h2[3], float *r_roll2, bool ease, bool offsets); int BKE_pchan_bbone_spline_compute( - struct BBoneSplineParameters *param, Mat4 result_array[MAX_BBONE_SUBDIV]); + struct BBoneSplineParameters *param, const bool for_deform, Mat4 *result_array); void BKE_pchan_bbone_segments_cache_compute( struct bPoseChannel *pchan); void BKE_pchan_bbone_segments_cache_copy( struct bPoseChannel *pchan, struct bPoseChannel *pchan_from); +void BKE_pchan_bbone_deform_segment_index(const struct bPoseChannel *pchan, float pos, int *r_index, float *r_blend_next); + /* like EBONE_VISIBLE */ #define PBONE_VISIBLE(arm, bone) ( \ CHECK_TYPE_INLINE(arm, bArmature *), \ |