Jump to content

how to import point (attribute VOP)


Recommended Posts

- you can use foreach loop to accumulate the falloff value

- also if will help to have f@pscale attribute on your points or spheres to be able to have varying radii

- and instead of looping through all of them you can loop just through points that would influence the point using pcfind_radius()

f@falloff = 1;
int pts[] = pcfind_radius(1, "P", "pscale", 1.0, @P, 0.0, 1e9);
foreach(int pt; pts){
    float r = point(1, "pscale", pt);
    vector P = point(1, "P", pt);
    float dist = distance(P, v@P);
    f@falloff = min(f@falloff, fit(dist, 0, r, 0, 1));
}

 

how_to_import_all_points_fix.hip

  • Thanks 1
Link to comment
Share on other sites

Sorry, I don't really understand what you are trying to do. An attribute vop does run on all points that are plugged into the attribute vop. Anything done inside the attribute vop will run on all the points. Then you said you want the same gradient on all the points. That part really doesnt make sense. It looks like you have a color gradient on your grid, but the only reason you are seeing that is because it is a collection of points. Each point only has 1 color, so it's impossible to have a gradient of color on any one point. Maybe ask your same question differently and it will make more sense.

Link to comment
Share on other sites

26 minutes ago, anim said:

- you can use foreach loop to accumulate the falloff value

- also if will help to have f@pscale attribute on your points or spheres to be able to have varying radii

- and instead of looping through all of them you can loop just through points that would influence the point using pcfind_radius()


f@falloff = 1;
int pts[] = pcfind_radius(1, "P", "pscale", 1.0, @P, 0.0, 1e9);
foreach(int pt; pts){
    float r = point(1, "pscale", pt);
    vector P = point(1, "P", pt);
    float dist = distance(P, v@P);
    f@falloff = min(f@falloff, fit(dist, 0, r, 0, 1));
}

 

how_to_import_all_points_fix.hip

I have no idea how you gauged that that was what he was trying to do lol

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