Skip to content

Commit 8afc7e9

Browse files
committed
Merge branch 'develop' into enhancement/support_free_version
2 parents e14b902 + fc871cb commit 8afc7e9

File tree

2 files changed

+35
-4
lines changed

2 files changed

+35
-4
lines changed

client/ayon_resolve/plugins/create/create_shot_clip.py

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,14 @@ class ResolveShotInstanceCreator(_ResolveInstanceClipCreator):
170170

171171
def get_instance_attr_defs(self):
172172
instance_attributes = CLIP_ATTR_DEFS
173+
instance_attributes.append(
174+
BoolDef(
175+
"useSourceResolution",
176+
label="Set shot resolution from plate",
177+
tooltip="Is resolution taken from timeline or source?",
178+
default=False,
179+
)
180+
)
173181
return instance_attributes
174182

175183

@@ -637,7 +645,8 @@ def create(self, subset_name, instance_data, pre_create_data):
637645
"clipDuration": track_item_duration,
638646
"sourceIn": track_item.GetLeftOffset(),
639647
"sourceOut": (track_item.GetLeftOffset() +
640-
track_item_duration)
648+
track_item_duration),
649+
"useSourceResolution": sub_instance_data["sourceResolution"],
641650
})
642651

643652
# Plate, Audio
@@ -718,6 +727,27 @@ def _create_and_add_instance(self, data, creator_id,
718727
CreatedInstance: The newly created instance.
719728
"""
720729
creator = self.create_context.creators[creator_id]
730+
731+
if creator_id == "io.ayon.creators.resolve.shot":
732+
track_item_duration = timeline_item.GetDuration()
733+
workfileFrameStart = data["workfileFrameStart"]
734+
creator_attributes = {
735+
"workfileFrameStart": workfileFrameStart,
736+
"handleStart": data["handleStart"],
737+
"handleEnd": data["handleEnd"],
738+
"frameStart": workfileFrameStart,
739+
"frameEnd": (workfileFrameStart +
740+
track_item_duration),
741+
"clipIn": timeline_item.GetStart(),
742+
"clipOut": timeline_item.GetEnd(),
743+
"clipDuration": track_item_duration,
744+
"sourceIn": timeline_item.GetLeftOffset(),
745+
"sourceOut": (timeline_item.GetLeftOffset() +
746+
track_item_duration),
747+
"useSourceResolution": data["sourceResolution"],
748+
}
749+
data["creator_attributes"] = creator_attributes
750+
721751
instance = creator.create(data, None)
722752
instance.transient_data["track_item"] = timeline_item
723753
self._add_instance_to_context(instance)
@@ -754,7 +784,7 @@ def _handle_legacy_marker(self, tag_data, timeline_item, instances):
754784
"clip_variant": tag_data["variant"],
755785
"creator_attributes": {
756786
"parentInstance": inst["label"],
757-
}
787+
}
758788
})
759789
inst = self._create_and_add_instance(
760790
plate_data, creator_id, timeline_item, instances)

client/ayon_resolve/plugins/publish/collect_shots.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,9 @@ def process(self, instance):
7171
creator_id = instance.data["creator_identifier"]
7272
inst_data = marker.metadata["resolve_sub_products"].get(creator_id, {})
7373

74-
# Overwrite settings with clip metadata is "sourceResolution"
75-
overwrite_clip_metadata = inst_data.get("sourceResolution", False)
74+
# Overwrite settings with clip metadata is "useSourceResolution"
75+
creator_attributes = instance.data["creator_attributes"]
76+
overwrite_clip_metadata = creator_attributes.get("useSourceResolution", False)
7677
if overwrite_clip_metadata:
7778
clip_metadata = inst_data["clip_source_resolution"]
7879
width = clip_metadata["width"]

0 commit comments

Comments
 (0)