(soft music)
- [Narrator] What you see on the screen here
is a flow called Push Limited,
built by 3DS Max Ninja and living legend Martin Coven,
applied that to some geometry,
and as you see there's some kind of interaction there.
What we're gonna build today is just a traditional push,
recreating one of the Max modifiers in MCG
just to get an idea of how the data flows
through the system.
So here in Max we have a tora shape,
and we'll throw just a traditional push on there
to see what it does.
We're all familiar with this, pushes along the normals.
So what would we do if we wanted to build this in MCG?
We'd need some information about the mesh,
we need some vertices and some normals.
We'll do a little math and make a MCG modifier,
and we'll recreate this.
So to open MCG, or Max Creation Graphs as it's called,
you open the scripting panel and you pop this open.
With the Max Creation Graph open,
I want to give a quick, brief rundown
of what some of these different
components are in this UI here. So in the upper right here,
you've kind of got this nav where you can move around,
but on the left here you have all your nodes
and there are some compounds in here as well.
We'll get a little more into that in a sec.
On the bottom here is a description,
so if you were to roll out one of these categories
for nodes, like parameters for instance, parameter single,
a parameter of a non-compound graph of single type.
So it gives you a little bit of information
and a signature, which it can be handy,
it's like a data signature.
Especially when information's flowing through a node,
it's nice to know hey, it wants this kind of data in,
it's kicking this kind of data out.
On the bottom right here is a message log.
When you evaluate these tools,
it'll either tell you that it successfully evaluated
and then it's gonna be a tool you can use as a modifier
or a utility or any number of things in Max.
Or if it fails because something isn't hooked up right,
it sends you some kind of
cryptic explanation in computer speak.
I believe this is being worked on to be a little more clear,
but as it is now, it's better than nothing.
It can give you an idea at least where you're fallen down.
So that's kind of the basic idea of the UI.
You can open graphs, you can save graphs,
under build is evaluator, Control E.
Has a nice search feature where you can type in mesh,
and these are all the nodes that start with mesh.
If I do an asterisk first,
these are all the nodes that just have mesh in their names.
So this one starts with node, mesh and local space.
I won't pretend to know what all these different nodes are.
There are hundreds of them,
and I'm just scratching the surface and figuring them out.
But what's cool is a lot of people in the community
can start making and building up different nodes,
and we can see what other people do
and kind of reverse engineer from there.
So briefly to kind of give an idea
of the hierarchy of what's going on here,
so we have nodes.
A node can do some math,
it can change a data type as in,
for instance, this is a vertex normals node.
It wants mesh information,
and it's gonna kick out an array of normal.
So vertex one, normal is gonna be a vector.
Three numbers of the direction that that vertex is pointing.
And it'll make a ray for every vertex
in a piece of geometry.
So a node is a low level building block.
If you have a combination of nodes,
you can combine them into what is called a compound.
So for example, they're shown in this kind of purple,
magenta color, so this is a compound called white.
If we were to open up this compound
and see what's happening inside of it,
there is a vector three
and float one is being piped into X, Y and Z.
So you can think of these as RGB is 111,
000 would be black, 111 is white,
and then that outputs white.
So we see this output here,
that would just be kicking out 111 of vector 111.
You pipe it into the color, it's gonna give you white.
There's no, instead of this being just a constant float
being piped in here, we also could put a parameter in there
and then those are the things that show up in the UI
that you could actually plug in your own RGB values
if you wanted to give the user control of that.
So compound, a bunch of nodes
packed into a nice tight package here.
It just keeps big graphs a little simpler to see.
From a compound is a tool.
This tool consists of,
you can see there's some compounds here
and there's just some nodes,
and these ones with the brown here
are parameters where we're either bringing in geometry
or we're allowing the user to input some information
that then these become variables.
And control various aspects of your tools.
So tools are kind of, like a tool could be a modifier,
you could put it on an object.
These are really what you're gonna be
building up from nodes and compounds.
Then to go one bigger is the packaged MCG Graph.
Once you build a tool and you want to share it
or you see a tool online
that you want to download and play with,
you can take this.
I think of it as being a tool that's been zipped up
and all the components you need are all in that zip,
so they all unpack,
because some user may be making compounds
that you don't have.
The packaged graph puts everything in one place
so it all unzips and you have everything you need.
I think about it a little bit like in Max,
if you save archive,
it saves all the dependencies in one place,
or like aftereffects collect, saves everything you need,
so it makes it a little easier to pass that on to people.
So this is a blank slate.
Now we're gonna do a modifier,
so we need to pull in a couple nodes here.
Output modifier, that will dump the resulting information
back into the stack.
As well as we need an input.
And modifier tri-mesh input, so that brings it in.
So you get your input, your output,
and the math happens here in between.
So we know from our tri-mesh
we're gonna need the mesh vertices, so pull that in.
And we need the normals.
What we want to do is run a function on these.
Essentially, we want to multiply the vert position vectors
by a parameter, and then we want to add that to the normals
so that each one of those vertices
moves outward along the normal.
So we can bring in another parameter here
that will be our push value.
For this we're gonna do a parameter single,
which is going to pump a float value into our flow.
So let's do a minimum of negative 100, max 100,
default zero is fine.
And then from there we want to do a multiply by scaler.
So if we were to do this alone,
to just multiply the mesh vertices by scaler,
that essentially would scale about its origin.
But then from here we want to add
the vertex normal vector,
and that will then give us the push
in the correct direction,
so these two numbers here are going to pump out a function,
and we will combine the mesh vertices
and the mesh normals by this function.
So essentially what this is doing
is taking the scale vertex position vector
and we're adding the vertex normal vector,
and adding the two gives the vector a direction
while scaling here gives it a magnitude.
So this is gonna push it,
this is going to give a magnitude,
this is the direction that it's flowing in.
From this parallel combined,
we can't just dump this right into the output modifier,
so we need to set mesh vertices.
This wants an input of that original tri-mesh.
So it's saying hey, I've got this mesh.
And I'm going to dump out a new set of vertices
that have been multiplied by this,
added to vertex normal,
and then this combined node will transform the array
by this function here.
So we'll dump that tri-mesh back out
into an output modifier.
We can do a save as here,
call this MCG push.
We then evaluate,
and then it will show up in our modifier stack.
So if I pull down the stack here,
we should have something called MCG push.
There it is, sure enough.
Push in the positive, it pushes out,
and if I push into the negative, it shrinks down.
So as a quick overview of what we were doing in this flow,
we start out with this modifier, brings in the tri-mesh,
we get an array of vert position vectors,
and we get an array of normal vectors
with these two nodes here.
From there, this argument
of the array of mesh position vectors
is passed down to this multiply by scaler,
and we multiply vert position vectors by a parameter scaler.
So if we just did this, we would be scaling,
essentially, the geometry about its origin.
From there, we take an argument from the vertex normals
and we add that to the multiply by scaler.
So taking the scaled vertex position vector
and adding the vertex normal vector
gives us a direction in which to push those vertices.
Both the mesh vertices and vertex normals
that have been transformed by this function here
are then dumped into this parallel combine,
which is gonna kick out a new array
of the new positions of the vertices.
Then we put a set mesh vertices note in there,
which takes the tri-mesh that is passed in by the modifier
and sets these vertices as defined by this array.
That then dumps out a new mesh, output modifier,
then kicks out and you see it happen in your view port.
So that's just a quick demo of a basic Max modifier
that has been reproduced in MCG.
There's a lot of potential
to take these modifiers and extend them.
Some of the samples I was showing early on
with the Limited Push are some examples of that,
and once I get my head wrapped around this a little more,
I'd like to do a demo of it as well.
(soft music)