From c9c0f893073300d6898114cfc6cacd563c630750 Mon Sep 17 00:00:00 2001 From: Chris Clyne Date: Wed, 16 Sep 2020 15:52:43 +0200 Subject: Action Constraint: Add manual time factor input control MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- source/blender/makesrna/intern/rna_constraint.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'source/blender/makesrna/intern/rna_constraint.c') 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); } -- cgit v1.2.3