Get/Set Reference File Paths in Stage Manager with Python

   2808   2   0
User Avatar
Member
25 posts
Joined: 12月 2015
オフライン
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?
User Avatar
スタッフ
4556 posts
Joined: 7月 2005
オフライン
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.
User Avatar
Member
25 posts
Joined: 12月 2015
オフライン
Thank you mtucker! I didn't know about "Show/Hide Parameters". That is super helpful.
  • Quick Links