検索 - User list
Full Version: Resolve primpath in python node?
Root » Solaris and Karma » Resolve primpath in python node?
Tim Crowson
I am trying to use a Python Script to operate on primitives in the scenegraph. But I want the script to identify the prims by resolving a pattern I feed it. Basically instead of targeting explicit paths, I want to identify them using a pattern (the same way a primpattern parameter might. I gather I can use hou.LopSelectionRule.expandedPaths, but this seems to require another lop node object, rather than a string.

Is it possible to specify a pattern (as a string), and have my Python Script node resolve that pattern to actual prim paths in the Scene Graph without involving other nodes? (I was kind of hoping the Python Script node would just have a primpath/primpattern parm like Attribute Wrangle).
mtucker
hou.LopSelectionRule is what you want. To the right of the script are of the Python LOP is a drop down menu from which you can choose to load a couple of different sample script. Choose the “Dim All Lights” sample, which includes the use of a hou.LopSelectionRule to find all the lights in the scene.
Tim Crowson
Thank you, that does exactly what I need!
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