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

Commit

Permalink
Merge branch 'feature/616-convert-nukestudio-to-hiero-host' into 2.x/…
Browse files Browse the repository at this point in the history
…develop
  • Loading branch information
mkolar committed Oct 7, 2020
2 parents 81e80e0 + d674023 commit ae2c184
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 15 deletions.
7 changes: 3 additions & 4 deletions pype/plugins/ftrack/publish/integrate_hierarchy_ftrack.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,10 @@ def import_to_ftrack(self, input_data, parent=None):
existing_tasks.append(child['name'].lower())
# existing_tasks.append(child['type']['name'])

for task in tasks:
task_name = next(iter(task))
task_type = task[task_name]["type"]
for task_name in tasks:
task_type = tasks[task_name]["type"]
if task_name.lower() in existing_tasks:
print("Task {} already exists".format(task))
print("Task {} already exists".format(task_name))
continue
tasks_to_create.append((task_name, task_type))

Expand Down
5 changes: 2 additions & 3 deletions pype/plugins/global/publish/extract_hierarchy_avalon.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,10 @@ def import_to_avalon(self, input_data, parent=None):
new_tasks = data.pop("tasks", {})
if "tasks" not in cur_entity_data and not new_tasks:
continue
for task in new_tasks:
task_name = next(iter(task))
for task_name in new_tasks:
if task_name in cur_entity_data["tasks"].keys():
continue
cur_entity_data["tasks"][task_name] = task[task_name]
cur_entity_data["tasks"][task_name] = new_tasks[task_name]
cur_entity_data.update(data)
data = cur_entity_data
else:
Expand Down
7 changes: 4 additions & 3 deletions pype/plugins/hiero/publish/collect_plates.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,12 @@ def process(self, instance):
instance.data["representations"].append(
plates_mov_representation)

thumb_frame = instance.data["clipInH"] + (
(instance.data["clipOutH"] - instance.data["clipInH"]) / 2)
thumb_frame = instance.data["sourceInH"] + (
(instance.data["sourceOutH"] - instance.data["sourceInH"]) / 2)
thumb_file = "{}_{}{}".format(head, thumb_frame, ".png")
thumb_path = os.path.join(staging_dir, thumb_file)

self.log.debug("__ thumb_path: `{}`, frame: `{}`".format(
thumb_path, thumb_frame))
thumbnail = item.thumbnail(thumb_frame).save(
thumb_path,
format='png'
Expand Down
11 changes: 9 additions & 2 deletions pype/plugins/hiero/publish/collect_reviews.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,15 @@ def create_thumbnail(self, instance):
staging_dir = os.path.dirname(
source_path)

thumb_frame = instance.data["clipInH"] + (
(instance.data["clipOutH"] - instance.data["clipInH"]) / 2)
media_duration = instance.data.get("mediaDuration")
clip_duration_h = instance.data.get("clipDurationH")

if media_duration > clip_duration_h:
thumb_frame = instance.data["clipInH"] + (
(instance.data["clipOutH"] - instance.data["clipInH"]) / 2)
elif media_duration <= clip_duration_h:
thumb_frame = instance.data["sourceIn"] + (
(instance.data["sourceOut"] - instance.data["sourceIn"]) / 2)
thumb_file = "{}_{}{}".format(head, thumb_frame, ".png")
thumb_path = os.path.join(staging_dir, thumb_file)
self.log.debug("__ thumb_path: {}".format(thumb_path))
Expand Down
2 changes: 1 addition & 1 deletion pype/plugins/hiero/publish/collect_shots.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def process(self, instance):
"{} - {} - tasks:{} - assetbuilds:{} - comments:{}".format(
data["asset"],
data["subset"],
[task.keys()[0] for task in data["tasks"]],
[task for task in data["tasks"]],
[x["name"] for x in data.get("assetbuilds", [])],
len(data.get("comments", []))
)
Expand Down
4 changes: 2 additions & 2 deletions pype/plugins/hiero/publish/collect_tag_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def process(self, instance):
# gets tags
tags = instance.data["tags"]

tasks = list()
tasks = dict()
for t in tags:
t_metadata = dict(t["metadata"])
t_family = t_metadata.get("tag.family", "")
Expand All @@ -22,7 +22,7 @@ def process(self, instance):
if "task" in t_family:
t_task_name = t_metadata.get("tag.label", "")
t_task_type = t_metadata.get("tag.type", "")
tasks.append({t_task_name: {"type": t_task_type}})
tasks[t_task_name] = {"type": t_task_type}

instance.data["tasks"] = tasks

Expand Down

0 comments on commit ae2c184

Please sign in to comment.