Python Equivalent expandprimgroup

   957   2   0
User Avatar
Member
4 posts
Joined: April 2019
Offline
Hi everyone,

I'm trying to work out how to get all the prims in a geometry that have a particular attribute using python. For example, in Vex I can do
expandprimgroup(0, "@name=whatever")
and get all the prims where the name attribute is "whatever". The nearest I can find in python is
hou.Geometry.findPrimGroup("group_name")
but that only appears to work with defined groups and not by attribute matching.

I feel like this is a pretty simple one, but I can't find what I need. Any ideas?
User Avatar
Staff
1072 posts
Joined: July 2005
Offline
hou.Geometry.globPrims("@name=whatever")
is probably what you want.
Edited by Ondrej - Oct. 31, 2022 09:44:32
User Avatar
Member
4 posts
Joined: April 2019
Offline
Ondrej
hou.Geometry.globPrims("@name=whatever")
is probably what you want.
It is indeed. Thank you.
  • Quick Links