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/makesrna | |
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/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_pose_api.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/makesrna/intern/rna_pose_api.c b/source/blender/makesrna/intern/rna_pose_api.c index 2658cd552bc..4366b18c049 100644 --- a/source/blender/makesrna/intern/rna_pose_api.c +++ b/source/blender/makesrna/intern/rna_pose_api.c @@ -63,7 +63,7 @@ static void rna_PoseBone_bbone_segment_matrix(bPoseChannel *pchan, ReportList *r BKE_reportf(reports, RPT_ERROR, "Bone '%s' has out of date B-Bone segment data!", pchan->name); return; } - if (index < 0 || index >= pchan->runtime.bbone_segments) { + if (index < 0 || index > pchan->runtime.bbone_segments) { BKE_reportf(reports, RPT_ERROR, "Invalid index %d for B-Bone segments of '%s'!", index, pchan->name); return; } @@ -115,13 +115,13 @@ void RNA_api_pose_channel(StructRNA *srna) /* B-Bone segment matrices */ func = RNA_def_function(srna, "bbone_segment_matrix", "rna_PoseBone_bbone_segment_matrix"); - RNA_def_function_ui_description(func, "Retrieve the matrix of the B-Bone segment if available"); + RNA_def_function_ui_description(func, "Retrieve the matrix of the joint between B-Bone segments if available"); RNA_def_function_flag(func, FUNC_USE_REPORTS); parm = RNA_def_property(func, "matrix_return", PROP_FLOAT, PROP_MATRIX); RNA_def_property_multi_array(parm, 2, rna_matrix_dimsize_4x4); RNA_def_property_ui_text(parm, "", "The resulting matrix in bone local space"); RNA_def_function_output(func, parm); - parm = RNA_def_int(func, "index", 0, 0, INT_MAX, "", "Index of the segment", 0, 10000); + parm = RNA_def_int(func, "index", 0, 0, INT_MAX, "", "Index of the segment endpoint", 0, 10000); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); parm = RNA_def_boolean(func, "rest", false, "", "Return the rest pose matrix"); |