Resolve primpath in python node?

   2065   2   1
User Avatar
Member
240 posts
Joined: Oct. 2014
Offline
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).
- Tim Crowson
Technical/CG Supervisor
User Avatar
Staff
4450 posts
Joined: July 2005
Offline
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.
User Avatar
Member
240 posts
Joined: Oct. 2014
Offline
Thank you, that does exactly what I need!
- Tim Crowson
Technical/CG Supervisor
  • Quick Links