From 9d30fade3ea9b03e0764ab5dc9a9263543a79a83 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 4 Oct 2020 21:48:48 +1100 Subject: Fix color-management ignoring the data-path command line value Initialize ImBuf (and color-management) after passing arguments that set environment variables such as `--env-system-datapath` This also fixes a bug where BKE_appdir logging failed since it was called before the `--log` argument was passed. Add asserts so this doesn't happen again. --- source/creator/creator.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'source/creator/creator.c') diff --git a/source/creator/creator.c b/source/creator/creator.c index 9df0ece26b5..f7b0fa3a31f 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -377,7 +377,6 @@ int main(int argc, BKE_blender_globals_init(); /* blender.c */ BKE_idtype_init(); - IMB_init(); BKE_cachefiles_init(); BKE_images_init(); BKE_modifier_init(); @@ -413,9 +412,16 @@ int main(int argc, G.factory_startup = true; #endif + /* After parsing the first level of arguments as `--env-*` impact BKE_appdir behavior. */ + BKE_appdir_init(); + /* After parsing number of threads argument. */ BLI_task_scheduler_init(); + /* After parsing `--env-system-datafiles` which control where paths are searched + * (color-management) uses BKE_appdir to initialize. */ + IMB_init(); + #ifdef WITH_FFMPEG IMB_ffmpeg_init(); #endif -- cgit v1.2.3