0
$\begingroup$

I want to make my node groups available as templates/presets, but unfortunately the Node Presets addon provided for this does not work as expected with my geometry nodes (Blender 3.1).

It installs without any problems and I can also specify the path to my files that contain my Node Groups.

enter image description here

Also the Node Groups stored in the files are correctly displayed to me in the menu under Templates, but as soon as I want to add a Node Group, the following error appears: location: <unknown location>:-1.

enter image description here

Furthermore, I notice that although the file actually only contains geometry nodes, these are also displayed under Templates in the Shader Editor, although they are actually not compatible.

$\endgroup$
2
  • $\begingroup$ What about the Asset Browser? Could this be a solution for you as well? $\endgroup$ Commented Apr 17, 2022 at 20:52
  • $\begingroup$ @AndréZmuda No, unfortunately not. Nodes are meant to be easily manageable and extensible, and are therefore better off in their own file. The Asset Browser is great for objects, but not for nodes. Thanks for your feedback anyway! $\endgroup$
    – quellenform
    Commented Apr 17, 2022 at 20:56

1 Answer 1

0
$\begingroup$

The addon Node Presets is currently included in version 3.1, but has a small bug concerning geometry nodes. This has been fixed in the source code, but is still present in 3.1.

Basically, this addon offers the possibility to use node groups for the following areas as templates/presets:

  • Shader/Texture Nodes
  • Compositing Nodes
  • Geometry Nodes

For the areas Shader/Texture and Compositing the add also works without problems, but nevertheless all nodes in each area are always listed, no matter whether they are compatible or not.

Only when trying to add, for example, a shader node in compositing, a message is displayed that this does not work.

How can I still use the functionality for Geometry Nodes in version 3.1?

All you need to do is fix the bug mentioned earlier.

You can do this yourself by adding a line of code to the scripts/addons/node_presets.py file.

Change this code:

node_type_string = {
    "ShaderNodeTree": "ShaderNodeGroup",
    "CompositorNodeTree": "CompositorNodeGroup",
    "TextureNodeTree": "TextureNodeGroup",
}[type(node_tree).__name__]

to this:

node_type_string = {
    "ShaderNodeTree": "ShaderNodeGroup",
    "CompositorNodeTree": "CompositorNodeGroup",
    "TextureNodeTree": "TextureNodeGroup",
    "GeometryNodeTree": "GeometryNodeGroup",
}[type(node_tree).__name__]

How can I separate the areas for Shader/Texture, Compositing and Geometry?

For this the addon would have to be extended a bit.

Unfortunately, when starting Blender and reading the blend files located in the specified folder, it is not possible to distinguish what type the node groups are. That's why all found nodes are always displayed in all areas.

This is due to another problem and unfortunately cannot be changed at the moment. More about this here.

However, there is a way to get the desired functionality anyway, by simply implementing multiple paths. One for each area.

So you can store your Shader Nodes and Geometry Nodes in their own files and folder. That's a few more paths, but it works well.

enter image description here

The necessary changes are the input fields for the paths to your Blend files, the reading of these paths when Blender is started, and the provision of the node groups found in the files in the respective areas.

So you don't have to tinker with these changes yourself, I've done that for you and made the modified add-on available on Github.

Here you can download the ZIP directly: NodePresetsExtended.

After that you just need to install the addon as usual (but first deactivate the old add-on Node Presets if it is activated!), specify the paths to your files, restart Blender and your Geometry Node Presets will work as you want them to.

enter image description here

Note:

If you store your node groups in a blend file, it is helpful if you store them all in a single root node and name this node e.g. _OVERVIEW.

All node groups whose names start with an underscore are not included by the addon, and you keep a better overview of the included node groups in your files.

$\endgroup$
1
  • $\begingroup$ Unfortunately, since there doesn't seem to be any other/better answer currently, I'll accept my answer to my question as the solution. $\endgroup$
    – quellenform
    Commented May 4, 2022 at 23:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .