
Add random 90 degree rotations to all MASH objects. To use the code, simply copy and paste it into the Python node.
The below variation will give you random Y rotation, you can use the same idea to adjust the X and Z rotations as well if you need to.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
import openMASH import random #initialise the MASH network data md = openMASH.MASHData(thisNode) #this is how to get the frame number frame = md.getFrame() #and this gets the number of objects in the network count = md.count() random.seed(0) #add the index to the Y position for i in range(count): multiplier = random.randint(0,6) rot = 90*multiplier md.outRotation[i].y=rot #tell MASH to write the network data md.setData() |
nice. Thanks