Jump to content

How to shuffle attribute values without repeating values.


Latimerias

Recommended Posts

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 by Latimerias
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...