[Bf-blender-cvs] [f65a3172a8b] master: Fix issues introduced strip loading refactoring

Richard Antalik noreply at git.blender.org
Sat Mar 20 01:57:07 CET 2021


Commit: f65a3172a8b7513842dcf934197ed4174e37a4b5
Author: Richard Antalik
Date:   Sat Mar 20 01:53:03 2021 +0100
Branches: master
https://developer.blender.org/rBf65a3172a8b7513842dcf934197ed4174e37a4b5

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.

===================================================================

M	source/blender/editors/space_sequencer/sequencer_add.c
M	source/blender/sequencer/intern/strip_add.c

===================================================================

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 {



More information about the Bf-blender-cvs mailing list