fresiaa Posted April 10, 2020 Share Posted April 10, 2020 Hello guys. Why is there an error in the attribute vop? It's houdini 18. solver_xyz_dist.hipnc Quote Link to comment Share on other sites More sharing options...
anim Posted April 10, 2020 Share Posted April 10, 2020 (edited) 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 April 10, 2020 by anim Quote Link to comment Share on other sites More sharing options...
anim Posted April 11, 2020 Share Posted April 11, 2020 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 Quote Link to comment Share on other sites More sharing options...
fresiaa Posted April 11, 2020 Author Share Posted April 11, 2020 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.