pcopen restricted to connected splines?

   Views 2164   Replies 5   Subscribers 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
4832 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] https://lnk.bio/animatrix [lnk.bio]
User Avatar
Member
9101 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
CG Supervisor
Framestore, NY
User Avatar
Member
4832 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] https://lnk.bio/animatrix [lnk.bio]
User Avatar
Member
9101 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
CG Supervisor
Framestore, NY
User Avatar
Member
4832 posts
Joined: Feb. 2012
Offline
Linking this here as it's relevant:
https://forums.odforce.net/topic/47247-nearpoint-loopexclude-group/?do=findComment&comment=219746 [forums.odforce.net]
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com] https://lnk.bio/animatrix [lnk.bio]
  • Quick Links