pcopen restricted to connected splines?

   1855   5   0
User Avatar
Member
6 posts
Joined: July 2018
Offline
Hi everyone. I have an interesting problem I'm trying to figure out. I have a velocity volume that I am tracing points through using the volumetrails sop. I have run those trails through a wire solver to get some cool advection on them. Now I would like to take that animation and copy it to the same volumetrail just with 10x the number of trails.

using rest pos and a point cloud function kind of works, but my points don't all grab onto points from the same spline. And I need them to do that.
User Avatar
Member
4495 posts
Joined: Feb. 2012
Offline
Hi,

You can use pcfind, which is faster than pcopen along with adhoc groups to limit lookups of each point to its original curve. But I would still filter it post-lookup using connectivity information on points:

int pts [ ] = pcfind ( 0, "P", @P, ch("r"), chi("maxpts") );
int samecurvepts [ ] = { };
foreach ( int pt; pts )
{
    int primid = point ( 0, "class", pt );
    if ( i@class == primid )
        append ( samecurvepts, pt );
}

i[]@pts = samecurvepts;

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 | animatrix2k7.gumroad.com
User Avatar
Member
8532 posts
Joined: July 2007
Offline
animatrix_
You can use pcfind, which is faster than pcopen along with adhoc groups to limit lookups of each point to its original curve. But I would still filter it post-lookup using connectivity information on points:

why wouldn't adhoc group be enough?
int pts [ ] = pcfind( 0, "@class=" + str(i@class), "P", @P, ch("r"), chi("maxpts") );
or
int pts [ ] = nearpoints( 0, "@class=" + str(i@class), ch("r"), chi("maxpts") );
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
4495 posts
Joined: Feb. 2012
Offline
tamte
animatrix_
You can use pcfind, which is faster than pcopen along with adhoc groups to limit lookups of each point to its original curve. But I would still filter it post-lookup using connectivity information on points:

why wouldn't adhoc group be enough?
int pts [ ] = pcfind( 0, "@class=" + str(i@class), "P", @P, ch("r"), chi("maxpts") );
or
int pts [ ] = nearpoints( 0, "@class=" + str(i@class), ch("r"), chi("maxpts") );

I didn't say it's not enough, but rather every unique adhoc group in a pcfind call will construct a new acceleration data structure which is very costly in performance.
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 | animatrix2k7.gumroad.com
User Avatar
Member
8532 posts
Joined: July 2007
Offline
Right, could be costly, it all depends on how many unique groups there are
The advantage is that with a lot of points adhoc group guarantees that all points found within the radius and max point limits belong only to the group
Tomas Slancik
FX Supervisor
Method Studios, NY
  • Quick Links