Python

Changing the order of sockets in Blender Geometry Nodes groups

We can change the order of sockets in a Blender Geometry Nodes node group manually by simply dragging it – in the N-panel in the Group – Interface tab, hold down the desired socket and drag it with the mouse to the desired place. We can move a socket in a group node to a new location using the Blender Python API with the move() function of the “interface” object.

Labels for Reroute nodes in Blender Geometry Nodes

Did you know that you can set your own text labels for Reroute nodes in Blender Geometry Nodes? Since Reroute nodes are most often used to simplify and improve the readability of node trees in Geometry Nodes, marking such nodes with a label with a short informational inscription can be very convenient – you will not need to remember or scroll through the tree of nodes every time to find out where this Reroute data comes from.

Quickly setting the point at which the light sources in the scene should be directed

When we set up lighting in a scene in Blender, we usually set the direction of the light to the desired point manually for each light source. However, this process can be simplified and we can specify the point to which all selected light sources in the scene will be directed at once.

Moving the Auto Smooth modifier to the end of the modifier list

Since version 4.1, the normal smoothing operator in Blender has been completely replaced by a modifier implemented on the Geometry Nodes mechanism. This is convenient for solving a number of problems, but if the Auto Smooth modifier is not located on the last place in the modifier stack, before other modifiers that change the mesh geometry, this leads to the appearance of artifacts. To quickly move the Auto Smooth modifier to the end of the stack, we can use a simple script.

Working with Mean Bevel Weight using the Blender Python API

To interact with the Bevel modifier, which creates a bevel on specified edges, each of the required edges must be given a specific numeric weight parameter ranging from 0.0 to 1.0. In manual mode, the weight for the bevel is set in the N-panel on the Item tab in Edges Data – Mean Bevel Weight field. This weight can also be read and set via the Blender Python API.

Working with sharp edges using Blender Python API

In Blender, we can mark the edges of the mesh as sharp so that they remain sharp and do not become smooth even when we enabling smooth shading. This can be done manually by selecting the desired edges and pressing the Edge – Mark Sharp items in the main menu. Edges can also be marked as sharp using the Blender Python API.

Working with mesh edges marked for rendering using the Freestyle render engine

To create line-based renderings, such as blueprints or 3D to 2D stylizations, an additional “Freestyle” render engine is usually used with the main render engine. Edges that should be clearly outlined in the final render must be marked as “freestyle” so that the Freestyle render engine can process them.

Simple dynamic LOD in Blender

One of the popular methods for speeding up rendering 3D scenes is to use LOD – Level Of Details. When using LOD, objects close to the camera have the highest detail, midgrounds have medium detail, and backgrounds objects are very rough and undetailed because they are still almost invisible. Such a scene is rendered much faster than a scene in which all objects have maximum detail.