Skip to content

Commit

Permalink
Houdini local render: support adding review family to the render
Browse files Browse the repository at this point in the history
  • Loading branch information
MustafaJafar committed Apr 8, 2024
1 parent a6ca148 commit d7b1f3a
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,21 +78,20 @@ def process(self, instance):
"productType": product_type,
"productName": product_name,
"productGroup": product_group,
"tags": [],
"families": ["render.local.hou"],
"families": ["render.local.hou", "review"],
"instance_node": instance.data["instance_node"],
"representations": [
{
"stagingDir": staging_dir,
"ext": ext,
"name": ext,
"tags": ["review"],
"files": aov_filenames,
"frameStart": instance.data["frameStartHandle"],
"frameEnd": instance.data["frameEndHandle"]
}
]
})
self.log.debug(aov_instance.data)

# Remove Mantra instance
# I can't remove it here as I still need it to trigger the render.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ class CollectHoudiniReviewData(pyblish.api.InstancePlugin):
label = "Collect Review Data"
# This specific order value is used so that
# this plugin runs after CollectRopFrameRange
order = pyblish.api.CollectorOrder + 0.1
# Also after CollectLocalRenderInstances
order = pyblish.api.CollectorOrder + 0.13
hosts = ["houdini"]
families = ["review"]

Expand All @@ -28,7 +29,8 @@ def process(self, instance):
ropnode_path = instance.data["instance_node"]
ropnode = hou.node(ropnode_path)

camera_path = ropnode.parm("camera").eval()
# Get camera based on the instance_node type.
camera_path = self._get_camera_path(ropnode)
camera_node = hou.node(camera_path)
if not camera_node:
self.log.warning("No valid camera node found on review node: "
Expand All @@ -55,3 +57,17 @@ def process(self, instance):
# Store focal length in `burninDataMembers`
burnin_members = instance.data.setdefault("burninDataMembers", {})
burnin_members["focalLength"] = focal_length

def _get_camera_path(self, ropnode):
if ropnode.type().name() in {
"opengl", "karma", "ifd", "arnold"
}:
return ropnode.parm("camera").eval()

elif ropnode.type().name() == "Redshift_ROP":
return ropnode.parm("RS_renderCamera").eval()

elif ropnode.type().name() == "vray_renderer":
return ropnode.parm("render_camera").eval()

return ""
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ class ExtractOpenGL(publish.Extractor):

def process(self, instance):
ropnode = hou.node(instance.data.get("instance_node"))
if ropnode.type().name() != "opengl":
self.log.debug("Skipping OpenGl extraction. Rop node {} "
"is not an OpenGl node.".format(ropnode.path()))
return

output = ropnode.evalParm("picture")
staging_dir = os.path.normpath(os.path.dirname(output))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ class ValidateReviewColorspace(pyblish.api.InstancePlugin,

def process(self, instance):

rop_node = hou.node(instance.data["instance_node"])

if rop_node.type().name() != "opengl":
self.log.debug("Skipping Validation. Rop node {} "
"is not an OpenGl node.".format(rop_node.path()))
return

if not self.is_active(instance.data):
return

Expand All @@ -43,7 +50,6 @@ def process(self, instance):
)
return

rop_node = hou.node(instance.data["instance_node"])
if rop_node.evalParm("colorcorrect") != 2:
# any colorspace settings other than default requires
# 'Color Correct' parm to be set to 'OpenColorIO'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ def process(self, instance):

report = []
instance_node = hou.node(instance.data.get("instance_node"))
if instance_node.type().name() != "opengl":
self.log.debug("Skipping Validation. Rop node {} "
"is not an OpenGl node.".format(instance_node.path()))
return

invalid = self.get_invalid_scene_path(instance_node)
if invalid:
Expand Down

0 comments on commit d7b1f3a

Please sign in to comment.