diff options
author | Campbell Barton <campbell@blender.org> | 2022-03-04 02:29:58 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-03-04 02:31:11 +0300 |
commit | 65e6bcdd9f4546509415237baa7dbc0ae69562be (patch) | |
tree | 514911024402200760fb19054a58482d42dbf34b /source | |
parent | ccefcf46bf5cc417b3569d98fc910adcbdbcc6d6 (diff) |
Sequencer: disallow assigning scenes to non-seuencer strips
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/scene/scene_edit.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/editors/scene/scene_edit.c b/source/blender/editors/scene/scene_edit.c index db59ec6278c..b180aff503c 100644 --- a/source/blender/editors/scene/scene_edit.c +++ b/source/blender/editors/scene/scene_edit.c @@ -34,6 +34,7 @@ #include "ED_util.h" #include "SEQ_relations.h" +#include "SEQ_select.h" #include "RNA_access.h" #include "RNA_define.h" @@ -296,6 +297,13 @@ static int scene_new_sequencer_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } +static bool scene_new_sequencer_poll(bContext *C) +{ + Scene *scene = CTX_data_scene(C); + const Sequence *seq = SEQ_select_active_get(scene); + return (seq && (seq->type == SEQ_TYPE_SCENE)); +} + static const EnumPropertyItem *scene_new_sequencer_enum_itemf(bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), @@ -351,6 +359,7 @@ static void SCENE_OT_new_sequencer(wmOperatorType *ot) /* api callbacks */ ot->exec = scene_new_sequencer_exec; ot->invoke = WM_menu_invoke; + ot->poll = scene_new_sequencer_poll; /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; |