WEBVTT

00:00.000 --> 00:04.680
One of the big new features that is coming to Blender 4.0 that might be flying under

00:04.681 --> 00:09.020
your radar is the new functionality to create tools with the geometry nodes.

00:09.860 --> 00:14.980
This makes it very simple to create custom tools that you can use to accelerate your

00:14.981 --> 00:17.940
workflow without writing a single line of Python code.

00:18.840 --> 00:22.120
Not that there's anything wrong with Python, but it does mean that now a lot

00:22.121 --> 00:26.440
more people will be able to customize their workflow and that it makes it a lot

00:26.441 --> 00:29.964
more easy to mark up new ideas for a new tool and

00:29.965 --> 00:34.240
integrate it as part as your library to reuse and share it.

00:34.580 --> 00:39.020
This means that with all the existing procedural capabilities of geometry nodes

00:39.021 --> 00:43.920
you'll be able to create tools that you can run directly from within edit mode or

00:43.921 --> 00:48.580
sculpt mode, which operates on your editable geometry directly as you work.

00:49.640 --> 00:53.380
While this doesn't keep the procedural aspect of the node tree intact,

00:53.820 --> 00:57.415
it means that you can keep editing the geometry with custom

00:57.416 --> 00:59.980
built tools that are catered to exactly what you need.

01:00.000 --> 01:02.240
without leaving the 3D viewport.

01:03.080 --> 01:07.600
You might be wondering why, since geometry nodes has been pushing the non-destructive

01:07.601 --> 01:10.712
workflow with Blender further than it's ever been, push

01:10.713 --> 01:14.080
this in the direction of a destructive workflow instead.

01:15.020 --> 01:17.820
And the answer to that is that there is room for both.

01:18.600 --> 01:23.380
Being able to customize a non-destructive workflow is at the heart of what geometry

01:23.381 --> 01:25.769
nodes have been created for, and now this

01:25.770 --> 01:28.180
is brought to destructive workflows as well.

01:28.181 --> 01:31.640
So how does one create one of these node tools now?

01:32.260 --> 01:35.900
The important thing you need to know to get started is that the geometry nodes

01:35.901 --> 01:39.720
editor now has a mode setting that can be switched to tools.

01:40.100 --> 01:42.000
By default, this is set to modifier.

01:42.580 --> 01:46.400
Here, creating a new tool is as easy as clicking on the new button.

01:46.760 --> 01:49.768
That creates a new node tree, just as you are used

01:49.769 --> 01:52.601
to from creating a new modifier in geometry nodes.

01:53.040 --> 01:57.860
The main difference between a modifier and a tool node tree is how it can be used.

01:58.280 --> 02:02.760
A modifier node tree is run again and again procedurally whenever something

02:02.761 --> 02:06.040
about the geometry changes as part of the modifier stack.

02:06.500 --> 02:09.453
A tool node tree is run once from the menu and

02:09.454 --> 02:12.981
applied immediately as you are editing the geometry.

02:13.080 --> 02:15.204
This also means that Blender needs to know

02:15.205 --> 02:17.320
which is which when you create a new node tree.

02:17.580 --> 02:21.580
You can specify the type of the node tree here in the node group settings.

02:21.581 --> 02:24.774
Usually, these will be set automatically as you

02:24.775 --> 02:27.900
create the node tree depending on the editing context.

02:28.520 --> 02:31.022
At the top bar of the node editor, you can

02:31.023 --> 02:33.981
specify in what context the tool should show up.

02:34.340 --> 02:37.470
So the type of geometry and the editing mode,

02:37.471 --> 02:40.921
like for example mesh edit mode or sculpt mode.

02:41.300 --> 02:43.985
This will also be set automatically when you

02:43.986 --> 02:46.720
create the new tool node tree in a certain context.

02:46.721 --> 02:51.980
Then you can see that in the right context, there is a new menu entry that is

02:51.981 --> 02:55.400
just characterized by this unassigned icon here.

02:55.940 --> 03:00.300
This is where new tools go before they are categorized into a menu.

03:00.780 --> 03:02.560
We'll go over how that works later.

03:03.240 --> 03:06.886
But now you can already see how the tool that we just created

03:06.887 --> 03:10.120
shows up in the menu entries next to the built-in tools.

03:10.580 --> 03:14.576
So any operation that you do in this tool node tree will be

03:14.577 --> 03:18.260
executed and applied immediately any time you run the tool.

03:18.740 --> 03:20.140
All from within the viewport.

03:20.360 --> 03:23.160
Just like the regular built-in editing tools in Blender.

