diff options
author | Bastien Montagne <mont29> | 2020-12-07 18:58:18 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2020-12-08 12:55:57 +0300 |
commit | c0bd240ad0a17402db9d2e4799a433b81b62fca8 (patch) | |
tree | 06a0389f6ab6d3d5974caae3dc79063b3cb0524a /source/blender/editors/object | |
parent | 78080337f8994e685c1190190b4e37d8409b31a5 (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/editors/object')
-rw-r--r-- | source/blender/editors/object/object_add.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 4e0f6211c18..bbfdfb2532d 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -1618,6 +1618,7 @@ static int object_speaker_add_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } Object *ob = ED_object_add_type(C, OB_SPEAKER, NULL, loc, rot, false, local_view_bits); + const bool is_liboverride = ID_IS_OVERRIDE_LIBRARY(ob); /* to make it easier to start using this immediately in NLA, a default sound clip is created * ready to be moved around to retime the sound and/or make new sound clips @@ -1625,13 +1626,13 @@ static int object_speaker_add_exec(bContext *C, wmOperator *op) { /* create new data for NLA hierarchy */ AnimData *adt = BKE_animdata_add_id(&ob->id); - NlaTrack *nlt = BKE_nlatrack_add(adt, NULL); + NlaTrack *nlt = BKE_nlatrack_add(adt, NULL, is_liboverride); NlaStrip *strip = BKE_nla_add_soundstrip(bmain, scene, ob->data); strip->start = CFRA; strip->end += strip->start; /* hook them up */ - BKE_nlatrack_add_strip(nlt, strip); + BKE_nlatrack_add_strip(nlt, strip, is_liboverride); /* auto-name the strip, and give the track an interesting name */ BLI_strncpy(nlt->name, DATA_("SoundTrack"), sizeof(nlt->name)); |