@@ -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 )
0 commit comments