diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2014-10-14 13:49:58 +0400 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2014-10-14 13:51:36 +0400 |
commit | 20c233f3af344579fb14ea6cf1617e0c4021a31e (patch) | |
tree | 29a8d71b53dcfc255c7eb2dd587982aa77749902 /source/blender/blenloader | |
parent | 3620e3e3316f2d818ecc9f6f290b8fd2d1a530a1 (diff) |
Yet another tweak to stretch volume variation.
Make sure the 1.0 value is not affected by smoothing, and min/max limits
never go above or below 1.0 respectively. This was a request by
animators since not modifying the mesh in its rest pose is regarded as
crucial.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/versioning_270.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c index d8da0a12b50..bd1b5f2c269 100644 --- a/source/blender/blenloader/intern/versioning_270.c +++ b/source/blender/blenloader/intern/versioning_270.c @@ -114,6 +114,19 @@ static void do_version_constraints_radians_degrees_270_5(ListBase *lb) } } +static void do_version_constraints_stretch_to_limits(ListBase *lb) +{ + bConstraint *con; + + for (con = lb->first; con; con = con->next) { + if (con->type == CONSTRAINT_TYPE_STRETCHTO) { + bStretchToConstraint *data = (bStretchToConstraint *)con->data; + data->bulge_min = 1.0f; + data->bulge_max = 1.0f; + } + } +} + void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main) { if (!MAIN_VERSION_ATLEAST(main, 270, 0)) { @@ -405,4 +418,21 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main) image->gen_color[3] = 1.0f; } } + + if (!DNA_struct_elem_find(fd->filesdna, "bStretchToConstraint", "float", "bulge_min")) { + Object *ob; + + /* Update Transform constraint (again :|). */ + for (ob = main->object.first; ob; ob = ob->id.next) { + do_version_constraints_stretch_to_limits(&ob->constraints); + + if (ob->pose) { + /* Bones constraints! */ + bPoseChannel *pchan; + for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) { + do_version_constraints_stretch_to_limits(&pchan->constraints); + } + } + } + } } |