flame: load with native colorspace resolved from mapping

This commit is contained in:
Jakub Jezek 2022-11-08 21:42:26 +01:00
parent 1ee5ff6627
commit cf50722e1f
No known key found for this signature in database
GPG key ID: 730D7C02726179A7
3 changed files with 17 additions and 4 deletions

View file

@ -690,6 +690,19 @@ class ClipLoader(LoaderPlugin):
)
]
_mapping = None
def get_native_colorspace(self, input_colorspace):
if not self._mapping:
settings = get_current_project_settings()["flame"]
mapping = settings["imageio"]["profilesMapping"]["inputs"]
self._mapping = {
input["ocioName"]: input["flameName"]
for input in mapping
}
return self._mapping.get(input_colorspace)
class OpenClipSolver(flib.MediaInfoFile):
create_new_clip = False

View file

@ -40,10 +40,10 @@ class LoadClip(opfapi.ClipLoader):
clip_name = StringTemplate(self.clip_name_template).format(
context["representation"]["context"])
# TODO: settings in imageio
# convert colorspace with ocio to flame mapping
# in imageio flame section
colorspace = colorspace
colorspace = self.get_native_colorspace(colorspace)
self.log.info("Loading with colorspace: `{}`".format(colorspace))
# create workfile path
workfile_dir = os.environ["AVALON_WORKDIR"]

View file

@ -43,10 +43,10 @@ class LoadClipBatch(opfapi.ClipLoader):
clip_name = StringTemplate(self.clip_name_template).format(
context["representation"]["context"])
# TODO: settings in imageio
# convert colorspace with ocio to flame mapping
# in imageio flame section
colorspace = colorspace
colorspace = self.get_native_colorspace(colorspace)
self.log.info("Loading with colorspace: `{}`".format(colorspace))
# create workfile path
workfile_dir = options.get("workdir") or os.environ["AVALON_WORKDIR"]