From f65a3172a8b7513842dcf934197ed4174e37a4b5 Mon Sep 17 00:00:00 2001 From: Richard Antalik Date: Sat, 20 Mar 2021 01:53:03 +0100 Subject: Fix issues introduced strip loading refactoring - Adding effect strip resulted in strip with no name - Adding sound strip attempted to read `fit_method` RNA property, that did not exist, causing error messages in console These issues were introduced in bbb1936411a5. --- source/blender/editors/space_sequencer/sequencer_add.c | 7 +++++-- source/blender/sequencer/intern/strip_add.c | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c index 4ccbd665b8c..a6e7903d1b1 100644 --- a/source/blender/editors/space_sequencer/sequencer_add.c +++ b/source/blender/editors/space_sequencer/sequencer_add.c @@ -235,8 +235,11 @@ static void load_data_init_from_operator(SeqLoadData *load_data, bContext *C, wm load_data->channel = RNA_int_get(op->ptr, "channel"); load_data->image.end_frame = load_data->start_frame; load_data->image.len = 1; - load_data->fit_method = RNA_enum_get(op->ptr, "fit_method"); - SEQ_tool_settings_fit_method_set(CTX_data_scene(C), load_data->fit_method); + + if ((prop = RNA_struct_find_property(op->ptr, "fit_method"))) { + load_data->fit_method = RNA_enum_get(op->ptr, "fit_method"); + SEQ_tool_settings_fit_method_set(CTX_data_scene(C), load_data->fit_method); + } if ((prop = RNA_struct_find_property(op->ptr, "filepath"))) { /* Full path, file is set by the caller. */ diff --git a/source/blender/sequencer/intern/strip_add.c b/source/blender/sequencer/intern/strip_add.c index d90524ddbd7..c4812228260 100644 --- a/source/blender/sequencer/intern/strip_add.c +++ b/source/blender/sequencer/intern/strip_add.c @@ -105,7 +105,7 @@ static void seq_add_generic_update(Scene *scene, ListBase *seqbase, Sequence *se static void seq_add_set_name(Sequence *seq, SeqLoadData *load_data) { - if (load_data->name != NULL) { + if (load_data->name != NULL && load_data->name[0] != '\0') { BLI_strncpy(seq->name + 2, load_data->name, sizeof(seq->name) - 2); } else { -- cgit v1.2.3