Skip to content

Commit

Permalink
Fix nodetype check + cosmetics
Browse files Browse the repository at this point in the history
  • Loading branch information
BigRoy committed Jul 16, 2024
1 parent 01de96c commit 7c9913b
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions client/ayon_maya/plugins/inventory/connect_ornatrix_rig.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,18 @@ def connect_ornatrix_nodes(target_node: str, namespace: str):
"MeshFromStrandsNode", "SurfaceCombNode"
})
for ox_node in ox_nodes:
if cmds.nodeType("GuidesFromMeshNode"):
cmds.connectAttr(f"{target_node}.outMesh", f"{ox_node}.inMesh")
elif cmds.nodeType("HairFromGuidesNode"):
cmds.connectAttr(f"{target_node}.outMesh", f"{ox_node}.distributionMesh")
cmds.connectAttr(f"{target_node}.worldMatrix[0]", f"{ox_node}.distributionMeshMatrix")
node_type = cmds.nodeType(ox_node)
if node_type == "GuidesFromMeshNode":
cmds.connectAttr(f"{target_node}.outMesh",
f"{ox_node}.inMesh")
elif node_type == "HairFromGuidesNode":
cmds.connectAttr(f"{target_node}.outMesh",
f"{ox_node}.distributionMesh")
cmds.connectAttr(f"{target_node}.worldMatrix[0]",
f"{ox_node}.distributionMeshMatrix")
else:
cmds.connectAttr(f"{target_node}.outMesh", f"{ox_node}.distributionMesh")
cmds.connectAttr(f"{target_node}.outMesh",
f"{ox_node}.distributionMesh")


class ConnectOrnatrixRig(InventoryAction):
Expand Down

0 comments on commit 7c9913b

Please sign in to comment.