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-05 13:25:43 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2019-05-06 19:03:26 +0300
commit1854cccad7c31a6b8235faf980ffdd6a80163e02 (patch)
treee2ae8c4b8b358ce8a2035fd8be36ee6c4f3f01b7 /source/blender/makesrna/intern/rna_fcurve.c
parent11d2c0b6f41cf0fdc6d95cbed5bfb02e7feb4256 (diff)
Drivers: add an Average Scale option to the Transform Channel driver vars.
Unlike location and rotation, there is a meaningful definition of overall/average scaling via the total change in the volume. This adds an option to retrieve that via a single driver variable, instead of having to use three and an expression. Using the determinant to compute the volume scaling also allows detecting flipping due to negative scale - this is impossible to do via the three variable approach. The volume_scale functions are added purely for code readability: 'volume scale factor' is easier to understand than determinant. Differential Revision: https://developer.blender.org/D4803
Diffstat (limited to 'source/blender/makesrna/intern/rna_fcurve.c')
-rw-r--r--source/blender/makesrna/intern/rna_fcurve.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c
index c8df01a7dc7..d9917b670d9 100644
--- a/source/blender/makesrna/intern/rna_fcurve.c
+++ b/source/blender/makesrna/intern/rna_fcurve.c
@@ -1645,6 +1645,7 @@ static void rna_def_drivertarget(BlenderRNA *brna)
{DTAR_TRANSCHAN_SCALEX, "SCALE_X", 0, "X Scale", ""},
{DTAR_TRANSCHAN_SCALEY, "SCALE_Y", 0, "Y Scale", ""},
{DTAR_TRANSCHAN_SCALEZ, "SCALE_Z", 0, "Z Scale", ""},
+ {DTAR_TRANSCHAN_SCALE_AVG, "SCALE_AVG", 0, "Average Scale", ""},
{0, NULL, 0, NULL, NULL},
};