Automation of USD Render creation

I was wondering if anyone has any tips on automating USD Render publish creation. I have X amount of streams (let’s say 100) in houdini each ending with a null that I want to create a USD Render publish for so that I can submit them to our farm. Is there a way for me to select all the nulls and that ayon creates all the publishes with specific settings (Arnold instead of Karma for example) and names them according to the null names?

As far as I know, the way to automate publish instance creation is by coding, where you use create_context.create.

This is related to AYON itself, not to any specific addon. So, I’d suggest adjusting the title to Automation of Publish instance creation

This example, create_instance_from_code.py, shows how to create a publish instance programmatically. Most creator plugins expect selecting what you want to publish from the scene. So, you’d need to adjust your selection before running create_context.create.

In Houdini, you can adjust the selection via:

import hou

node = hou.node("my_null_node_path")
node.setSelected(True, clear_all_selected=True)

Another method, related to the Houdini Addon workflow, is to use the interactive creator (Creating instances via TAB menu).

It can be accessed programmatically via:

from ayon_houdini.api.creator_node_shelves import create_interactive

create_interactive("io.openpype.creators.houdini.usdrender")

However, it always prompts users to input a variant name, and it can be slow as it doesn’t cache any data.