- [Instructor] Let's talk about managing materials
in the material editor graph
versus the materials in the 3D scene.
The key concept here
is that there is no direct relationship
between those two.
Just because a material exists
in the material editor graph
does not mean that it's assigned
to an object and vice versa.
Just because the material is on an object
does not mean that it's loaded into the graph.
It's important to understand
this fully to avoid data loss
when periodically clearing out the graph by deleting nodes.
let's organize our view
a little bit make this easier to see.
At the top right of each node
is a minimized button.
We can click that to collapse that node.
And we can do that for multiple selected nodes.
I've got kind of a complicated setup here in my graph.
If I dolly back
with Control + Alt + Middle mouse,
I've got quite a few nodes here half dozen or so
and I want to make this easier to read.
So I'm going to select all of these and then minimize them.
We can go up to the select material editor menus
and choose Select, Select All,
or use the keyboard shortcut which is Control + A
Once all those have been selected,
we can go into the View menu
and choose Open/Close Selected Nodes.
And now they're all minimized.
Additionally, I can rearrange the graph.
We have some buttons up here on the toolbar.
We've got Lay Out All - Vertical.
Click on that and all of those nodes
will be arranged in two rows.
So we have one row for this material
and then another row for this other material.
Or from the fly out here, we could choose
Lay Out All - Horizontal.
And that's going to arrange all the materials in columns.
I have one column here,
and then over here I have another column
for this material which does not have any maps.
So it's just a single node.
Okay, I'll go back to Lay Out All - Vertical.
We can also increase the size of the preview
and that'll make it a little bit easier
to read this graph and get in close
with Control + Alt and Middle mouse
and pan with Middle mouse.
All we have to do is double click on the preview.
Not the name, but the image.
Click on that little preview.
And now that's taken up most of the space
of that node and we can do that here
for this floor material as well.
All right, I'll deselect everything
and the then just go back to selecting a single node.
Now, both of these materials,
the floor and leather cream rough,
these two are both instanced into the scene.
For example,
If I change the base color weight
for leather cream rough.
If I bring this base color amount down to zero,
then I've essentially disabled the diffuse component
on that sofa object.
That's because the material is instanced in the scene.
But kind of paradoxically,
if we delete an instanced material from the graph,
we actually don't change the scene.
Okay, I'll set my base color back up to one.
(keyboard clicks)
And then if I select this node
and press the Delete key on the keyboard,
I've removed it from the graph
but I have not removed it from the scene.
I have not changed the material on the sofa objects.
If I ever need to get that material back
since it's in the scene,
I can just scroll down in the Material Map Browser
to the Scene Materials
and scroll within the Scene Materials pan here.
And I'm looking for leather cream rough
and I can drag that back onto my graph.
And I can either choose Instance
or if I want to create a variation,
I could choose Copy and click Ok.
And now I've got a new material.
It starts out having the same name.
So I would want to immediately change the name.
I might want to call it leather brown
or some thing like that.
(keyboard clicks)
Then I could go into its base color,
click on that swatch and reduce the value,
bring that down to a low value around let's say 0.1.
So I made a variation on that and it's here in the graph
but I haven't assigned it to the object.
So that would be a case of,
if I wanted to create variations,
I could start with some material
that already exists in the scene,
drag it out from Scene Materials
and then make my changes.
Now because this is not assigned to anything,
if I delete it now,
I will permanently erase it.
If I just select that leather brown material
and press the Delete key on the keyboard,
it doesn't exist in this file anymore.
It's not assigned to an object.
It's not in the view graph here,
and it's also not in one of these sample slots
which is a kind of staging area
for materials that are not in the scene.
We'll get back to that later.
So in that case,
deleting that material actually
destroy the material permanently.
Now if you delete something from the graph,
you may or may not actually delete it
depending upon what it is and what its status is.
So for example,
if I select this floor physical material
and press the Delete key on my keyboard,
I actually have not deleted the floor material.
It's still assigned onto the floor,
and it is still here in my Scene Materials
listed as floor physical material
and we can actually see the entire shaded tree
in a kind of an outline view.
What I did there when I pressed the Delete key,
was I created a new copy
of all of these maps.
These are now unique.
They're not connected to the floor physical material
and they're actually not connected to anything.
They're just floating here.
I can navigate with the Middle mouse button.
So that was kind of weird.
If I delete the root level material
I don't actually delete anything but I create something.
I created all of these copies
of these other maps.
All right, so that's weird
and that's going to take some getting used to it
but that's what happens.
So clear out all the garbage I've left behind.
I can go up into the Material editor menus
to the Edit menu and choose Clear View.
And I get a warning.
Do you really want to clear the current node view?
All nodes in the view will be deleted.
Well, yeah, I do
'cause that's why I chose Edit Clear.
Okay, so I'll click Yes.
And now I have a completely clean slate,
but again I have not changed my scene
or the materials in it in any way.
I can bring this floor physical material back over,
just drag it over.
And this time I'll choose Instance and click Ok.
And I can resume working on that material shader tree.
Now, if you delete a map from the graph,
then that is a destructive act.
Okay, so if I go over here
and let's say I'll zoom out a little bit
Control + Alt + Middle mouse.
Let's say I drag a selection rectangle
around all these maps.
Select them all and press Delete.
Well, I actually have deleted them.
And if we go over to our view port
and click in that view just to refresh it,
now the floor is just a flat color.
So deleting those maps
actually changed the structure of the material
that was instanced into the scene.
So again, that's going to take some getting used to.
It's really kind of a little bit strange the way this works.
Deleting something here in the select material editor
may or may not actually delete it
depending upon what you're doing.
If you delete a material that is instanced in the scene,
then you'll not erase that material in the scene.
But if you some map that's connected to a material,
then that changes the material
and you will delete that permanently.
Of course, you can always use the Undo.
We can hit Undo and bring that back.
Okay, so that's an illustration
of the relationship between the material editor node graph
and the materials actually instanced into to the scene.