Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Flame: Loading clip with native colorspace resolved from mapping #4079

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions openpype/hosts/flame/api/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,19 @@ class ClipLoader(LoaderPlugin):
)
]

_mapping = None

def get_native_colorspace(self, input_colorspace):
jakubjezek001 marked this conversation as resolved.
Show resolved Hide resolved
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
Expand Down
4 changes: 2 additions & 2 deletions openpype/hosts/flame/plugins/load/load_clip.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ def load(self, context, name, namespace, options):
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"]
Expand Down
4 changes: 2 additions & 2 deletions openpype/hosts/flame/plugins/load/load_clip_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ def load(self, context, name, namespace, options):
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"]
Expand Down