Valent Posted July 5, 2018 Share Posted July 5, 2018 Hi, noob here) How can I transfer the value of an attribute from one point to every other point of the same polygon island? I've found a way to do it but I think there should be a cleverer way to do it) for now, I'm applying 'attribute_blur' with a quite large radius to get at least a fraction of the attribute needed onto every point of the same polygon island, then I multiply it (by some insanely large number) and clamp the result between 0 and 1. Quote Link to comment Share on other sites More sharing options...
davpe Posted July 8, 2018 Share Posted July 8, 2018 hi, your solution is working so its good to go i guess more "clean" would be to use loop "For each connected piece". in this specific case, you'd promote maximum color of any given piece to Detail attribute (thus any given point on that geometry piece will inherit the brightest color present on that piece) and then promoting it back to points. and that's it. you can also go with vex and arrays if you want - that would likely give you better performance for massive meshes and probably also better if you wanted something more complicated: create a detail array of all point colors, then get an item with maximum value in the array, set that to Cd and promote to point. loop this over each poly island. the wrangle code would look like this: vector colors[]; for(int i=0; i<@numpt; i++) { vector item = point(0, 'Cd', i); insert(colors, 0, item); } vector x = max(colors); @Cd = x; check the attached scene file if you need working examples. cheers, D. attrib_propagation.hiplc 1 Quote Link to comment Share on other sites More sharing options...
Valent Posted July 10, 2018 Author Share Posted July 10, 2018 Thanks! I like the VEX pipeline a bit better, I still have a lot to learn there, though. Is it possible to do it in VEX without using "for_each"-loop? Quote Link to comment Share on other sites More sharing options...
davpe Posted July 10, 2018 Share Posted July 10, 2018 well, i dunno, possibly it is doable without loop too... certainly there is more than one solution i suggested. would likely be more complicated thou. 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.