herr.ja Posted April 4, 2019 Share Posted April 4, 2019 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 how_to_import_all_points.hip Quote Link to comment Share on other sites More sharing options...
herr.ja Posted April 4, 2019 Author Share Posted April 4, 2019 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 how_to_import_all_points.hip Quote Link to comment Share on other sites More sharing options...
anim Posted April 4, 2019 Share Posted April 4, 2019 - 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 1 Quote Link to comment Share on other sites More sharing options...
Midasssilver Posted April 4, 2019 Share Posted April 4, 2019 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. Quote Link to comment Share on other sites More sharing options...
Midasssilver Posted April 4, 2019 Share Posted April 4, 2019 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 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.