Python

Blender add-on development – manifest file

Starting with Blender 4.5, the developers fundamentally changed the approach to developing Blender add-ons. Now – Extensions, rather than Add-ons. The old add-on format still works correctly, and if you don’t intend to publish your add-ons in the official Blender Extensions library, you don’t need to change anything. However, if you want your add-ons to be supported by Blender in the future, it’s a good idea to make some changes now. One such improvement is the creation of a manifest file.

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.

Getting an on-screen bounding box for an object in Blender

For calculating simplified interactions between objects, bounding boxes are typically used—parallelepipeds whose volume completely encloses the entire mesh geometry. Because such a box has and uses only six points for calculations, unlike the mesh itself, which can have millions of points, all calculations are very fast. Every object has a built-in bounding box, and its display can be enabled in the mesh’s parameters. This bounding box operates in 3D scene space, but there could be some cases when we need to control object interactions in 2D screen space. There are no pre-calculated bounding boxes for the viewport, but we can get one ourselves using the Blender Python API.

Disconnecting strips in Blender VSE

Starting with version 4.5, when adding new strips to the Blender video screen editor (VSE), the strip is added immediately connected to an audio track. This can be more convenient for working with the strip, as the audio track automatically follows the video when we move and drag it. However, if we need to trim or move the audio to another section of the video, we must first disconnect the video and audio tracks.

Moving the origin to the center of the mesh selection with fixing instances

The script we wrote for quickly moving an object’s origin to the selection works well. As long as instances aren’t used in the scene. Moving the origin to the selection on an instanced object will cause all instances of the object to move from their original positions to the new ones. This happens because by moving the origin relative to the object’s geometry, we’re essentially moving the geometry itself relative to its center point, and then moving this center point (origin) to the new position. For instanced objects, the origin remains in the same place, and the geometry’s offset doesn’t disappear, resulting in a jump.

Simplifying animation curves in Blender

There are cases, especially when importing from third-party packages, where animation curves in Blender become literally cluttered with numerous control points, most of which have little effect on the overall shape of the curve. Many points on a curve increases the complexity of the scene and complicates animation calculations. However, the number of points on animation curves can be easily reduced if necessary.