mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-26 05:42:15 +01:00
feat(nks): if user writes source to Tags value it will get source frames
This commit is contained in:
parent
30f4f13809
commit
44814124f8
1 changed files with 14 additions and 2 deletions
|
|
@ -1,5 +1,5 @@
|
|||
from pyblish import api
|
||||
|
||||
import os
|
||||
|
||||
class CollectClipTagFrameStart(api.InstancePlugin):
|
||||
"""Collect FrameStart from Tags of selected track items."""
|
||||
|
|
@ -19,8 +19,20 @@ class CollectClipTagFrameStart(api.InstancePlugin):
|
|||
|
||||
# gets only task family tags and collect labels
|
||||
if "frameStart" in t_family:
|
||||
t_value = t_metadata.get("tag.value", "")
|
||||
|
||||
# backward compatibility
|
||||
t_number = t_metadata.get("tag.number", "")
|
||||
start_frame = int(t_number)
|
||||
|
||||
try:
|
||||
start_frame = int(t_number) or int(t_value)
|
||||
except ValueError:
|
||||
if "source" in t_value:
|
||||
source_first = instance.data["sourceFirst"]
|
||||
source_in = instance.data["sourceIn"]
|
||||
handle_start = instance.data["handleStart"]
|
||||
start_frame = (source_first + source_in) - handle_start
|
||||
|
||||
instance.data["startingFrame"] = start_frame
|
||||
self.log.info("Start frame on `{0}` set to `{1}`".format(
|
||||
instance, start_frame
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue