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:
authorBastien Montagne <mont29>2020-12-07 18:58:18 +0300
committerBastien Montagne <bastien@blender.org>2020-12-08 12:55:57 +0300
commitc0bd240ad0a17402db9d2e4799a433b81b62fca8 (patch)
tree06a0389f6ab6d3d5974caae3dc79063b3cb0524a /source/blender/makesrna/intern/rna_nla.c
parent78080337f8994e685c1190190b4e37d8409b31a5 (diff)
LibOverride: Add initial support for adding new NLA tracks.
Also makes NLA tracks and strips overridable. User can either edit existing strips in existing NLA tracks (but not add or remove them), and/or add new NLA tracks after those comming from the linked data. Most of the work was as usual checking operators and adding protections against illegal operations in override context. Note that since we can only rely on indices to deal with local added tracks, we forbid any local track being before any linked/original track. Maniphest Tasks: T72629 Differential Revision: https://developer.blender.org/D9611
Diffstat (limited to 'source/blender/makesrna/intern/rna_nla.c')
-rw-r--r--source/blender/makesrna/intern/rna_nla.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_nla.c b/source/blender/makesrna/intern/rna_nla.c
index b0dda1237b0..b7c51eac6ef 100644
--- a/source/blender/makesrna/intern/rna_nla.c
+++ b/source/blender/makesrna/intern/rna_nla.c
@@ -607,6 +607,8 @@ static void rna_def_nlastrip(BlenderRNA *brna)
RNA_def_struct_path_func(srna, "rna_NlaStrip_path");
RNA_def_struct_ui_icon(srna, ICON_NLA); /* XXX */
+ RNA_define_lib_overridable(true);
+
/* name property */
prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Name", "");
@@ -820,6 +822,8 @@ static void rna_def_nlastrip(BlenderRNA *brna)
"Update range of frames referenced from action "
"after tweaking strip and its keyframes");
RNA_def_property_update(prop, NC_ANIMATION | ND_NLA | NA_EDITED, "rna_NlaStrip_update");
+
+ RNA_define_lib_overridable(false);
}
static void rna_api_nlatrack_strips(BlenderRNA *brna, PropertyRNA *cprop)
@@ -877,10 +881,14 @@ static void rna_def_nlatrack(BlenderRNA *brna)
/* strips collection */
prop = RNA_def_property(srna, "strips", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "NlaStrip");
+ /* We do not support inserting or removing strips in overrides of tracks for now. */
+ RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_ui_text(prop, "NLA Strips", "NLA Strips on this NLA-track");
rna_api_nlatrack_strips(brna, prop);
+ RNA_define_lib_overridable(true);
+
/* name property */
prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Name", "");
@@ -920,6 +928,8 @@ static void rna_def_nlatrack(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLATRACK_PROTECTED);
RNA_def_property_ui_text(prop, "Locked", "NLA Track is locked");
RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */
+
+ RNA_define_lib_overridable(false);
}
/* --------- */