Changes in node tree creation for compositor in Blender 5.0

In Blender 4.5 and earlier, the compositor only supported one node tree per scene. To initialize it in the compositor, we had to on the “Use Nodes” checkbox in the area header. The node tree was created automatically and immediately connected to the scene. Starting with Blender 5.0, the developers introduced the ability to create multiple node tree variants for the compositor. The method for creating node trees in the compositor has also changed.

For the common user, not much has changed. To manually create a node tree in the compositor in Blender 5.0, just like for regular materials, click the “New” button in the area header. This creates a new node tree and automatically assigns it to the scene.

Now let’s look at how to create a new node tree for the Blender 5.0 compositor using the Blender Python API.

First, note one important change: while previously we obtained a pointer to the compositor node tree from the scene using its “node_tree” property, starting with version 5.0, the property name has been changed to the “compositing_node_group”.

In Blender 4.5 and earlier:

In Blender 5.0:

To create a node tree in Blender 4.5 and earlier, we had to set the “use_nodes” scene property to True. Everything else was done automatically.

In Blender 5.0, we can use the new_compositing_node_group() operator, which, when called, will create a node tree for the compositor, get pointer to created node tree, and set it to the desired property of the scene.

Or we can do everything ourselves, without using the operator.

First, let’s create a node tree of the desired type. This immediately gives us a pointer to it and eliminates the need to search for it among other node groups.

Now let’s create the necessary nodes.

First, the Output node. We need to create not only the node itself, but also an output socket for the entire node tree, which will work through the Output node.

Let’s also create a Viewer node.

And the RenderLayers node.

Now let’s connect the RenderLayers node and the Viewer and Output nodes with links.

And, finally, set the created node tree pointer to the scene property.

This way, we’ve created a node tree for the compositor in Blender 5.0, and we can work with it as needed – adding or removing nodes and creating links.

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comment
Newest
Oldest Most Voted
Inline Feedbacks
View all comments