Starting in Maya 2016 extension 2, you can use Maya’s integrated MASH toolkit
to apply all sorts of procedurally animated effects to reproductions of objects.
In this movie, we’ll show you how to create the pixelated globe for our futuristic UI.
Before you can start using MASH, you should make sure the MASH plug-in is loaded.
In this tutorial, we’ll build all our MASH effects out of a simple cube,
which we’ll create via the Polygons shelf.
Although you can create a MASH network using any object,
a cube is simple and will ensure the best performance.
Let’s create our first MASH network by selecting it and going to
Create > MASH > Create MASH network [].
Clicking the small box brings up the MASH Options.
Take note of the Geometry Type.
You can either create instances, in which case Maya will draw our cubes
as though they exist in the scene without them actually existing,
or actual Mesh reproductions,
in which case Maya will create actual copies of our original cube.
The former is better for performance but is not as versatile as the latter.
Since our basic shape is so simple and shouldn’t incur too much of a performance cost anyway,
make sure this is set to Mesh.
As you can see, Maya has turned our one cube into ten, and spaced them out neatly in a line.
This is MASH’s default distribution.
To modify this, open the Perspective / Outliner view.
The Outliner provides us with a list of objects in our scene.
As you can see, this includes the MASH network’s “Waiter”,
which acts as the hub for all its effects.
To see what kinds of effects we can apply to this network, open the Attribute Editor.
The Attribute Editor shows you all the options and related objects
to whatever you currently have selected.
In this case, it shows us the various effects you can apply to this MASH network
because we have the Waiter selected.
Each time you apply one of these effects to your network,
imagine it as though you are adding another node to a stack.
The order and combination of the effects determines the final look of the scene.
You can find a list of what each of these nodes does in the Maya documentation.
You can also see what effects are currently being applied,
via the tabs at the top of the Attribute Editor.
Notice that our network already has a Distribute node applied to it.
MASH always adds one of these automatically,
because it needs to know the manner in which the objects (in our case the cubes)
will be laid out in the scene.
Maya also automatically added a Color, Time, and Repro node.
These are specific to the Mesh Geometry Type we chose earlier.
Although they are important, we won’t need to modify them.
For now, just click on the Distribute tab.
Here you can see all the settings related to the way our cubes our distributed.
In particular, note that it’s generating ten points in a straight line,
spaced such that their total length is 20 units on the X axis.
You can of course change these settings to affect the linear distribution
by changing the number of points, which axes to distribute along,
or even adding some scale or rotation further along the distribution.
Or you can change the Distribution Type for an altogether different effect,
such as radial, spherical, and so on.
Each of these has their own sections and distribution-specific settings.
Some, like Radial and Spherical,
work on the number of points you currently have in the scene…
…while others, like Grid, require that you input specific dimensions instead.
However, all of these are affected by the options in the Strength section.
Notice how adjusting the different strength sliders
changes the Distribute node’s effect on our cubes, either all at once or individually,
to produce some pretty neat results.
Now that we’ve gone over the basics, let’s use MASH to start creating our UI,
starting with the representation of Earth at its center.
If you look closely, you’ll notice that the Earth in this example is made of cubes,
just like the distributions we’ve been working with.
To recreate it here, we’ll create a sphere and then “stick” the cubes to it
in the shape of the continents using a 2D picture of the world.
Create a sphere by clicking the sphere icon in the Polygons shelf.
The reason we can’t see a sphere yet is because it’s too small,
so go to the pSphere1 tab in the Attribute Editor to scale it.
Let’s make it 40 times larger.
Now select the MASH waiter node in the Outliner again.
This time we’ll go with a Mesh Distribution Type,
which allows us to use a helper object to manage the distribution.
You might be wondering why we didn’t just choose a Spherical type.
This is because a guiding mesh will give us better control over the precise distribution,
as you’ll see in a moment.
For now, scroll down to the Mesh Settings section.
We need to tell MASH to use our new sphere as our guide,
so middle-drag it from the Outliner to the Input Mesh section.
If you look around the sphere you can see that cubes are now sticking to it,
and even if you add more points the new cubes will as well.
However the distribution is random because our Method is set to Scatter.
Instead, change it to Face Centre.
This puts a cube at the centre of each face on the sphere,
which you can see better if you turn on Maya’s Wireframe on Shaded mode.
We clearly need to increase the number of points to cover the whole sphere,
but rather than just guess at how many we need, we can just turn on the Flood Mesh option.
This automatically puts a cube at the centre of every face.
Without even mapping out the continents yet,
it’s pretty clear that this isn’t going to be enough cubes to map out much of anything.
We need to drastically increase the number of cubes in our distribution.
Select the sphere again and this time go to its polySphere tab in the Attribute Editor.
This is where all the settings for the sphere are located.
Currently the sphere is composed of 20 faces around and 20 faces up.
Change this to 140 and 100 respectively. Now you have many more cubes to work with.
The last thing we need to do is map our continents
by hiding any cubes that would represent water.
Select the MASH waiter again and go back to the MASH tab.
Since we need to hide cubes, we’re going to add a Visibility node to our network.
If you adjust the sliders you can see that we can make the cubes randomly visible or via their ID.
But to hide them in the specific pattern we’ll need to use a Strength Map.
The Strength Map field allows us to assign a shader
to control the strength of our Visibility node’s effect.
Think of it like a drawing where anything white will appear visible,
and anything black will appear invisible.
To assign such an image, click the button next to the attribute.
In the Create Render Node window, select File. This connects that attribute to a new file node.
To assign the file that this node will represent, click the folder icon next to Image Name,
then select the black and white world map included in this tutorial’s scene files.
The pattern of cubes on the sphere definitely changes,
but this doesn’t look anything like the Earth.
That’s because MASH isn’t sure how to apply that 2D image to this 3D object yet.
Select the MASH Waiter again and go to the Visibility node.
Just like we’re using the sphere as a helper object for the cubes’ distribution,
we’ll also use it as a helper for their visibility.
So middle-drag the sphere into the Map Helper field.
Now you can see that the cubes fall in line with the world map.
To make it even clearer, turn off Wireframe on shaded,
then select the sphere in the Outliner and press Ctrl + H to hide it.
This leaves you with a floating pixelated globe.
Note how easy it is to change.
If you select the sphere in the Outliner and increase the number of faces,
the MASH network updates accordingly.
You can also go back to the MASH network’s Distribute tab
and play with those same Strength values we tried earlier to get neat effects quickly and easily.
That’s a good start for now.
In the next movie, we’ll show you how to layer a plexus sphere and ring over this globe.