Community
Maya Forum
Welcome to Autodesk’s Maya Forums. Share your knowledge, ask questions, and explore popular Maya topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Rotating in 90º increments in Mash

12 REPLIES 12
Reply
Message 1 of 13
Parmenides
290 Views, 12 Replies

Rotating in 90º increments in Mash

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()

 

12 REPLIES 12
Message 2 of 13
support
in reply to: Parmenides

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.

Message 3 of 13
Parmenides
in reply to: support

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. 

Message 4 of 13
syracoj
in reply to: Parmenides

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.

 

Message 6 of 13
support
in reply to: Parmenides

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?

support_0-1724947722788.jpeg

 

Message 7 of 13
syracoj
in reply to: Parmenides

try renaming/deleting your Maya preferences to set it back to factory defaults.

Message 8 of 13
support
in reply to: Parmenides

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 😉

Message 9 of 13
syracoj
in reply to: Parmenides

can you post a video of the workflow along with the failure?

Message 10 of 13
support
in reply to: Parmenides

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

Message 11 of 13
syracoj
in reply to: Parmenides

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`;

 

Message 12 of 13
sepu6
in reply to: Parmenides

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).

 

 

 

maya_d3bRCpYNoS.png

 

 

 

Message 13 of 13
support
in reply to: Parmenides

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.

Post to forums  

Autodesk Design & Make Report