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()
I'm in the same situation. The previous python script doesn't work any more. Not sure how to constrain objects to 90 degree rotations in Mash.
I remember the good old days when Duncan would just throw out some technique that I had never thought of.
Make sure to add the script via the Python node in Mash. Just tested it and it works for me. Sometimes to you have to toggle the Mash mode off and on to see it though.
this is working for me. What objects are you rotating with this?
Can you zip up and attach a scene file please?
with the bldgAnim_v05.ma scene file I am seeing the effects of the python code successfully.
I really appreciate all the input, it's strange that it's working for some people but not for me.
I tried opening the MashRotate.mb file, but don't see any change, even when switching Mash off and on and hitting play on the python node.
I'm using Maya 2022 btw, anything I could be missing here?
try renaming/deleting your Maya preferences to set it back to factory defaults.
No change.
I've been deleting preferences for over 20 years now, I think it's solved a problem only once. I suppose it's like the turning it off and on again IT thing 😉
I don't have a video capture, but the easiest explanation is
1. open the scene MashRotate.mb posted above
2. see that there is no rotation as seen in the image posted by Parminedes
3. Try turning the Mash waiter off and on, turning the python node off and on, hitting play on the python node.
4. no effect
you can download obs (an open source screen capturing software available on all platforms with no time recording restrictions) if you're interested.
I tried all of that and am experiencing no issues what so ever. Did you edit the py code at all and forget to revert the change? What happens when you change the value from 90 to 120 and then back again?
Is cache playback on or off?
Try running `ogs -reset`;
If Mash does not work for whatever reason, you can also use Bifrost. (Btw I opened the Mash file and it also works for me).
here's an example of me trying to use the Mash file, am I doing anything wrong?
Can't find what you're looking for? Ask the community or share your knowledge.