Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Gavrilov <angavrilov@gmail.com>2019-04-15 20:25:41 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2019-04-16 18:41:57 +0300
commitad9275ed4e60b7ca4874bbb2c80fef6e2606eb39 (patch)
tree901785b1d79494754a4d96450ce13a093a74ab95 /source/blender/blenloader
parent752edc0a155a3cd9ff6b0152cd7c96cecd542c9b (diff)
Spline IK: support changing individual bone length via Y scaling.
Previously Spline IK provided only two choices: either scale the length of the bone chain to fit the length of the curve, or don't scale the bone in the Y dimension at all (ignoring effects of actually fitting to the curve due to curvature and curve object scale). This patch adds a new option to use the pre-IK Y scale of the bones to adjust their length when fitted to the curve, allowing individual posing control over the length of the segments. Reviewers: brecht Differential Revision: https://developer.blender.org/D4687
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/versioning_280.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index 41b1627e873..528bfd2360f 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -3140,6 +3140,23 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
}
{
+ if (!DNA_struct_elem_find(fd->filesdna, "bSplineIKConstraint", "short", "yScaleMode")) {
+ for (Object *ob = bmain->objects.first; ob; ob = ob->id.next) {
+ if (ob->pose) {
+ for (bPoseChannel *pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
+ for (bConstraint *con = pchan->constraints.first; con; con = con->next) {
+ if (con->type == CONSTRAINT_TYPE_SPLINEIK) {
+ bSplineIKConstraint *data = (bSplineIKConstraint *)con->data;
+ if ((data->flag & CONSTRAINT_SPLINEIK_SCALE_LIMITED) == 0) {
+ data->yScaleMode = CONSTRAINT_SPLINEIK_YS_FIT_CURVE;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
/* Versioning code until next subversion bump goes here. */
}
}