Python

Moving node tree to the node editor area origin

In Blender, when creating complex procedural materials or geometry nodes, the node tree often moves away from the starting point of the node editor area. Later, when working with materials, this causes some inconvenience – when switching from material to material, the node tree “runs away” and we have to scroll the screen each time to see the nodes. This problem can be solved using a simple script that will move the entire node tree to the origin of the node editor area.

Selecting a Tool in Blender 3.6 using the Blender Python API

To switch the active tool using the Blender Python API, we must use the wm.tool_set_by_id operator, passing the identifier of the required tool in its parameter. In earlier versions of Blender, to call this operator from an area with a different context, for example, from the Text Edit area, it was necessary to override the context.