magneto Posted November 29, 2015 Share Posted November 29, 2015 Hi, I have a menu parameter and I am trying to list the volumes in the input geometry. I know how to list attributes but for volumes, do I have to iterate though all prims and see if they are volume? Because if I have millions of polygons and 2 points, it seems wasteful. Maybe there is a faster way? Thanks Quote Link to comment Share on other sites More sharing options...
f1480187 Posted December 11, 2015 Share Posted December 11, 2015 Use hou.Geometry.globPrims(pattern) method with an ad-hoc group expression @intrinsic:typename==VDB,Volume. import itertools pattern = '@intrinsic:typename==VDB,Volume' volumes = hou.pwd().geometry().globPrims(pattern) tokens = [v.number() for v in volumes] labels = ['Volume #%i'%n for n in tokens] return list(itertools.chain(*zip(tokens, labels))) volumes_menu.hipnc 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.