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

Flame/Flare: Loading to multiple batches #4080

Merged
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
3 changes: 2 additions & 1 deletion openpype/hosts/flame/api/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,8 @@ def build_menu(self):

menu['actions'].append({
"name": "Load...",
"execute": lambda x: self.tools_helper.show_loader()
"execute": lambda x: callback_selection(
x, self.tools_helper.show_loader)
})
menu['actions'].append({
"name": "Manage...",
Expand Down
9 changes: 7 additions & 2 deletions openpype/hosts/flame/plugins/load/load_clip_batch.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from copy import deepcopy
import os
import flame
from pprint import pformat
Expand All @@ -22,7 +23,7 @@ class LoadClipBatch(opfapi.ClipLoader):

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

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

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

formating_data = deepcopy(context["representation"]["context"])
formating_data["batch"] = self.batch.name.get_value()

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

# TODO: settings in imageio
# convert colorspace with ocio to flame mapping
Expand All @@ -56,6 +60,7 @@ def load(self, context, name, namespace, options):
openclip_path = os.path.join(
openclip_dir, clip_name + ".clip"
)

if not os.path.exists(openclip_dir):
os.makedirs(openclip_dir)

Expand Down
2 changes: 1 addition & 1 deletion openpype/settings/defaults/project_settings/flame.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
"exr16fpdwaa"
],
"reel_name": "OP_LoadedReel",
"clip_name_template": "{asset}_{subset}<_{output}>"
"clip_name_template": "{batch}_{asset}_{subset}<_{output}>"
}
}
}