Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Houdini: hotfix instance data access #4236

Merged
merged 2 commits into from
Dec 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion openpype/hosts/houdini/plugins/create/create_hda.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def _check_existing(self, subset_name):
}
return subset_name.lower() in existing_subset_names_low

def _create_instance_node(
def create_instance_node(
self, node_name, parent, node_type="geometry"):
import hou

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def process(self, instance):

# Check bypass state and reverse
active = True
node = hou.node(instance.get("instance_node"))
node = hou.node(instance.data.get("instance_node"))
if hasattr(node, "isBypassed"):
active = not node.isBypassed()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class CollectRedshiftROPRenderProducts(pyblish.api.InstancePlugin):

def process(self, instance):

rop = hou.node(instance.get("instance_node"))
rop = hou.node(instance.data.get("instance_node"))

# Collect chunkSize
chunk_size_parm = rop.parm("chunkSize")
Expand Down
3 changes: 2 additions & 1 deletion openpype/hosts/houdini/plugins/publish/collect_usd_layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def process(self, instance):
self.log.debug("No output node found..")
return

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

save_layers = []
for layer in usdlib.get_configured_save_layers(rop_node):
Expand Down Expand Up @@ -56,6 +56,7 @@ def process(self, instance):
layer_inst.data["subset"] = "__stub__"
layer_inst.data["label"] = label
layer_inst.data["asset"] = instance.data["asset"]
layer_inst.data["instance_node"] = instance.data["instance_node"]
# include same USD ROP
layer_inst.append(rop_node)
# include layer data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class ExtractRedshiftProxy(publish.Extractor):

def process(self, instance):

ropnode = hou.node(instance.get("instance_node"))
ropnode = hou.node(instance.data.get("instance_node"))

# Get the filename from the filename parameter
# `.evalParm(parameter)` will make sure all tokens are resolved
Expand Down
2 changes: 1 addition & 1 deletion openpype/hosts/houdini/plugins/publish/extract_usd.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class ExtractUSD(publish.Extractor):

def process(self, instance):

ropnode = hou.node(instance.get("instance_node"))
ropnode = hou.node(instance.data.get("instance_node"))

# Get the filename from the filename parameter
output = ropnode.evalParm("lopoutput")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def process(self, instance):

# Main ROP node, either a USD Rop or ROP network with
# multiple USD ROPs
node = hou.node(instance.get("instance_node"))
node = hou.node(instance.data["instance_node"])

# Collect any output dependencies that have not been processed yet
# during extraction of other instances
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class ExtractVDBCache(publish.Extractor):

def process(self, instance):

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

# Get the filename from the filename parameter
# `.evalParm(parameter)` will make sure all tokens are resolved
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ def process(self, instance):
@classmethod
def get_invalid(cls, instance):

node = hou.node(instance.get("instance_node"))

node = hou.node(instance.data["instance_node"])
# Check trange parm, 0 means Render Current Frame
frame_range = node.evalParm("trange")
if frame_range == 0:
Expand Down
2 changes: 1 addition & 1 deletion openpype/hosts/houdini/plugins/publish/validate_bypass.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ def process(self, instance):
@classmethod
def get_invalid(cls, instance):

rop = hou.node(instance.get("instance_node"))
rop = hou.node(instance.data["instance_node"])
if hasattr(rop, "isBypassed") and rop.isBypassed():
return [rop]
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def get_invalid(cls, instance):
)

if output_node is None:
node = hou.node(instance.get("instance_node"))
node = hou.node(instance.data.get("instance_node"))
cls.log.error(
"COP Output node in '%s' does not exist. "
"Ensure a valid COP output path is set." % node.path()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ def process(self, instance):
@classmethod
def get_invalid(cls, instance):

node = hou.node(instance.get("instance_node"))

node = hou.node(instance.data["instance_node"])
# Check trange parm, 0 means Render Current Frame
frame_range = node.evalParm("trange")
if frame_range == 0:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def process(self, instance):
validate_nodes = []

if len(instance) > 0:
validate_nodes.append(hou.node(instance.get("instance_node")))
validate_nodes.append(hou.node(instance.data.get("instance_node")))
output_node = instance.data.get("output_node")
if output_node:
validate_nodes.append(output_node)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class ValidateUSDLayerPathBackslashes(pyblish.api.InstancePlugin):

def process(self, instance):

rop = hou.node(instance.get("instance_node"))
rop = hou.node(instance.data.get("instance_node"))
lop_path = hou_usdlib.get_usd_rop_loppath(rop)
stage = lop_path.stage(apply_viewport_overrides=False)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class ValidateUsdModel(pyblish.api.InstancePlugin):

def process(self, instance):

rop = hou.node(instance.get("instance_node"))
rop = hou.node(instance.data.get("instance_node"))
lop_path = hou_usdlib.get_usd_rop_loppath(rop)
stage = lop_path.stage(apply_viewport_overrides=False)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def get_invalid(cls, instance):
output_node = instance.data["output_node"]

if output_node is None:
node = hou.node(instance.get("instance_node"))
node = hou.node(instance.data.get("instance_node"))
cls.log.error(
"USD node '%s' LOP path does not exist. "
"Ensure a valid LOP path is set." % node.path()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def process(self, instance):
from pxr import UsdGeom
import hou

rop = hou.node(instance.get("instance_node"))
rop = hou.node(instance.data.get("instance_node"))
lop_path = hou_usdlib.get_usd_rop_loppath(rop)
stage = lop_path.stage(apply_viewport_overrides=False)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ValidateUsdShadeWorkspace(pyblish.api.InstancePlugin):

def process(self, instance):

rop = hou.node(instance.get("instance_node"))
rop = hou.node(instance.data.get("instance_node"))
workspace = rop.parent()

definition = workspace.type().definition()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def get_invalid(cls, instance):
if node is None:
cls.log.error(
"SOP path is not correctly set on "
"ROP node '%s'." % instance.get("instance_node")
"ROP node '%s'." % instance.data.get("instance_node")
)
return [instance]

Expand Down