Bugfix: Toggling "auto-blends" option on NLA Strips doesn't update them immediately
This commit is contained in:
@@ -231,6 +231,28 @@ static void rna_NlaStrip_blend_out_set(PointerRNA *ptr, float value)
|
|||||||
data->blendout = value;
|
data->blendout = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void rna_NlaStrip_use_auto_blend_set(PointerRNA *ptr, int value)
|
||||||
|
{
|
||||||
|
NlaStrip *data = (NlaStrip *)ptr->data;
|
||||||
|
|
||||||
|
if (value) {
|
||||||
|
/* set the flag, then make sure a curve for this exists */
|
||||||
|
data->flag |= NLASTRIP_FLAG_USR_INFLUENCE;
|
||||||
|
|
||||||
|
/* validate state to ensure that auto-blend gets applied immediately */
|
||||||
|
if (ptr->id.data) {
|
||||||
|
IdAdtTemplate *iat = (IdAdtTemplate *)ptr->id.data;
|
||||||
|
|
||||||
|
if (iat->adt) {
|
||||||
|
BKE_nla_validate_state(iat->adt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
data->flag &= ~NLASTRIP_FLAG_USR_INFLUENCE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static int rna_NlaStrip_action_editable(PointerRNA *ptr)
|
static int rna_NlaStrip_action_editable(PointerRNA *ptr)
|
||||||
{
|
{
|
||||||
NlaStrip *strip = (NlaStrip *)ptr->data;
|
NlaStrip *strip = (NlaStrip *)ptr->data;
|
||||||
@@ -502,6 +524,7 @@ static void rna_def_nlastrip(BlenderRNA *brna)
|
|||||||
|
|
||||||
prop = RNA_def_property(srna, "use_auto_blend", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "use_auto_blend", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_AUTO_BLENDS);
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_AUTO_BLENDS);
|
||||||
|
RNA_def_property_boolean_funcs(prop, NULL, "rna_NlaStrip_use_auto_blend_set");
|
||||||
RNA_def_property_ui_text(prop, "Auto Blend In/Out",
|
RNA_def_property_ui_text(prop, "Auto Blend In/Out",
|
||||||
"Number of frames for Blending In/Out is automatically determined from "
|
"Number of frames for Blending In/Out is automatically determined from "
|
||||||
"overlapping strips");
|
"overlapping strips");
|
||||||
|
|||||||
Reference in New Issue
Block a user