Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/space_sequencer/sequencer_add.c')
-rw-r--r--source/blender/editors/space_sequencer/sequencer_add.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c
index 258cbdfaffd..8315a0eab3d 100644
--- a/source/blender/editors/space_sequencer/sequencer_add.c
+++ b/source/blender/editors/space_sequencer/sequencer_add.c
@@ -114,9 +114,10 @@ static void sequencer_generic_invoke_path__internal(bContext *C, wmOperator *op,
Scene *scene = CTX_data_scene(C);
Sequence *last_seq = BKE_sequencer_active_get(scene);
if (last_seq && last_seq->strip && SEQ_HAS_PATH(last_seq)) {
+ Main *bmain = CTX_data_main(C);
char path[FILE_MAX];
BLI_strncpy(path, last_seq->strip->dir, sizeof(path));
- BLI_path_abs(path, G.main->name);
+ BLI_path_abs(path, bmain->name);
RNA_string_set(op->ptr, identifier, path);
}
}
@@ -173,8 +174,10 @@ static void sequencer_generic_invoke_xy__internal(bContext *C, wmOperator *op, i
}
}
-static void seq_load_operator_info(SeqLoadInfo *seq_load, wmOperator *op)
+static void seq_load_operator_info(SeqLoadInfo *seq_load, bContext *C, wmOperator *op)
{
+ Main *bmain = CTX_data_main(C);
+
PropertyRNA *prop;
const bool relative = (prop = RNA_struct_find_property(op->ptr, "relative_path")) && RNA_property_boolean_get(op->ptr, prop);
int is_file = -1;
@@ -196,7 +199,7 @@ static void seq_load_operator_info(SeqLoadInfo *seq_load, wmOperator *op)
}
if ((is_file != -1) && relative)
- BLI_path_rel(seq_load->path, G.main->name);
+ BLI_path_rel(seq_load->path, bmain->name);
if ((prop = RNA_struct_find_property(op->ptr, "frame_end"))) {
@@ -545,7 +548,7 @@ static int sequencer_add_generic_strip_exec(bContext *C, wmOperator *op, SeqLoad
SeqLoadInfo seq_load;
int tot_files;
- seq_load_operator_info(&seq_load, op);
+ seq_load_operator_info(&seq_load, C, op);
if (seq_load.flag & SEQ_LOAD_REPLACE_SEL)
ED_sequencer_deselect_all(scene);
@@ -855,7 +858,7 @@ static int sequencer_add_image_strip_exec(bContext *C, wmOperator *op)
StripElem *se;
const bool use_placeholders = RNA_boolean_get(op->ptr, "use_placeholders");
- seq_load_operator_info(&seq_load, op);
+ seq_load_operator_info(&seq_load, C, op);
/* images are unique in how they handle this - 1 per strip elem */
if (use_placeholders) {