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

Commit

Permalink
Merge pull request #3377 from pypeclub/bugfix/flame-group-of-issues
Browse files Browse the repository at this point in the history
Flame: bunch of publishing issues
  • Loading branch information
64qam authored Jun 28, 2022
2 parents 8124f92 + 035b202 commit ea97281
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import re
from types import NoneType
import pyblish
import openpype.hosts.flame.api as opfapi
from openpype.hosts.flame.otio import flame_export
Expand Down Expand Up @@ -75,6 +76,12 @@ def process(self, context):
marker_data["handleEnd"]
)

# make sure there is not NoneType rather 0
if isinstance(head, NoneType):
head = 0
if isinstance(tail, NoneType):
tail = 0

# make sure value is absolute
if head != 0:
head = abs(head)
Expand Down Expand Up @@ -125,7 +132,8 @@ def process(self, context):
"flameAddTasks": self.add_tasks,
"tasks": {
task["name"]: {"type": task["type"]}
for task in self.add_tasks}
for task in self.add_tasks},
"representations": []
})
self.log.debug("__ inst_data: {}".format(pformat(inst_data)))

Expand Down
21 changes: 17 additions & 4 deletions openpype/hosts/flame/plugins/publish/extract_subset_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ class ExtractSubsetResources(openpype.api.Extractor):
hosts = ["flame"]

# plugin defaults
keep_original_representation = False

default_presets = {
"thumbnail": {
"active": True,
Expand All @@ -45,7 +47,9 @@ class ExtractSubsetResources(openpype.api.Extractor):
export_presets_mapping = {}

def process(self, instance):
if "representations" not in instance.data:

if not self.keep_original_representation:
# remove previeous representation if not needed
instance.data["representations"] = []

# flame objects
Expand Down Expand Up @@ -82,7 +86,11 @@ def process(self, instance):
# add default preset type for thumbnail and reviewable video
# update them with settings and override in case the same
# are found in there
export_presets = deepcopy(self.default_presets)
_preset_keys = [k.split('_')[0] for k in self.export_presets_mapping]
export_presets = {
k: v for k, v in deepcopy(self.default_presets).items()
if k not in _preset_keys
}
export_presets.update(self.export_presets_mapping)

# loop all preset names and
Expand Down Expand Up @@ -218,9 +226,14 @@ def process(self, instance):
opfapi.export_clip(
export_dir_path, exporting_clip, preset_path, **export_kwargs)

repr_name = unique_name
# make sure only first segment is used if underscore in name
# HACK: `ftrackreview_withLUT` will result only in `ftrackreview`
repr_name = unique_name.split("_")[0]
if (
"thumbnail" in unique_name
or "ftrackreview" in unique_name
):
repr_name = unique_name.split("_")[0]

# create representation data
representation_data = {
Expand Down Expand Up @@ -259,7 +272,7 @@ def process(self, instance):
if os.path.splitext(f)[-1] == ".mov"
]
# then try if thumbnail is not in unique name
or unique_name == "thumbnail"
or repr_name == "thumbnail"
):
representation_data["files"] = files.pop()
else:
Expand Down

0 comments on commit ea97281

Please sign in to comment.