♻️ handle frame data

This commit is contained in:
Ondrej Samohel 2022-09-16 00:34:02 +02:00
parent c5e7d8f93c
commit 99bf89cafa
No known key found for this signature in database
GPG key ID: 02376E18990A97C6
3 changed files with 30 additions and 1 deletions

View file

@ -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

View file

@ -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):

View file

@ -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)