LibOverride: Add read-only flags accessors for 'local override' status.

Constraints, modifiers and NLA tracks can now report from RNA whether
they are defined as comming from the override's reference linked data,
or are local to the override.
This commit is contained in:
Bastien Montagne 2021-11-19 12:01:05 +01:00
parent 83e245023c
commit fa6a913ef1
Notes: blender-bot 2023-05-22 12:40:41 +02:00
Referenced by commit 6c16bb2706, Fix broken NLA RNA code after own rBfa6a913ef19c.
4 changed files with 37 additions and 0 deletions

View File

@ -3474,6 +3474,15 @@ void RNA_def_constraint(BlenderRNA *brna)
RNA_def_property_enum_items(prop, rna_enum_constraint_type_items);
RNA_def_property_ui_text(prop, "Type", "");
prop = RNA_def_boolean(srna,
"is_override_data",
false,
"Override Constraint",
"In a local override object, whether this constraint comes from the "
"linked reference object, or is local to the override");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CONSTRAINT_OVERRIDE_LIBRARY_LOCAL);
RNA_define_lib_overridable(true);
prop = RNA_def_property(srna, "owner_space", PROP_ENUM, PROP_NONE);

View File

@ -3738,6 +3738,16 @@ void RNA_def_greasepencil_modifier(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Expanded", "Set modifier expanded in the user interface");
RNA_def_property_ui_icon(prop, ICON_DISCLOSURE_TRI_RIGHT, 1);
prop = RNA_def_boolean(srna,
"is_override_data",
false,
"Override Modifier",
"In a local override object, whether this modifier comes from the linked "
"reference object, or is local to the override");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_negative_sdna(
prop, NULL, "flag", eGpencilModifierFlag_OverrideLibrary_Local);
/* types */
rna_def_modifier_gpencilnoise(brna);
rna_def_modifier_gpencilsmooth(brna);

View File

@ -7245,6 +7245,15 @@ void RNA_def_modifier(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Active", "The active modifier in the list");
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, NULL);
prop = RNA_def_boolean(srna,
"is_override_data",
false,
"Override Modifier",
"In a local override object, whether this modifier comes from the linked "
"reference object, or is local to the override");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", eModifierFlag_OverrideLibrary_Local);
prop = RNA_def_property(srna, "use_apply_on_spline", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_ApplyOnSpline);
RNA_def_property_ui_text(

View File

@ -885,6 +885,15 @@ static void rna_def_nlatrack(BlenderRNA *brna)
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_ui_text(prop, "NLA Strips", "NLA Strips on this NLA-track");
prop = RNA_def_boolean(srna,
"is_override_data",
false,
"Override Track",
"In a local override data, whether this NLA track comes from the linked "
"reference data, or is local to the override");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", NLATRACK_OVERRIDELIBRARY_LOCAL);
rna_api_nlatrack_strips(brna, prop);
RNA_define_lib_overridable(true);