From 5de109cc2d220ca3bd731216b9cd521269ad663e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 16 Dec 2021 11:38:10 +1100 Subject: Remove G.relbase_valid In almost all cases there is no difference between `G.relbase_valid` and checking `G.main->filepath` isn't an empty string. In many places a non-empty string is already being used instead of `G.relbase_valid`. The only situation where this was needed was when saving from `wm_file_write` where they temporarily became out of sync. This has been replaced by adding a new member to `BlendFileWriteParams` to account for saving an unsaved file for the first time. Reviewed By: brecht Ref D13564 --- source/creator/creator.c | 4 +++- source/creator/creator_args.c | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'source/creator') diff --git a/source/creator/creator.c b/source/creator/creator.c index 975800bb6c7..c50b6ac4c79 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -58,6 +58,7 @@ #include "BKE_gpencil_modifier.h" #include "BKE_idtype.h" #include "BKE_image.h" +#include "BKE_main.h" #include "BKE_material.h" #include "BKE_modifier.h" #include "BKE_node.h" @@ -553,7 +554,8 @@ int main(int argc, } else { /* When no file is loaded, show the splash screen. */ - if (!G.relbase_valid) { + const char *blendfile_path = BKE_main_blendfile_path_from_global(); + if (blendfile_path[0] == '\0') { WM_init_splash(C); } WM_main(C); diff --git a/source/creator/creator_args.c b/source/creator/creator_args.c index 2d86587d096..d3cec093980 100644 --- a/source/creator/creator_args.c +++ b/source/creator/creator_args.c @@ -1995,7 +1995,6 @@ static int arg_handle_load_file(int UNUSED(argc), const char **argv, void *data) /* Just pretend a file was loaded, so the user can press Save and it'll * save at the filename from the CLI. */ STRNCPY(G_MAIN->filepath, filename); - G.relbase_valid = true; printf("... opened default scene instead; saving will write to: %s\n", filename); } else { -- cgit v1.2.3