(ambient electronic music)
- [Instructor] Hi there, I wanted to give a quick tutorial
on the max content graph or MCG.
What we're gonna do is take a piece of geometry
and put a modifier on it that will clone
that geometry between two points, interpreting the distance.
You can add any number of clones
and as you drag this around,
you'll see that it is creating those things
and updating them live so we can delete this
and show you how we built it.
You'll see this new scripting panel.
You can pop open this window here
and really this is a little node-based editor
where you can build modifiers or all kinds of cool stuff.
People compare it to ICE, it's not ICE
but it potentially could do a lot of the same things
and more down the line but this is the first release
and you can already do some really cool stuff with it.
So to start off I'm going to build a little cloning modifier
that will take a teapot and will put clones
between two points so we'll start off
by making a teapot here at the center.
'Kay, come on there, a couple of points.
(ambient music)
So the idea is that I wanna put a modifier on this teapot.
It's gonna clone teapots in between these two points,
control the amount of points
if you move these points around,
it'll always keep the same amount so it's gonna
interpolate the distance here,
it's gonna place these teapots accordingly
so once you've launched the max content creation graph here,
you can do new and here we go.
You've got all these operator nodes up here.
It can look kind of daunting but there's some cool features
where you can search for different things.
We know right off the bat, we're gonna need an output
and there's some different output types, output modifiers
since we're makin' a modifier
and we're gonna need an input too.
Let's do modifier (muffled) still in there
so Modifier TriMesh
so what this is gonna do is it's gonna bring the information
of this teapot here, when I put the modifier on there,
it's gonna pipe in information about the teapot
and then it's gonna dump it out into the stack
and affect that teapot just like a regular modifier will
so really what we wanna do is we wanna get positions
for these two points and we wanna do a linear interpolation
between them so let's start off by setting up those nodes.
There's a node called parameter.
You'll see the different parameters here.
I want a parameter Inode that allows me to select
within the scene another object so (muffled) these nodes
so we'll call these point one, shift drag this guy
and duplicate it and got a point two
and now this is dumping out a node here.
We also can do a validation check on these nodes
which is to say only run this thing if these nodes,
if you've selected these two nodes within the modifier
so you can search this here.
Check node validity, that's what we want, shift drag that,
grab another one of those and then from there,
we wanna take this node which holds information
about whatever's selected
and we wanna dump out its position
so we can do node position here.
I've got this little asterisk up here
which is like a wild card search, it searches for everything
so if you didn't start with, if I just wanted to type
in position, I'm gonna get everything that starts
with position, put the asterisk first,
I got node position here so let's drag one
of those guys out.
These different colors you see on the ins and outs
of these are different data types so nodes green,
vector here so that's a position of one node
and that's got that orange color there.
So now we've got these two vectors and we wanna interpolate
between them, figure out points between so there is a array
of lerp vectors under geometry.
This is gonna take these two positions, these two vectors
and a count, a number of them and it will place them
between so just like we had a parameter and a parameter
to bring in the two nodes and a parameter to bring
in the mesh that is the modifier,
we'll build another parameter for a count
so these will show up in the UI and you'll be able
to indicate how many of these teapots you want instants
in between there so let's do parameter again
so we have the different data types here, Inode,
this we are gonna wanna integer 32
so that's gonna be a whole number,
that way since we're talking about a number of clones,
we don't want point five clones,
we're just gonna want a whole number.
You can set a min/max, say clones,
this is how this will show up in the UI.
Min/max is a 100, let's do default three.
Okay, so now that we've got these two vectors and a count,
this is dumping out an array, this'll be, you know,
in this case if we do the default three,
there's gonna be three items in the array, one,
two and three, and there'll be three different vectors
that'll be the interpolated distances
between our two points here so what we wanna do
with that is we wanna combine that with the mesh
so the mesh basically instants the mesh on each one
of those positions that this thing is kickin' out
so we'll do a--
it'll have to be up here.
So something called the Parallel Combine.
That is gonna combine our mesh...
with the positions.
Before we can just dump the mesh in,
it's not quite the right data type,
we need to make an array of meshes too.
So we've got, as a default,
three positions, we need to build three meshes
we can throw in a array of.
(ambient music)
What this guy is saying is, "Hey, I'm gonna make an array of
this mesh," and its saying,
"hey integer, how many times?"
Quick tip: there's a little information down
about these notes here.
Creates an array that copies the given value n times.
So copy this mesh n times.
We'll use the same value we used for the number of clones.
Here.
So, this node is making a number of positions.
These nodes are making a number of meshes.
And we'll wire that mesh in here.
And then there's a function here that says,
"Hey, I've got a bunch of meshes, I've got a bunch
of positions, what's the relationship?"
so there is a offset mesh,
or offset meshes, not that that matters.
And I'll wire the function in here.
So, its basically going to offset these meshes
into these positions.
And then you see again, I can't quite dump that
array straight into the Trimesh, I need
one more node to be between there.
So there is another node called CombineAllMeshes.
Another way you could do it here is if I just
drag this one out, its gonna bring up a list of
only the compatible nodes that I can hook up.
Now, some of these are with the any data type
so there's a bunch, but it's searchable as well.
So I can do that asterisk CombineAllMeshes,
that's what I want.
So that is going to turn that array of meshes into
just a single mesh, and then I'm gonna dump it out here.
So now that we've got this flow here,
we just need to save it and evaluate it, and it
will show up in the modifier list as 'modifier'
so let's do a save as,
clone lerp on position, save that
under build evaluate.
There's a little information down here at the end
save, validate successful.
Okay.
I'm gonna close this for a moment, and let's
apply this thing.
So we've got our teapot here, and
if I can go into the modifier stack, there's that
clone on lerp2, and what this guy is looking for
is two points and number of clones.
So we give it point one,
we give it point two, and there we go.
(muffled)
So we've got-- the default was three,
we've got three clones there, we can crank up
that amount to put more clones and if I
move one of these points around,
you'll see that its going to keep that same amount
and it's just gonna change the distance between them.
It's gonna interpolate how big that distance
is and spread them evenly.
So one of the really cool things about MCG is,
unlike the modifier stack where a modifier
kind of is what it is and you can use it,
and the functionality is set, with MCG,
you can go back and you can grab somebody else's
tool and you can change the functionality, add something
if it's not quite meeting your specific needs.
Somebody had made the suggestion of with
the teapots that are interpolated between the two points,
why don't you make them all point at one of the points,
so we'll just grab the rotation.
And the way we could do that is,
there's probably a lot of ways you could do that,
but the way that would be pretty quick would be
to kind of hijack the mesh as it's leaving this
implicit parameter modifier Trimesh and rotate
them all before we make the array.
So how we could do that is we could drag this
input out here, and let's see what we got for rotation,
RotateMesh, that sounds good.
And then from there, pipe this Trimesh back in here.
So we now have this in between those two and we have
to figure out how to get what is that rotation that look at.
So let's bring these over here to make some space
and we'll kinda work backwards in figuring out
what we can do to get that LookAt rotation.
So we know we need a plot here, so qat.
(ambient music)
Quaternion for rotation matrix sounds good, so
now we know we need a rotation matrix, so lets
work backwards from there, do our little search feature here
and we're searching LookAt, 3ds Max LookAt Matrix,
that sounds promising.
Okay, so this is looking for an up vector and the LookAt.
For the LookAt, we could just pick our point number two
so it'll all-- all the teapots should look at the
second point, and for an up vector,
let's just make another node for that.
I'll grab all these nodes and if I hold 'shift,'
they all come over together.
And once again, make the little space for these guys.
We'll plug it in here and instead of calling that
'point one,' we'll just call that 'up node.'
And let's check that out, so do a save as,
we'll call that tool 'Cloneonlerp_rot' or rot for rotation.
Save that guy, evaluate it, and let's look at Max here.
Okay, so, back in the view port, we need a teapot here,
I'll move that to zero, we also need some nodes,
we need kind of a point one, a point two, and this
third-- what we'll call up node, and move that
up a little bit.
And then on our teapot, we can place that modifier.
It shows up now in the modifier list.
We'll pick our up node,
we'll call that point two and this one point one.
And there we go, we got a bunch of nodes, or
a bunch of clones, rather, in the view port.
And as you can see, if we rotate this around,
they're always pointing at that first node.
(ambient music)
Thanks for checking out the tutorial,
we will post the MCG files and
can't wait to see what you make with it.
(ambient music)