Cleanup: use new accessors to blendfile path (Main.name).
This commit is contained in:
@@ -117,7 +117,7 @@ static void sequencer_generic_invoke_path__internal(bContext *C, wmOperator *op,
|
||||
Main *bmain = CTX_data_main(C);
|
||||
char path[FILE_MAX];
|
||||
BLI_strncpy(path, last_seq->strip->dir, sizeof(path));
|
||||
BLI_path_abs(path, bmain->name);
|
||||
BLI_path_abs(path, BKE_main_blendfile_path(bmain));
|
||||
RNA_string_set(op->ptr, identifier, path);
|
||||
}
|
||||
}
|
||||
@@ -199,7 +199,7 @@ static void seq_load_operator_info(SeqLoadInfo *seq_load, bContext *C, wmOperato
|
||||
}
|
||||
|
||||
if ((is_file != -1) && relative)
|
||||
BLI_path_rel(seq_load->path, bmain->name);
|
||||
BLI_path_rel(seq_load->path, BKE_main_blendfile_path(bmain));
|
||||
|
||||
|
||||
if ((prop = RNA_struct_find_property(op->ptr, "frame_end"))) {
|
||||
|
||||
@@ -3773,7 +3773,7 @@ static int sequencer_change_path_exec(bContext *C, wmOperator *op)
|
||||
/* TODO, shouldn't this already be relative from the filesel?
|
||||
* (as the 'filepath' is) for now just make relative here,
|
||||
* but look into changing after 2.60 - campbell */
|
||||
BLI_path_rel(directory, bmain->name);
|
||||
BLI_path_rel(directory, BKE_main_blendfile_path(bmain));
|
||||
}
|
||||
BLI_strncpy(seq->strip->dir, directory, sizeof(seq->strip->dir));
|
||||
|
||||
@@ -3889,10 +3889,10 @@ static int sequencer_export_subtitles_invoke(bContext *C, wmOperator *op, const
|
||||
if (!RNA_struct_property_is_set(op->ptr, "filepath")) {
|
||||
char filepath[FILE_MAX];
|
||||
|
||||
if (bmain->name[0] == '\0')
|
||||
if (BKE_main_blendfile_path(bmain)[0] == '\0')
|
||||
BLI_strncpy(filepath, "untitled", sizeof(filepath));
|
||||
else
|
||||
BLI_strncpy(filepath, bmain->name, sizeof(filepath));
|
||||
BLI_strncpy(filepath, BKE_main_blendfile_path(bmain), sizeof(filepath));
|
||||
|
||||
BLI_replace_extension(filepath, sizeof(filepath), ".srt");
|
||||
RNA_string_set(op->ptr, "filepath", filepath);
|
||||
|
||||
Reference in New Issue
Block a user