Jump to content

Point function fails to use pscale attribute


lulu01

Recommended Posts

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
Link to comment
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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...