Jump to content

There's an error with the attribute vop.


Recommended Posts

you simply didn't delare dist_max variable, so it's invalid

also why are you using Attrib VOP if all you are doing is writing a snippet like Wranlge? You'll run into more issues, like you have to define Bindings to Export etc, which you haven't and your ramp parameter is nonexistent so it can't sample it

so maybe for start just use Wrangle and declare dist_max variable either as constant number or parameter value

Edited by anim
Link to comment
Share on other sites

something like this:

int near_prim ;
vector near_uv ;
float dist_max = chf("dist_max");

float near_dist = xyzdist(1, v@P, near_prim, near_uv, dist_max) ;
if (near_prim != -1) 
{
 float near_dist_normed = near_dist/dist_max;
 float ramp_val = chramp("ramp",near_dist_normed);
 vector color = {1,0,0};
 v@Cd = lerp(v@Cd, color, ramp_val);
}

 

solver_xyz_dist2_fix.hipnc

Link to comment
Share on other sites

34 minutes ago, anim said:

something like this:


int near_prim ;
vector near_uv ;
float dist_max = chf("dist_max");

float near_dist = xyzdist(1, v@P, near_prim, near_uv, dist_max) ;
if (near_prim != -1) 
{
 float near_dist_normed = near_dist/dist_max;
 float ramp_val = chramp("ramp",near_dist_normed);
 vector color = {1,0,0};
 v@Cd = lerp(v@Cd, color, ramp_val);
}

 

solver_xyz_dist2_fix.hipnc

Thank you so much

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...