Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Posted this a few weeks ago but no responses. Didn't realize there was a specific programming forum.
Previously when you needed to increment 90º in Mash you could run this python script below. But I guess that the updated python has broken it. (Error: object does not exist.) Can someone with python experience update it?
I know there is a way to rotate using the offset tool as well but it breaks down when you get to thousands of tiles and the noise doesn't control it finely enough.
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()
Thanks.
Solved! Go to Solution.