- [Instructor] Nuke's trilinear node
is what is referred to in other software
as a deformation lattice.
In Nuke, it's simply a wire-frame cube
that surrounds the geometry
and as the wire frame is deformed,
so is the geometry inside.
It's rather like the corner pin node for 2D images.
Let's see how it works.
So we'll push in here to my geometry,
I will select 3D, modify, trilinear.
So the first thing it does is oddly enough,
squishes it into this little cube right here.
So to fix that, all we have to do
is come up to the property panel
and click reset shape to input.
And everything is back to normal.
One wonders why they don't open with that
but okay, that's the way it is.
This row here are your key frame controls,
we'll come back to them in a minute.
These of course are the XYZ coordinates
of each individual point.
So if I grab this point here,
you can watch the XYZ data changing as I move it around.
You can also of course come in here and pick those
and start moving them yourself.
So let's reset shape to input, right back to normal.
Now if you just start grabbing points
and moving them around in the perspective view like this,
you're going to run into a problem.
If I drag this point and just pull it over here,
I have unfortunately moved it on two different axes
at the same time so this is usually not what you want to do.
So let's reset him back to normal.
What you want to do is switch to an ortho view
like say type Z on the keyboard to get your front ortho.
Now I can grab a point and move it
and it'll only be in the XY plane.
Okay, we'll go back to our perspective view
and we can see that it has not gotten
out of the plane of the front.
So back to our ortho view, reset shape.
If, however, you drag a rectangle,
it's now going to select both the foreground
and the background point.
We can pull that there,
switch back to our perspective view,
and see the fruits of our labor.
Tragically, the trilinear node
does not offer a transform box.
If you select a bunch of points,
they're going to move all in unison but you can't do a rotate
or a scale or any of the nice things we can do
with our normal point picking transform boxes.
Oh well, such as it is.
Okay, so let's go back to our ortho view
and reset the shape to the input
so we can take a look at some of this
key frame stuff up here.
I'm going to jump to the first frame
and I'm going to grab these points here
and pull them up and those points there and pull them up.
And I'm going to say set key so now you can see,
I've got key frames on all my control points.
Let's jump to the middle
and I'll hit the reset shape to input
and he of course snaps back to the original shape
but I have key framing on
so I've got the key frame animation going on here.
Now a very important feature you need to know about
is this copy and paste.
Here's what that's about.
Let's say that when I get to the end of the shot,
I want it to have exactly the same shape
as it had at the beginning.
Okay, so, I can go to the beginning,
I can do a copy on those control points,
jump to the end, and do a paste.
And now, I have got a perfectly symmetrical,
repeatable, loopable animation.
Okay, there we go.
Now, if you want to delete a key,
go to the key frame of course and click on delete key.
And now I've lost my key frame there
but I've still got the other two
but they are in the same position so they don't go anywhere.
Okay, one other technique you might find helpful,
let's reset our shape to input
and let's delete all animation
so we're back to basically a starting condition here.
What we can do is we can bring in an axis, for example,
and then I can link that, this is point two you can see.
Whoop, I've got two of them selected.
Let me undo, let me just reset back to default.
I accidentally grabbed two points.
I'm going to grab this point here.
Okay, this is point two, you see P2 moving right here.
So if I hook the axis up,
I want to actually preposition this guy up here.
If I link the axis to P2, point two, boom, okay,
and now I can move that control point using the axis.
Which means I can now use axes connected to the points
that are hierarchically linked to other axes
and I can start introducing some hierarchical animation,
get me a higher level of control
than just dragging one point at a time
around in three space.
Okay so let's drop the axis guy here
and we're going to completely reset this node
and reset the shape back to the default input shape.
I want to show you the source box tab.
This is interesting, we'll click on that.
Now, by default, this is disabled.
It says use the incoming bounding box.
If I turn that off, this odd thing happens.
This red box is actually analogous,
again back to the corner pin node
where in a corner pin you have a from and a to.
The red box is the from, the white box is the to.
So, if I click reset source box to input,
we get this red box which has completely surrounded
my original white box and it's got just two control points,
this one here and that one back there.
Remember, the red box will be the from
and the white one will be the to.
So using just those two control points,
I can resize the from, if you will, like this
and what has happened is my creature has now become smaller
than the original deformation lattice.
I could go the other way, of course.
So you can use this as a from
and then you can return back over to here
and now my geometry's been essentially scaled down
inside my deformation lattice
and I can start moving my trilinear points around
and having a wonderful time deforming my geometry.
As we saw, the trilinear node can only deform
3D geometry in simple ways.
I've found it to be most useful as a fudge factor
when the geometry does not quite fit into the scene.
A few small adjustments with the trilinear node
and the geometry fits perfectly.