wedge random

   899   5   1
User Avatar
Member
27 posts
Joined: Oct. 2021
Offline
Hi Guys,
how to totaly random generation of several wedges?
PDG act like : 111 - 112 - 113 - 121 - 122 ...
What I would like : 213 - 132 - 312 - 233 ...
pic attached.

Thank you for help

Attachments:
Sans-titre-1.jpg (62.3 KB)

Wow factor
User Avatar
Member
27 posts
Joined: Oct. 2021
Offline
I'm still looking for a way..
How to add a random to @wedgeindex? I need to sort with random

any hint?
thank you
Wow factor
tamte
Member
6836 posts
Joined: July 2007
Offline
I don't understand why you need the workitems to be randomly sorted
they would be the same workitems since nested wedges create combinations, all new wedges for every input wedge
so if you have 3 nested wedges each producing 3 workitems (for simplicity with values like 0 1 2)
you will get in the end all combinations

000 001 002 010 011 012 020 021 022 100 101 102 110 111 112 120 121 122 200 201 202 210 211 212 220 221 222

and whether they are in that order or shuffled (like your picture suggests), they would ultimately produce the same 27 results

obviously those are just wedge indices, you can use them as seeds to randomize your results if that's what you are after
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
27 posts
Joined: Oct. 2021
Offline
Hi Tamte,
I will explain what I want, perhaps I get the bad way to do it!
I have 5 differents faces,5 differents tooths, 5 differents materials, this gives me 125 combinations. I use wedgeindex to sort this all, but I would like to give randomness to my sorting because topnet gives me face1 + teeth 1 + material 1 then F1+T1+M2 then F1+T2+M3.. It miss randomnes for me
Wow factor
tamte
Member
6836 posts
Joined: July 2007
Offline
WowNems
I have 5 differents faces,5 differents tooths, 5 differents materials, this gives me 125 combinations. I use wedgeindex to sort this all, but I would like to give randomness to my sorting because topnet gives me face1 + teeth 1 + material 1 then F1+T1+M2 then F1+T2+M3.. It miss randomnes for me
this doesn't explain why you want randomness in the order of your 125 workitems
- since if you want to compute all of them, then no matter in which order there will always be F1+T1+M1 among them
- if you don't need all of them you can always use Filter By Expression to filter just random amount of them to compute

- or is it because you simply want them to be generated in random order so that you have some random samples before the cooking is fully finished?
you can for example append Python Processor node at the end of your tree and do something like this in onGenerate
import random
random.seed(10)
items = upstream_items[:]
random.shuffle(items)
for i,item in enumerate(items):
    new_item = item_holder.addWorkItem(index=i, parent=item)
to shuffle the workitems, again, same workitems just different order
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
27 posts
Joined: Oct. 2021
Offline
Hi Tamte,
random order is axactly what I want!!!
Thank you very much !!!
Wow factor
  • Quick Links