Skip to content

Commit e6d277d

Browse files
kenmcgaughKen McGaugh
authored andcommitted
Modified OCIOEngine::get_ocio_config() to pass the "ocio_config" metadata value through xstudio's file-path remapping mechanism. Likewise, all the search paths within the config are also passed through file path remapping.
Note that any path set via the OCIO environment variable is left as-is. Signed-off-by: Ken McGaugh <ken@mcgaugh.co.uk>
1 parent 8cde0df commit e6d277d

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/plugin/colour_pipeline/ocio/src/ocio_engine.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// SPDX-License-Identifier: Apache-2.0
22
#include "ocio_engine.hpp"
33

4+
#include "xstudio/utility/helpers.hpp"
45
#include "xstudio/utility/string_helpers.hpp"
56
#include "xstudio/ui/opengl/shader_program_base.hpp"
67
#include "xstudio/thumbnail/thumbnail.hpp"
@@ -328,7 +329,8 @@ OCIO::ConstConfigRcPtr
328329
OCIOEngine::get_ocio_config(const utility::JsonStore &src_colour_mgmt_metadata) const {
329330

330331
const std::string config_name =
331-
src_colour_mgmt_metadata.get_or("ocio_config", default_config_);
332+
utility::forward_remap_file_path(
333+
src_colour_mgmt_metadata.get_or("ocio_config", default_config_));
332334
const std::string displays =
333335
src_colour_mgmt_metadata.get_or("active_displays", std::string(""));
334336
const std::string views = src_colour_mgmt_metadata.get_or("active_views", std::string(""));
@@ -378,6 +380,14 @@ OCIOEngine::get_ocio_config(const utility::JsonStore &src_colour_mgmt_metadata)
378380
econfig->setActiveDisplays(displays.c_str());
379381
if (!views.empty())
380382
econfig->setActiveViews(views.c_str());
383+
384+
econfig->clearSearchPaths();
385+
for (int i = 0; i < config->getNumSearchPaths(); ++i) {
386+
auto path = std::string(config->getSearchPath(i));
387+
auto newpath = utility::forward_remap_file_path(path);
388+
econfig->addSearchPath(newpath.c_str());
389+
}
390+
381391
config = econfig;
382392
ocio_config_cache_[concat] = config;
383393

0 commit comments

Comments
 (0)