Cleanup: rename Global "lib" & "ima" for clarity

Rename members to make it clear they're for the last used file-paths:

- ima -> filepath_last_image
- lib -> filepath_last_library
This commit is contained in:
Campbell Barton
2023-10-05 13:33:37 +11:00
parent ed7b7c2cde
commit f5b71e5152
6 changed files with 17 additions and 14 deletions

View File

@@ -181,7 +181,7 @@ void BKE_blender_globals_init()
BKE_blender_globals_main_replace(BKE_main_new());
STRNCPY(G.ima, "//");
STRNCPY(G.filepath_last_image, "//");
#ifndef WITH_PYTHON_SECURITY /* default */
G.f |= G_FLAG_SCRIPT_AUTOEXEC;

View File

@@ -165,10 +165,10 @@ bool BKE_image_save_options_init(ImageSaveOptions *opts,
/* check for empty path */
if (guess_path && opts->filepath[0] == 0) {
const bool is_prev_save = !STREQ(G.ima, "//");
const bool is_prev_save = !STREQ(G.filepath_last_image, "//");
if (opts->save_as_render) {
if (is_prev_save) {
STRNCPY(opts->filepath, G.ima);
STRNCPY(opts->filepath, G.filepath_last_image);
}
else {
BLI_path_join(opts->filepath, sizeof(opts->filepath), "//", DATA_("untitled"));
@@ -178,7 +178,8 @@ bool BKE_image_save_options_init(ImageSaveOptions *opts,
else {
BLI_path_join(opts->filepath, sizeof(opts->filepath), "//", ima->id.name + 2);
BLI_path_make_safe(opts->filepath);
BLI_path_abs(opts->filepath, is_prev_save ? G.ima : BKE_main_blendfile_path(bmain));
BLI_path_abs(opts->filepath,
is_prev_save ? G.filepath_last_image : BKE_main_blendfile_path(bmain));
}
/* append UDIM marker if not present */