mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-27 14:22:37 +01:00
♻️ handle frame data
This commit is contained in:
parent
c5e7d8f93c
commit
99bf89cafa
3 changed files with 30 additions and 1 deletions
|
|
@ -530,3 +530,30 @@ def get_template_from_value(key, value):
|
|||
raise TypeError("Unsupported type: %r" % type(value))
|
||||
|
||||
return parm
|
||||
|
||||
|
||||
def get_frame_data(node):
|
||||
"""Get the frame data: start frame, end frame and steps.
|
||||
|
||||
Args:
|
||||
node(hou.Node)
|
||||
|
||||
Returns:
|
||||
dict: frame data for star, end and steps.
|
||||
|
||||
"""
|
||||
data = {}
|
||||
|
||||
if node.parm("trange") is None:
|
||||
|
||||
return data
|
||||
|
||||
if node.evalParm("trange") == 0:
|
||||
self.log.debug("trange is 0")
|
||||
return data
|
||||
|
||||
data["frameStart"] = node.evalParm("f1")
|
||||
data["frameEnd"] = node.evalParm("f2")
|
||||
data["steps"] = node.evalParm("f3")
|
||||
|
||||
return data
|
||||
|
|
@ -14,7 +14,7 @@ from openpype.pipeline import (
|
|||
)
|
||||
from openpype.lib import BoolDef
|
||||
from openpype.hosts.houdini.api import list_instances, remove_instance
|
||||
from .lib import imprint, read
|
||||
from .lib import imprint, read, get_frame_data
|
||||
|
||||
|
||||
class OpenPypeCreatorError(CreatorError):
|
||||
|
|
|
|||
|
|
@ -25,6 +25,8 @@ class CollectFrames(pyblish.api.InstancePlugin):
|
|||
def process(self, instance):
|
||||
|
||||
ropnode = instance.data["members"][0]
|
||||
frame_data = lib.get_frame_data(ropnode)
|
||||
instance.data.update(frame_data)
|
||||
|
||||
start_frame = instance.data.get("frameStart", None)
|
||||
end_frame = instance.data.get("frameEnd", None)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue