mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
New style creator
This commit is contained in:
parent
f296756998
commit
36eeb976f7
1 changed files with 22 additions and 21 deletions
|
|
@ -1,9 +1,14 @@
|
|||
from openpype.hosts.houdini.api import plugin
|
||||
from openpype.pipeline import (
|
||||
CreatedInstance,
|
||||
OpenPypePyblishPluginMixin
|
||||
)
|
||||
|
||||
|
||||
class CreateReview(plugin.Creator):
|
||||
class CreateReview(plugin.HoudiniCreator, OpenPypePyblishPluginMixin):
|
||||
"""Review with OpenGL ROP"""
|
||||
|
||||
identifier = "io.openpype.creators.houdini.review"
|
||||
label = "Review"
|
||||
family = "review"
|
||||
icon = "video-camera"
|
||||
|
|
@ -15,27 +20,26 @@ class CreateReview(plugin.Creator):
|
|||
height = 720
|
||||
aspect = 1.0
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(CreateReview, self).__init__(*args, **kwargs)
|
||||
def create(self, subset_name, instance_data, pre_create_data):
|
||||
|
||||
import hou
|
||||
|
||||
# Remove the active, we are checking the bypass flag of the nodes
|
||||
self.data.pop("active", None)
|
||||
instance_data.pop("active", None)
|
||||
|
||||
self.data.update({"node_type": "opengl"})
|
||||
instance_data["node_type"] = "opengl"
|
||||
|
||||
def _process(self, instance):
|
||||
"""Creator main entry point.
|
||||
instance = super(CreateReview, self).create(
|
||||
subset_name,
|
||||
instance_data,
|
||||
pre_create_data) # type: CreatedInstance
|
||||
|
||||
Args:
|
||||
instance (hou.Node): Created Houdini instance.
|
||||
|
||||
"""
|
||||
import hou
|
||||
instance_node = hou.node(instance.get("instance_node"))
|
||||
|
||||
frame_range = hou.playbar.frameRange()
|
||||
|
||||
parms = {
|
||||
"picture": "$HIP/pyblish/{0}/{0}.$F4.png".format(self.name),
|
||||
"picture": '$HIP/pyblish/`chs("subset")`/`chs("subset")`.$F4.png',
|
||||
# Render frame range
|
||||
"trange": 1,
|
||||
|
||||
|
|
@ -55,19 +59,16 @@ class CreateReview(plugin.Creator):
|
|||
"aspect": self.aspect
|
||||
})
|
||||
|
||||
if self.nodes:
|
||||
if self.selected_nodes:
|
||||
# todo: allow only object paths?
|
||||
node_paths = " ".join(node.path() for node in self.nodes)
|
||||
node_paths = " ".join(node.path() for node in self.selected_nodes)
|
||||
parms.update({"scenepath": node_paths})
|
||||
|
||||
instance.setParms(parms)
|
||||
instance_node.setParms(parms)
|
||||
|
||||
# Lock any parameters in this list
|
||||
to_lock = [
|
||||
# Lock some Avalon attributes
|
||||
"family",
|
||||
"id",
|
||||
"id"
|
||||
]
|
||||
for name in to_lock:
|
||||
parm = instance.parm(name)
|
||||
parm.lock(True)
|
||||
self.lock_parameters(instance_node, to_lock)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue