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-05-08 12:08:54 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2019-05-08 12:17:00 +0300
commit27b9a0cd670ff1dabe031596cef76908df76c3c8 (patch)
tree4ba6661dc88dc9667dbd1a993a2653904c746d5b /source/blender/blenloader
parent08012ebeec74baa6037c88c7c75de0962e4a1b74 (diff)
Copy Scale: support raising the copied scale to an arbitrary power.
Since scale is multiplicative, the appropriate way to partially copy it is to use power. However, the influence slider of constraints uses linear interpolation. Thus, there is no way to correctly split scale via constraints without adding this feature. In addition, this allows inverting scale by using negative powers, fulfilling the function of Copy Rotation's Invert checkboxes.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/versioning_280.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index 194459a1eda..b2e171108d8 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -702,6 +702,16 @@ static void do_version_constraints_maintain_volume_mode_uniform(ListBase *lb)
}
}
+static void do_version_constraints_copy_scale_power(ListBase *lb)
+{
+ for (bConstraint *con = lb->first; con; con = con->next) {
+ if (con->type == CONSTRAINT_TYPE_SIZELIKE) {
+ bSizeLikeConstraint *data = (bSizeLikeConstraint *)con->data;
+ data->power = 1.0f;
+ }
+ }
+}
+
void do_versions_after_linking_280(Main *bmain)
{
bool use_collection_compat_28 = true;
@@ -3348,6 +3358,18 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
}
{
+ /* Added a power option to Copy Scale. */
+ if (!DNA_struct_elem_find(fd->filesdna, "bSizeLikeConstraint", "float", "power")) {
+ LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
+ do_version_constraints_copy_scale_power(&ob->constraints);
+ if (ob->pose) {
+ LISTBASE_FOREACH (bPoseChannel *, pchan, &ob->pose->chanbase) {
+ do_version_constraints_copy_scale_power(&pchan->constraints);
+ }
+ }
+ }
+ }
+
/* Versioning code until next subversion bump goes here. */
}
}