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:
authorChris Clyne <lateasusual>2020-09-16 16:52:43 +0300
committerSebastian Parborg <darkdefende@gmail.com>2020-09-16 16:55:22 +0300
commitc9c0f893073300d6898114cfc6cacd563c630750 (patch)
tree2f7b102728debdddd1b9f968886e90d39ac00c1a /source/blender/makesrna
parent569e2e6dbac489b4143859cfeb87debf7253eab6 (diff)
Action Constraint: Add manual time factor input control
Adds an optional slider to the action constraint so that it can be driven without a constraint target. This is very helpful for more complex rigging and mechanical rigs, as it means the action constraint can be controlled with a driver/custom property directly, currently if we want to use a driver to control it we must add a "dummy" bone/object inbetween to act as a control. Reviewed By: Sebastian Parborg, Sybren A. Stüvel, Demeter Dzadik, Julian Eisel Differential Revision: http://developer.blender.org/D8022
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/intern/rna_constraint.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c
index d9dd35c4280..653056e4dc1 100644
--- a/source/blender/makesrna/intern/rna_constraint.c
+++ b/source/blender/makesrna/intern/rna_constraint.c
@@ -1790,6 +1790,21 @@ static void rna_def_constraint_action(BlenderRNA *brna)
RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_ActionConstraint_minmax_range");
+ prop = RNA_def_property(srna, "eval_time", PROP_FLOAT, PROP_FACTOR);
+ RNA_def_property_float_sdna(prop, NULL, "eval_time");
+ RNA_def_property_range(prop, 0.f, 1.f);
+ RNA_def_property_ui_text(
+ prop, "Evaluation Time", "Interpolates between Action Start and End frames");
+ RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
+
+ prop = RNA_def_property(srna, "use_eval_time", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", ACTCON_USE_EVAL_TIME);
+ RNA_def_property_ui_text(prop,
+ "Use Evaluation Time",
+ "Interpolate between Action Start and End frames, with the Evaluation "
+ "Time slider instead of the Target object/bone");
+ RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
+
RNA_define_lib_overridable(false);
}