Hi,
I'd like to “walk” on polymesh components, so I'm looking for geometry functionality somewhere in the python hou module that would give me functions like “related points/edges/polygons” (I'd like to query things like all polygons belonging to a point, all points belonging to a poly, etc)
Seems like this functionality is very obscure (I could find something for edges and vertices, but not for points or polygons). Any tips on how to do this?
cheers,
imre
polymesh "related components" functionality in pyt
3185 2 1-
- riviera
- Member
- 1721 posts
- Joined: 3月 2020
- オフライン
Imre Tuske
FX Supervisor | Senior FXTD @ Weta FX
qLib -- Houdini asset library
http://qlab.github.io/qLib/ [qlab.github.io]
https://www.facebook.com/qLibHoudini [www.facebook.com]
FX Supervisor | Senior FXTD @ Weta FX
qLib -- Houdini asset library
http://qlab.github.io/qLib/ [qlab.github.io]
https://www.facebook.com/qLibHoudini [www.facebook.com]
-
- koen
- Member
- 795 posts
- Joined: 4月 2020
- オフライン
I think vertices are the link between polygons and points, there is a nice explanation here:
http://www.sidefx.com/docs/hdk13.0/hdk_geometry_intro.html [sidefx.com]
to get all the points for a face:
n=hou.node('/obj/geo1/box1')
geo=n.geometry()
# for example, find all the points beloging to prim
prim = geo.prims()
points =
for vert in prim.vertices():
points.append(vert.point())
print points
However, starting with points seems a lot harder, since they dont have any functions that allow you to find “things that contain this point”. You can only jump to the geometry and start from there is seems…
Hope this still helps a little…
Cheers,
Koen
ps. just noticed this in help(hou.Vertex):
| Note that you can use hou.Vertex.point to retrieve a point from a
| vertex, but there is no method to retrieve all the vertices referring to
| a point. Houdini does not store this information internally, but you can
| derive it. The best way to quickly retrieve this information is to
| build a dictionary mapping all points to sets of vertices, and then
| reuse this dictionary in your algorithm.
http://www.sidefx.com/docs/hdk13.0/hdk_geometry_intro.html [sidefx.com]
to get all the points for a face:
n=hou.node('/obj/geo1/box1')
geo=n.geometry()
# for example, find all the points beloging to prim
prim = geo.prims()
points =
for vert in prim.vertices():
points.append(vert.point())
print points
However, starting with points seems a lot harder, since they dont have any functions that allow you to find “things that contain this point”. You can only jump to the geometry and start from there is seems…
Hope this still helps a little…
Cheers,
Koen
ps. just noticed this in help(hou.Vertex):
| Note that you can use hou.Vertex.point to retrieve a point from a
| vertex, but there is no method to retrieve all the vertices referring to
| a point. Houdini does not store this information internally, but you can
| derive it. The best way to quickly retrieve this information is to
| build a dictionary mapping all points to sets of vertices, and then
| reuse this dictionary in your algorithm.
-
- riviera
- Member
- 1721 posts
- Joined: 3月 2020
- オフライン
Thanks for the hints… I'm a bit more hopeful, but not that much more
I'm thinking of implementing procedural edge loop/ring selection SOPs (for whose you'd need related-component inspection functions very much). Anywayy, we'll see if this is enough…
cheers
I'm thinking of implementing procedural edge loop/ring selection SOPs (for whose you'd need related-component inspection functions very much). Anywayy, we'll see if this is enough…cheers
Imre Tuske
FX Supervisor | Senior FXTD @ Weta FX
qLib -- Houdini asset library
http://qlab.github.io/qLib/ [qlab.github.io]
https://www.facebook.com/qLibHoudini [www.facebook.com]
FX Supervisor | Senior FXTD @ Weta FX
qLib -- Houdini asset library
http://qlab.github.io/qLib/ [qlab.github.io]
https://www.facebook.com/qLibHoudini [www.facebook.com]
-
- Quick Links

