Latimerias Posted September 21, 2021 Share Posted September 21, 2021 (edited) If I've got a list of objects which ill called boxes and each box has a connectivity attribute on it so box 1 has 6 prims each with a attribute 'class' and value '0', box 2 has value '1' and so forth like normal. My question is how can I shuffle these parameters in a random way, by which I mean mix the values in the list that so box 1 may now have a 'class' value of '1' on every one of its prims and box 2 now has value '0', I need this to be random. I've tried using the sort SOP but that didn't get me very far as it created random values for every primitive when I need to retain the connectivity different. I also tried shuffling the values by creating a primitive wrangle to create a random number, fit it between 0-#objects and assign that value back to the 'class' value but then i get repeating values where box 1 has a value of '0' but then box 4 also has a value of '0'. I am thinking next of trying to do an uniqueval function, randomize that then remap to geometry but I am not sure of how I can randomize/sort detail attribute values so if anyone has any idea I would greatly appreciate it. Edited September 21, 2021 by Latimerias Quote Link to comment Share on other sites More sharing options...
Aizatulin Posted September 21, 2021 Share Posted September 21, 2021 Hi, you can extract one point per each class and generate random attributes on the points. After you've applied sort on the points you can map the result back onto the classes. random_class_sort.hipnc 1 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.