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

Flame: solved problem with multi-selected loading #3470

Merged
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 4 additions & 4 deletions openpype/hosts/flame/plugins/load/load_clip.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import flame
from pprint import pformat
import openpype.hosts.flame.api as opfapi

from openpype.lib import StringTemplate

class LoadClip(opfapi.ClipLoader):
"""Load a subset to timeline as clip
Expand All @@ -22,7 +22,7 @@ class LoadClip(opfapi.ClipLoader):
# settings
reel_group_name = "OpenPype_Reels"
reel_name = "Loaded"
clip_name_template = "{asset}_{subset}_{output}"
clip_name_template = "{asset}_{subset}<_{output}>"

def load(self, context, name, namespace, options):

Expand All @@ -36,8 +36,8 @@ def load(self, context, name, namespace, options):
version_data = version.get("data", {})
version_name = version.get("name", None)
colorspace = version_data.get("colorspace", None)
clip_name = self.clip_name_template.format(
**context["representation"]["context"])
clip_name = StringTemplate(self.clip_name_template).format(
context["representation"]["context"])

# TODO: settings in imageio
# convert colorspace with ocio to flame mapping
Expand Down
7 changes: 4 additions & 3 deletions openpype/hosts/flame/plugins/load/load_clip_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import flame
from pprint import pformat
import openpype.hosts.flame.api as opfapi
from openpype.lib import StringTemplate


class LoadClipBatch(opfapi.ClipLoader):
Expand All @@ -21,7 +22,7 @@ class LoadClipBatch(opfapi.ClipLoader):

# settings
reel_name = "OP_LoadedReel"
clip_name_template = "{asset}_{subset}_{output}"
clip_name_template = "{asset}_{subset}<_{output}>"

def load(self, context, name, namespace, options):

Expand All @@ -39,8 +40,8 @@ def load(self, context, name, namespace, options):
if not context["representation"]["context"].get("output"):
self.clip_name_template.replace("output", "representation")

clip_name = self.clip_name_template.format(
**context["representation"]["context"])
clip_name = StringTemplate(self.clip_name_template).format(
context["representation"]["context"])

# TODO: settings in imageio
# convert colorspace with ocio to flame mapping
Expand Down
4 changes: 2 additions & 2 deletions openpype/settings/defaults/project_settings/flame.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
],
"reel_group_name": "OpenPype_Reels",
"reel_name": "Loaded",
"clip_name_template": "{asset}_{subset}_{output}"
"clip_name_template": "{asset}_{subset}<_{output}>"
},
"LoadClipBatch": {
"enabled": true,
Expand All @@ -121,7 +121,7 @@
"exr16fpdwaa"
],
"reel_name": "OP_LoadedReel",
"clip_name_template": "{asset}_{subset}_{output}"
"clip_name_template": "{asset}_{subset}<_{output}>"
}
}
}