Python: Query available USD renderers

   661   2   1
User Avatar
Member
18 posts
Joined: Jan. 2024
Offline
I seem to be unable to find how to query the available renderers for Solaris USD Render ROP.

The Render Delegate information [www.sidefx.com] doesn't seem to provide me with the right details to find only those that can be set in the USD Render ROP.


hou.lop.availableRendererInfo()
hou.lop.availableRendererLabels()
hou.lop.availableRendererNames()


These do appear to list all renderers, but include the viewport Houdini GL and Storm renderer that USD Render ROP can't set.

I can query the information from the USD Render ROP's `renderer` parm.


node = hou.node("/out/usdrender1")
node.parm("renderer").menuContents()
('HdRedshiftRendererPlugin', 'Redshift', 'BRAY_HdKarma', 'Karma CPU', 'BRAY_HdKarmaXPU', 'Karma XPU', 'HdArnoldRendererP
lugin', 'Arnold')


This is basically the list I want to query, but without requiring to create a USD Render ROP node.


Any ideas?
Edited by colorbleed - Jan. 29, 2024 15:58:43
User Avatar
Member
18 posts
Joined: Jan. 2024
Offline
I ended up doing this:

def get_usd_rop_renderers():
    """Return all available renderers supported by USD Render ROP.

    Note that the USD Render ROP does not include all Hydra renderers, because
    it excludes the GL ones like Houdini GL and Storm.

    Returns:
        dict[str, str]: Plug-in name to display name mapping.

    """
    # USD Render ROP only lists the renderers that have `aovsupport`
    # enabled. Also see:
    # https://www.sidefx.com/docs/houdini/nodes/out/usdrender.html#list
    return {
        info["name"]: info["displayname"] for info
        in hou.lop.availableRendererInfo() if info.get('aovsupport')
    }

However I'm unsure if the the `aovsupport` really is the only option that defines whether the renderer should appear on the USD Renderer ROP's list or not. It does sound like that going based of of this note in the documentation about Available Renderers [www.sidefx.com].

The list of renderers is filtered based on the data returned by the usdrenderers.py script. The husk utility, and by extension the USD Render node, only support renderers that can generate AOV buffers (that is, renderers whose aovsupport attribute is True).

Which I just happened to find just now.
Edited by colorbleed - Jan. 29, 2024 16:03:07
User Avatar
Staff
497 posts
Joined: June 2020
Offline
tom3
I'm unsure if the the `aovsupport` really is the only option that defines whether the renderer should appear on the USD Renderer ROP's list or not.

Yes, the ROP code the builds the menu looks basically like:
for renderer in getAvailableRenderers()
  if renderer.aovSupport()
    addToMenu(renderer)

The same call to getAvailableRenderers()is made in hou.lop.availableRendererInfos()
  • Quick Links