Jump to content
pan.mentolka

how to import point (attribute VOP)

Recommended Posts

Hello guys! Can U help me with small problem? 

I dont know how to import all of the points from scatter to attribvop (to get to an same gradient for all of them)?? Can u give me any advices?

Thank you so much!

hip. hile in attach

problem.png

how_to_import_all_points.hip

Share this post


Link to post
Share on other sites

Hello guys! Can U help me with small problem? 

I dont know how to import all of the points from scatter to attribvop (to get to an same gradient for all of them)?? Can u give me any advices?

Thank you so much!

hip. hile in attach

problem.png

how_to_import_all_points.hip

Share this post


Link to post
Share on other sites

- 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

Share this post


Link to post
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.

Share this post


Link to post
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

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

×