検索 - User list
Full Version: Get/Set Reference File Paths in Stage Manager with Python
Root » Solaris and Karma » Get/Set Reference File Paths in Stage Manager with Python
erikcarlson
Hi

I'm working on a Python/PySide tool for getting/setting reference file paths. This is straight-forward when using Reference nodes. For example, the Python code would look something like:

import hou
import nodesearch

lop_network = hou.node('/stage')
matcher = nodesearch.NodeType('Reference')
found = matcher.nodes(lop_network, recursive=True, recurse_in_locked_nodes=False)
# Get file paths
paths = []
for node in found:
    num_files = node.parm('num_files').eval()
    for i in range(num_files):
        parm_name = 'filepath{}'.format(i + 1)
        path = node.parm(parm_name).eval()
        print('{node}/{parm}: {path}'.format(
            node=node.path(), parm=parm_name, path=path)
        )
        paths.append(path)


# Set file paths
for node in found:
    num_files = node.parm('num_files').eval()
    for i in range(num_files):
        parm_name = 'filepath{}'.format(i + 1)
        node.parm(parm_name).set('$HIP/assets/asset.usd')

But how would I do this with Stage Manager nodes? They use a custom UI instead of the typical Houdini Node parm UI, and I can't find documentation for this.
Any ideas?
mtucker
Only the UI is different. Under the hood the Stage Manager uses regular parameters like every other Houdini node. You can switch from the custom UI to the regular parameter dialog using the "Show/Hide Parameters" button immediately to the right of the node name in the parameter dialog pane. In other words, to manipulate the stage manager with HOM, you can use standard parameter manipulation methods.
erikcarlson
Thank you mtucker! I didn't know about "Show/Hide Parameters". That is super helpful.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB