Hey everyone! Welcome to the Maya Learning Channel
Today we’re going to take a look at MASH dynamics,
which is a new feature for Maya 2018.
Now, if you’re new to it,
MASH is what's called an "instancer." That is, it's a tool that replicates a base object
many times over, and then makes it easy to animate those replicants into patterns.
You'll see this a lot in motion graphics, where even simple things like cubes and spheres
can combine into some pretty gnarly patterns.
We already have a bunch of videos on that stuff in our Motion Graphics playlist,
so today I want to tackle a different problem.
While instancers are great for animating things that move in regular patterns,
a lot of things don't move in regular patterns.
Often times, physics can play a large role too.
Traditionally, trying to capture this "nuance of chaos"
has been slow and complicated - both in terms of performance and understanding.
Honestly, it sometimes feels like you need a math and science degree just to do this stuff.
Thankfully, with MASH dynamics, this just isn't the case anymore,
and I'm going to spend the next few minutes showing you why.
So rather than show off any particular effect today - which I'll leave for later tutorials -
I'm just going to focus on how to setup a dynamic MASH network and get things interacting.
First I'm going to start by creating a basic cube
Then I'll adjust its base color to stand out in the Viewport.
Next, it's always a good idea to switch over to the MASH workspace
since it's specifically laid out for working with MASH.
Now, with the cube still selected, I'mgoing to click this button on the MASH shelf
to turn it into a MASH network.
That'll hide our original cube anddisplay a bunch of reproductions instead
and also put a new MASH network in the MASH Editor.
You'll notice right off the bat that MASH arranged our cubes in a straight line
but I can easily change that here in the network's Distribute node.
To recreate the big cube from the intro though, I'm gonna go with a grid distribution of smaller cubes.
Once that's done, making them dynamic is really just a matter of adding a dynamics node.
That's it. If I play the scene now,
the cubes fall down until they smash into the default ground plane.
Just give me a second to bump up the total frame count.
There that's better.
So what does this actually do?
Well, first it adds a dynamics node to the MASH network,
which is where you can change a bunch of thecubes' physical properties.
For example, I could make them really bouncy.
Or a lot less slidey.
But if I go back to the Outliner, you’ll also see that there’s a new BulletSolver there too.
This is the node that represents the dynamic forces acting on these cubes.
So in here is where I can affect things likeGravity, ground position, and so on.
I'm gooing to use it now to move the ground up closer to the cubes.
See the difference?
This is also where you can add colliders to havethe cubes interact with outside objects.
So suppose I wanted to animate a sphere running into our stack.
I'd start by first creating my sphere.
Then all I need to do then is middle-drag it fromthe Outliner to the Collider Objects field.
This'll make the BulletSolver aware of the sphere, so that if we animate it...
...then the two will smash into it each other, just like we'd expect.
What's cool now though is that if I go back and play with the shape of the collider like this,
MASH will actually adjust the collision on the fly.
Let's try big and skinny and see what that looks like.
Cool.
Double-clicking a collider in the list will also bring you to that object's node,
where you can adjust its dynamic properties too.
So maybe I can try making it a big bouncy wall.
Well, I could've probably made it bouncier than that but you get the idea.
For now, I'd like to move on to constraints.
Constraints are a way of limiting the way yourMASH objects move.
To create one, just go to the Dynamics node and right-click on the Constraints field.
So if you look here, you can see that the default constraint glues each cube
to their five nearest neighbours within this Search Distance.
And sure enough, if I play the scene
some of the cubes stick together.
Those connections are shown visually with these yellow lines.
So if I expand or contract that distance, the yellow lines should change.
That's a little difficult to see though, so let me try tweaking the grid a little.
Okay, this is better. So now you'll notice that there are no connections between columns
because they're too far away from each other.
But if I play the scene, the cubes that are close enough still stick together.
Of course, that's not the only kind of constraint.
A spring constraint is like a glue constraint, except with stretchier connections
So if I just rearrange my cubes into a single standing lattice.
And then go back and enlarge the Search Distance again
until those connections come back.
We get more of malleable a net effect.
I could also connect them to offset points instead of to each other.
Let's say, 5 units above?
That would get me something like a hanging beaded curtain.
Or alternatively I could lay them flat.
Maybe raise the offset a bit.
Maybe a little more.
Or if i just wanted to shift the entire network up, I could add a Transform node.
That last point is actually key, because one of MASH's biggest strengths is its ability to
keep layering on effects by adding or changing nodes on the fly.
So in that sense, dynamics is just another tool in that arsenal.
That lets me do something like say, disable the constraint...
...then add a Signal node - which is a sort of animated mathematical noise.
I'll just expand this out a bit.
Then I'll bring the scales down a bit
Which'll get me a nice wave shape.
And then I'll just remove the sphere.
Of course, playing this just causes everything to fall down due to dynamics.
Only by turning off the Dynamics node can I see what the signal is supposed to look like.
Ideally, I'd like to have this movement while keeping the cubes dynamic,
and thankfully I can do just that using the Dynamic node's MASH Bias.
This controls how much influence the BulletSolver has on the cubes
versus the rest of the MASH network.
So if I just crank the Position Strength, but leave the Rotation at 0, then I'll get my
signal animation back, except the cubes will spin whenever they collide with each other.
And like I said, MASH's key strength is that I can just keep playing and experimenting.
Even going back all the way to the first decision we made,
by changing the Distribution back to Linear.
Then I can change the type of signal animation from 4D Noise
to something based on Trigonometry.
Let's just disable the ground plane so it doesn't get in the way.
That gets us something a little more atomic-looking.
Or I can re-activate the constraints.
Maybe shorten them up a bit.
And that gives me a bunch of swinging cubes in the same pattern instead.
Although the cubes still look a little stiff,
so let me take a look at the Spring options.
First thing I can do is increase their range of movement.
Also, the axes they're allowed to move on are quite limited right now,
so I'll just give them full range of motion for both position and rotation.
That'll free them up to swing a lot more,
especially since we made them so bouncy.
Actually I think this will look better in a more horizontal arrangement.
And I think the last thing this could really use is some trails.
I'll just widen them out...
...and then flip their normals to face the camera.
Actually let's change colors too.
So I'll right-click and Assign New Material.
And just use a Standard Arnold shader.
And maybe make it red.
Okay, that's enough tinkering for now.
Let's just output this to see how it looks rendered.
So first I'll add an Arnold Skydome light.
And I guess I better add an Arnold shader to the cubes too.
This time I'll make them blue.
Now just zoom in and hit the Render button.
And that's it. Thanks to dynamic collisions, we get all these fun spirals
and other tail configurations that we wouldn't ordinarly get.
Of course, that being said, this is still a fairly simple example with only four nodes and cubes,
but you can imagine all the cool things that you could do with this.
The best way to find out is to just get in there and play around,
and be sure to post your creations in the comments below!
Otherwise, keep it locked to the Maya Learning Channel for more videos on
specific dynamic effects, and other Maya workflows.