Re-sorting point numbers with python

   3807   4   2
User Avatar
Member
696 posts
Joined: 3月 2009
Offline
Hi there

Is it possible to re-sort the point numbers on geometry using python? If so, can anybody “point” me on the right direction?

Cheers
Toronto - ON
My Houdini playground [renderfarm.tumblr.com]
“As technology advances, the rendering time remains constant.”
User Avatar
Member
1908 posts
Joined: 11月 2006
Offline
HOM provides no way to do any kind of sorting. You could conceivably do it manually by creating an equal amount of points as your source, copying all attribute values from the source points to the dest points in whatever sort order you see fit and then delete the source points. This however would be very slow for even a moderate amount of points and attributes.

Another approach would be to use inlinecpp to wrap around some of the HDK calls that can sort points/prims.
Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
696 posts
Joined: 3月 2009
Offline
Cool, thanks for clarifying this!
Toronto - ON
My Houdini playground [renderfarm.tumblr.com]
“As technology advances, the rendering time remains constant.”
User Avatar
Member
26 posts
Joined: 9月 2010
Offline
Graham,

Instead of sorting points, would it be possible to dynamically create lists in Python based on a parameter, and then appending any amount of points to these lists based on their attribute value?

In layman:

list 1
list 2
list x…

if point Cd value = 1
append point to list 1
User Avatar
Member
4531 posts
Joined: 2月 2012
Offline
You can use nested lists or a dictionary of lists depending on how you want to add items to the appropriate lists.
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]

youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
  • Quick Links