add fbx collector

This commit is contained in:
Mustafa-Zarkash 2023-07-29 02:28:02 +03:00
parent 7918668e72
commit ed2a48e2cd

View file

@ -0,0 +1,56 @@
"""Collector for filmboxfbx types.
A Collector can act as a preprocessor for the validation stage.
It is used mainly to update instance.data
P.S.
There are some collectors that run by default for all types.
"""
import pyblish.api
class CollectFilmboxfbxType(pyblish.api.InstancePlugin):
"""Collect data type for filmboxfbx instance."""
order = pyblish.api.CollectorOrder
hosts = ["houdini"]
families = ["filmboxfbx"]
label = "Collect type of filmboxfbx"
def process(self, instance):
if instance.data["creator_identifier"] == "io.openpype.creators.houdini.filmboxfbx": # noqa: E501
# such a condition can be used to differentiate between
# instances by identifier even if they have the same type.
pass
# Update instance.data with ouptut_node
out_node = self.get_output_node(instance)
if out_node:
instance.data["output_node"] = out_node
# Disclaimer : As a convntin we use collect_output_node.py
# to Update instance.data with ouptut_node of different types
# however, we use this collector instead for demonstration
def get_output_node(self, instance):
"""Getting output_node Logic.
It's moved here so that it become easier to focus on
process method.
"""
import hou
# get output node
node = hou.node(instance.data["instance_node"])
out_node = node.parm("startnode").evalAsNode()
if not out_node:
self.log.warning("No output node collected.")
return
self.log.debug("Output node: %s" % out_node.path())
return out_node