Jump to content

attribute propagation


Recommended Posts

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.


 

attr_promote.gif

Link to comment
Share on other sites

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

  • Like 1
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...