top of page

Houdini Python - 09 Copy AOVs - Arnold Part - I

  • Writer: Ravi Motwani
    Ravi Motwani
  • Jul 30, 2024
  • 2 min read

Part - 1 'UI'




Brief Thought:

"Here we will create a tool to copy AOVs from the initial pass to multiple selected passes within Arnold in Houdini. This section will focus on designing the user interface and retrieving data from the initial pass."


User Interface:


Details:

  1. Here we have chosen several Arnold Passes.

  2. All the available AOVs were taken from the First Pass.

  3. Next, we forwarded it to the user interface for the user to choose which items to copy from this pass in order to paste them onto all other passes.


Python Script Bullet Points:


  • Define Parameter Names: Set the names used to get the AOV count and labels.

aov_count = "ar_aovs"
aov_label = "ar_aov_label"
  • Get Selected Nodes: Retrieve nodes selected by the user.

nodes = list(hou.selectedNodes())
  • Filter Arnold Nodes: Only consider nodes of type "arnold."

nodes_type = [ x for x in nodes if x.type().name() != "arnold" ]
  • Check Valid Selection: Ensure at least 2 Arnold nodes are selected.

if len(nodes) < 2 :
    return (hou.ui.displayMessage("Select at least 2 Arnold Nodes"))
  • Identify Parent and Child Nodes: The first node is the parent, and the rest are children.

parent_node = nodes[0]
child_nodes = nodes[1:]
  • Create Message: Prepare a message showing which nodes are involved.

child_nodes_names = [x.name() for x in child_nodes]
message = "FROM :\n" + parent_node.name() + "\nTO : \n" + str(child_nodes_names)
  • Get AOV Data: Fetch AOV labels from the parent node.

parent_aovs_count = parent_node.parm(aov_count).eval()
  • Show UI: Present a dialog for selecting which AOVs to copy.

if parent_aovs_count:
    parent_aovs_labels = [parent_node.parm(f"{aov_label}{x+1}").eval() for x in range(parent_aovs_count)]

    arnold_aov_selection_ui = hou.ui.selectFromList(
        choices=parent_aovs_labels, 
        default_choices= (), 
        column_header="copy AOVs",
        message=message, 
        title="Copy Arnold AOVs", 
        clear_on_cancel=True)

Follow us on Instagram for fun stuff, and let's connect on LinkedIn too! Your support means everything to us. See you there!"

 
 
 

Comments


  • Instagram
  • Youtube

©2024 by COPYVFX. Proudly created with Wix.com

bottom of page