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:
authorJoshua Leung <aligorith@gmail.com>2011-06-13 17:54:21 +0400
committerJoshua Leung <aligorith@gmail.com>2011-06-13 17:54:21 +0400
commita4216cb1d4336bd2244f4519398db0b9f19833ad (patch)
tree29a031f5980afc355b0372b8c875fa216159bd28 /source/blender/makesrna/intern/rna_fcurve.c
parent8e85491ab7f4d2e156910eceb87ca4023d42c95a (diff)
Transformation Channel Driver Variables - "Proper Localspace"
By popular demand, the "Transformation Channel" driver variable type now has a "local space" transform space option which uses the same magic that constraints use for defining local-space. This is what many bug reporters and feature requesters have moaned about for a while now, so after reviewing several of the bug reports which lead to the current situation, here is what has been much-wanted for so long! In order to implement this, I've: - renamed the old "Local Space" option here to "Transformation Space", in order to prevent old rigs breaking. This has also been kept, as it is useful for #21384 (though perhaps with this new option it isn't needed anymore) - reviewed my fix for #20870 (IIRC, a Durian-era bug), which related to the non-uniqueness of matrix->euler decomposition
Diffstat (limited to 'source/blender/makesrna/intern/rna_fcurve.c')
-rw-r--r--source/blender/makesrna/intern/rna_fcurve.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c
index 263978221bb..ab3665fb8ff 100644
--- a/source/blender/makesrna/intern/rna_fcurve.c
+++ b/source/blender/makesrna/intern/rna_fcurve.c
@@ -1104,6 +1104,12 @@ static void rna_def_drivertarget(BlenderRNA *brna)
{DTAR_TRANSCHAN_SCALEY, "SCALE_Y", 0, "Y Scale", ""},
{DTAR_TRANSCHAN_SCALEZ, "SCALE_Z", 0, "Z Scale", ""},
{0, NULL, 0, NULL, NULL}};
+
+ static EnumPropertyItem prop_local_space_items[] = {
+ {0, "WORLD_SPACE", 0, "World Space", "Transforms include effects of parenting/restpose and constraints"},
+ {DTAR_FLAG_LOCALSPACE, "TRANSFORM_SPACE", 0, "Transform Space", "Transforms don't include parenting/restpose or constraints"},
+ {DTAR_FLAG_LOCALSPACE|DTAR_FLAG_LOCAL_CONSTS, "LOCAL_SPACE", 0, "Local Space", "Transforms include effects of constraints but not parenting/restpose"},
+ {0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "DriverTarget", NULL);
RNA_def_struct_ui_text(srna, "Driver Target", "Source of input values for driver variables");
@@ -1144,9 +1150,10 @@ static void rna_def_drivertarget(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Type", "Driver variable type");
RNA_def_property_update(prop, 0, "rna_DriverTarget_update_data");
- prop= RNA_def_property(srna, "use_local_space_transform", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", DTAR_FLAG_LOCALSPACE);
- RNA_def_property_ui_text(prop, "Local Space", "Use transforms in Local Space (as opposed to the worldspace default)");
+ prop= RNA_def_property(srna, "transform_space", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
+ RNA_def_property_enum_items(prop, prop_local_space_items);
+ RNA_def_property_ui_text(prop, "Transform Space", "Space in which transforms are used");
RNA_def_property_update(prop, 0, "rna_DriverTarget_update_data");
}