Jump to content

Is there a way to list volumes in a menu parameter?


magneto

Recommended Posts

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 :)

Link to comment
Share on other sites

  • 2 weeks later...

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

  • Like 2
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...