Jump to content
Sign in to follow this  
lulu01

Point function fails to use pscale attribute

Recommended Posts

Posted (edited)

Recently I started learning VEX, but now and then I hit a wall. In this case I can't find the answer on my own.
What I'm trying so solve here, is to read the pscale from the closest point.

//PSCALE
@pscale = random(@P);;

//NEARPOINT
string me = itoa(@ptnum);
i@near = nearpoint(0,'!'+me,@P);

//READ PSCALE FROM NEARPOINT
@npt_pscale = point(0, "pscale",@near);

 Getting an attribute with the point function works fine in most cases, like with the @P or @Cd, but with pscale it gives me a value of 0.0.
Not sure I this is the best method, or maybe I'm overlooked something. I really can use some help.

 

 

 

 

nearpoint_pscale.hip

Edited by lulu01

Share this post


Link to post
Share on other sites

Generate your @pscale in a separate wrangle or Attribute Create SOP, before this wrangle.

Wrangles run in parallel, so there's no guarantee that any other nearby point has an initialized @pscale value when the current point runs its search.

  • Like 1

Share this post


Link to post
Share on other sites

I'm still a bit lost on the whole parallel processing concept, but I will do a some more research on the subject.
For now it works, THX toadstorm!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×