03:23.700 --> 03:27.480
Let's build a simple little example tool so I can show you how this works.

03:28.100 --> 03:31.620
We will make a small tool to turn selected edge loops

03:31.621 --> 03:34.860
into dimensional tubes or pipes in mesh edit mode.

03:35.380 --> 03:39.800
The file with this example is one of the setups provided by Tim Greenberg aka

03:39.801 --> 03:42.280
Passivstar on the Blender demo files website.

03:42.800 --> 03:47.520
The best way to create tubes or pipes like this in geometry nodes is to use curves.

03:48.360 --> 03:53.960
So let's add in one node to convert the existing edges into curves and then

03:53.961 --> 03:57.260
another node to convert those curves back into a mesh.

03:59.020 --> 04:01.736
We just need to add another curve circle node

04:01.737 --> 04:04.660
to define the profile for the meshing process.

04:04.680 --> 04:08.720
And then we can already see the initial version of the tool in action.

04:09.800 --> 04:12.481
You can see how all the edges of our mesh are

04:12.501 --> 04:15.360
turned into these tubes now, just like a wireframe.

04:16.260 --> 04:18.080
There's one thing I want to point out here.

04:18.720 --> 04:22.980
You need to make sure that the type of geometry that is going to the output of

04:22.981 --> 04:26.960
the tool node tree is the same type that you do the editing for.

04:27.640 --> 04:33.040
With modifiers you can procedurally create any type of geometry, but now with tools

04:33.041 --> 04:37.220
it needs to be written directly into the data that you are editing.

04:37.600 --> 04:39.020
So it needs to be compatible.

04:39.540 --> 04:43.761
That means without the conversion to mesh, you are left without

04:43.762 --> 04:47.500
data as there cannot be any curve data inside of the mesh.

04:48.460 --> 04:51.360
The same is true for instances, volumes, etc.

04:51.880 --> 04:53.560
Now let's move on with the example.

04:54.320 --> 04:56.547
The next thing I want to do is to make this

04:56.548 --> 04:59.601
use the actual selection from mesh edit mode.

04:59.820 --> 05:03.186
For this kind of context-based data, there are a

05:03.187 --> 05:06.980
few new nodes that are exclusive to tool node trees.

05:07.660 --> 05:11.340
Since we are applying the operation immediately when the tool is used,

05:11.780 --> 05:15.580
we don't need the information that we base it on to be persistent.

05:16.420 --> 05:19.440
We don't need the selection to be kept around for later.

05:20.320 --> 05:25.540
So for tools, we can have access to additional context information that we can

05:25.541 --> 05:29.600
access with special input nodes, like the selection, phase sets,

05:29.800 --> 05:30.920
and the 3D cursor.

05:31.460 --> 05:34.280
For now, we just use the selection input node.

05:35.000 --> 05:39.480
Now the actual selection from edit mode is used the next time we run that tool.

05:39.900 --> 05:44.560
Keep in mind that this node cannot be used in the modifier node tree, since the

05:44.561 --> 05:48.002
selection is just a temporary attribute for the editing

05:48.003 --> 05:51.720
user interface and is not available in a modifier context.

05:52.500 --> 05:55.720
So now the tool is respecting the selection that we have

05:55.721 --> 05:58.220
set, but it is still not quite doing what it should.

05:59.100 --> 06:01.793
Instead of adding the generated geometry to the

06:01.794 --> 06:04.641
existing one, it is completely replacing it.

06:05.140 --> 06:10.180
So let's use a join geometry node to join it together with the input geometry.

06:11.940 --> 06:12.940
And there we go.

06:13.500 --> 06:16.160
This means that the core functionality is there.

06:16.680 --> 06:20.520
But I want to expose some additional control to this node setup somehow.

06:21.000 --> 06:24.320
The way that you can expose parameters as settings

06:24.321 --> 06:27.200
for tools is the same as for modifier node trees.

06:27.660 --> 06:29.979
You can just create node group inputs to

06:29.980 --> 06:32.460
make any setting accessible from the outside.

06:32.580 --> 06:34.796
For modifiers, these settings just show up

06:34.797 --> 06:38.241
in the user interface of the modifier panel.

06:38.300 --> 06:41.700
But this doesn't exist for tools that are directly applied.

06:42.080 --> 06:46.720
So for tools, you can find these in the operator panel that you get in the bottom

06:46.721 --> 06:50.340
left of the viewport or by hitting F9 after running the tool.

06:50.960 --> 06:55.580
Here you can change the settings that you exposed from the node tree after running

06:55.581 --> 06:59.800
it, and any change will run it again with the adjusted settings.

