Skip to content

Commit

Permalink
Report changes from Resolve.
Browse files Browse the repository at this point in the history
  • Loading branch information
robin-ynput committed Feb 17, 2025
1 parent 707b058 commit c88c558
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 31 deletions.
13 changes: 6 additions & 7 deletions client/ayon_hiero/api/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -655,8 +655,6 @@ class PublishClip:
Returns:
hiero.core.TrackItem: hiero track item object with AYON tag
"""
vertical_clip_match = {}
vertical_clip_used = {}
tag_data = {}

types = {
Expand Down Expand Up @@ -696,18 +694,18 @@ class PublishClip:
"reviewableSource",
}

@classmethod
def restore_all_caches(cls):
cls.vertical_clip_match = {}
cls.vertical_clip_used = {}

def __init__(
self,
track_item,
vertical_clip_match,
vertical_clip_used,
pre_create_data=None,
data=None,
rename_index=0):

self.vertical_clip_match = vertical_clip_match
self.vertical_clip_used = vertical_clip_used

self.rename_index = rename_index

# adding ui inputs if any
Expand Down Expand Up @@ -812,6 +810,7 @@ def get(key):
self.product_type = get("productType") or self.product_type_default
self.vertical_sync = get("vSyncOn") or self.vertical_sync_default
self.driving_layer = get("vSyncTrack") or self.driving_layer_default
self.driving_layer = self.driving_layer.replace(" ", "_")
self.review_source = (
get("reviewableSource") or self.review_source_default)
self.audio = get("audio") or False
Expand Down
25 changes: 7 additions & 18 deletions client/ayon_hiero/plugins/create/create_shot_clip.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,17 +280,6 @@ class EditorialAudioInstanceCreator(_HieroInstanceClipCreatorBase):
product_type = "audio"
label = "Editorial Audio"

def get_product_name(
self,
project_name,
folder_entity,
task_entity,
variant,
host_name=None,
instance=None,
project_entity=None):
return f"{self.product_type}Main"


class CreateShotClip(plugin.HieroCreator):
"""Publishable clip"""
Expand All @@ -308,8 +297,6 @@ class CreateShotClip(plugin.HieroCreator):
"""
create_allow_thumbnail = False

shot_instances = {}

def get_pre_create_attr_defs(self):

def header_label(text):
Expand Down Expand Up @@ -551,13 +538,19 @@ def create(self, subset_name, instance_data, pre_create_data):
}

instances = []
all_shot_instances = {}
vertical_clip_match = {}
vertical_clip_used = {}

for idx, track_item in enumerate(sorted_selected_track_items):
_instance_data = copy.deepcopy(instance_data)
_instance_data["clip_index"] = track_item.guid()

# convert track item to timeline media pool item
publish_clip = plugin.PublishClip(
track_item,
vertical_clip_match,
vertical_clip_used,
pre_create_data=pre_create_data,
rename_index=idx,
data=_instance_data,
Expand Down Expand Up @@ -590,7 +583,7 @@ def create(self, subset_name, instance_data, pre_create_data):

# Create new product(s) instances.
shot_folder_path = _instance_data["folderPath"]
shot_instances = self.shot_instances.setdefault(
shot_instances = all_shot_instances.setdefault(
shot_folder_path, {})

# desable shot creator if heroTrack is not enabled
Expand Down Expand Up @@ -704,10 +697,6 @@ def create(self, subset_name, instance_data, pre_create_data):
)
instances.append(instance)

# restore all caches
plugin.PublishClip.restore_all_caches()
self.shot_instances = {}

return instances

def _create_and_add_instance(self, data, creator_id,
Expand Down
14 changes: 12 additions & 2 deletions client/ayon_hiero/plugins/publish/collect_audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,18 @@ def process(self, instance):
"""
# Retrieve instance data from parent instance shot instance.
parent_instance_id = instance.data["parent_instance_id"]
edit_shared_data = instance.context.data["editorialSharedData"]
shot_instance_data = edit_shared_data[parent_instance_id]

try:
edit_shared_data = instance.context.data["editorialSharedData"]
shot_instance_data = edit_shared_data[parent_instance_id]

# Ensure shot instance related to the audio instance exists.
except KeyError:
raise PublishError(
f'Could not find shot instance for {instance.data["label"]}.'
" Please ensure it is set and enabled."
)

instance.data.update(shot_instance_data)

# Adjust instance data from parent otio timeline.
Expand Down
16 changes: 12 additions & 4 deletions client/ayon_hiero/plugins/publish/collect_plates.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,19 @@ def process(self, instance):

# Retrieve instance data from parent instance shot instance.
parent_instance_id = instance.data["parent_instance_id"]
edit_shared_data = instance.context.data["editorialSharedData"]

instance.data.update(
edit_shared_data[parent_instance_id]
)
try:
edit_shared_data = instance.context.data["editorialSharedData"]
instance.data.update(
edit_shared_data[parent_instance_id]
)

# Ensure shot instance related to the audio instance exists.
except KeyError:
raise PublishError(
f'Could not find shot instance for {instance.data["label"]}.'
" Please ensure it is set and enabled."
)

track_item = instance.data["item"]
clip_colorspace = track_item.sourceMediaColourTransform()
Expand Down

0 comments on commit c88c558

Please sign in to comment.