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 bbb1936411.
This commit is contained in:
Richard Antalik 2021-03-20 01:53:03 +01:00
parent 3433d1b7f4
commit f65a3172a8
2 changed files with 6 additions and 3 deletions

View File

@ -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. */

View File

@ -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 {