06:59.801 --> 07:03.661
So let's expose some of the parameters that we have available

07:03.662 --> 07:06.520
on the node tree to make this tool a bit more flexible.

07:09.000 --> 07:09.600
Okay, great.

07:09.780 --> 07:11.863
There's one last thing that I want this tool

07:11.864 --> 07:14.541
to do in order to make it more convenient.

07:14.880 --> 07:20.500
A useful aspect of mesh editing tools that create new geometry is that the operation

07:20.501 --> 07:26.100
also clears the previous selection and selects the newly generated geometry instead.

07:26.101 --> 07:29.392
This allows you to immediately work on the new

07:29.393 --> 07:32.320
geometry without having to select it yourself.

07:32.760 --> 07:36.231
So for setting the selection, there is also a new node

07:36.232 --> 07:39.960
for tools that allows this, called the set selection node.

07:40.460 --> 07:43.289
We can simply insert this at the end of our

07:43.290 --> 07:46.601
operation and set the selection to what we need.

07:46.720 --> 07:51.980
So let's set it to false for the existing and to true for the new geometry.

07:51.981 --> 07:54.750
Now after running the tool, you have a

07:54.751 --> 07:57.820
selection that is isolated to the new geometry.

07:58.260 --> 08:02.440
That makes it a lot easier to use this tool in your workflow as now you can

08:02.441 --> 08:06.640
operate on the newly created geometry immediately after using the tool.

08:07.140 --> 08:09.900
And that is already our simple tool finished.

08:10.420 --> 08:14.460
And now to make this tool available outside of this specific file,

08:14.780 --> 08:19.120
you have to turn it into an asset that is accessible as part of a library.

08:19.121 --> 08:24.480
That works simply by marking the node tree as an asset with right click and making

08:24.481 --> 08:27.963
sure that the file that contains it is part of a library

08:27.964 --> 08:30.620
that you have specified in your user preferences.

08:31.080 --> 08:34.340
By default, the asset is not assigned to any catalog.

08:35.020 --> 08:39.440
So it shows up under the unassigned catalog in your asset library.

08:39.980 --> 08:44.460
This is also what makes it show up in the unassigned menu in the viewport.

08:44.940 --> 08:48.774
Using the catalog structure of your asset library, you

08:48.775 --> 08:52.260
can specify exactly in what menu the tool will show up.

08:52.400 --> 08:57.920
This way, by recreating the existing menu structure, you can also fit them into one

08:57.921 --> 09:00.260
of the menus that are in Blender by default.

09:00.780 --> 09:04.229
This tool, for example, we can fit into the

09:04.230 --> 09:07.560
edge menu simply by creating the edge catalog.

09:07.940 --> 09:14.321
And now it shows up together with the other edge operations whenever you press Ctrl E.

09:14.560 --> 09:17.920
Of course, this can also be assigned with your own shortcuts.

09:17.940 --> 09:22.740
And that's already everything you need to know about node tools in Blender 4.0.

09:23.380 --> 09:27.080
But to put it into perspective, what this addition to Blender means,

09:27.540 --> 09:29.936
I want to talk briefly about what kind of things

09:29.937 --> 09:32.941
are planned to add to the system in the future.

09:33.080 --> 09:36.600
Some of the things that are planned to be possible using the node tool system

09:36.601 --> 09:41.740
include the addition of more of the mentioned information from the context,

09:42.100 --> 09:47.920
like the mask from sculpt mode, the active attribute, or the view angle, for example.

09:47.940 --> 09:54.440
Also, custom gizmos to specify the input visually in the viewport, modal operators

09:54.441 --> 09:59.480
to give an interactive input before confirming, and other properties that will

09:59.481 --> 10:04.400
give more value to the fact that these tools can be run as part of a destructive

10:04.401 --> 10:06.980
workflow rather than in a procedural setting.

10:07.860 --> 10:12.980
After all, there is great value in combining the vast and growing procedural

10:12.981 --> 10:16.232
capabilities of geometry nodes with a strong,

10:16.233 --> 10:18.921
customizable toolset for a destructive workflow.

10:19.620 --> 10:24.300
So, once again, this is only the first step in an effort to bring all of the

10:24.301 --> 10:29.420
capabilities of the geometry node system to the ability of users to create custom

10:29.421 --> 10:34.440
tools for their specific workflow without the need of writing code in a way that

10:34.441 --> 10:37.440
interrogates into their workflow on a fundamental level.

10:38.080 --> 10:40.925
I hope this overview video gave you a good start into building

10:40.926 --> 10:44.500
your own tools with Blender 4.0, and I'll see you next time.
