Python

Converting a Mesh to a Bezier Curve

To convert any flat mesh to a Bezier curve, we need to perform several operations: first, convert the mesh to a curve, then convert its points to Bezier format (with “handles”), and, optionally, recalculate the number of control points to remove points that don’t affect the curves shape. All of this can be done in a single-click with the help of a simple script.

Enabling ghost environment mode in Blender

When working with a mesh surrounded by other objects in a Blender scene, we often need to ensure that all other objects don’t obscure it and interfere with precise modeling. In this case, the easiest way is to enable object isolation mode (pressing the “/” key), which hides everything surrounding the object from the screen. However, sometimes we need to simultaneously work with the mesh and control and relate it to its surroundings. In these cases, the “ghost” mode is best suited—when all surrounding objects appear translucent and don’t interfere with our work, but still allow us to perceive and control the scale and position of the object in the scene.

Making objects dynamic properties more controllable

We can assign additional custom properties to objects in Blender using the Blender Python API. Custom properties can be assigned to objects in the common way, using the “bpy.props” class objects, or by simply assigning the desired property to the object. However, while the first method immediately provides a set of controls for managing the property, such as maximum and minimum value constraints, default values, etc., the second method has no such defaults for the assigned property.

Building a color cube in Blender

In the RGB color model, any color is represented as a combination of three basic colors: R – red, B – blue, and G – green. Basic colors are specified by a number in the range from 0 to 255. Therefore, any color in this model will be represented by a combination of three such numbers. For example, light orange will be represented by a set of numbers (255, 153, 51). The RGB model can be visualized by imagining it as a cube with a side equal to 255, all of whose internal points are vectors, the position of which is determined by a triple of numbers that determines the color itself.

Quickly renaming UV-maps of selected objects to the same name in Blender

When joining several objects into one, there is one feature in Blender – if the names of the UV-map of the objects are different, in the new, joined object, each UV-map will be placed on a separate layer. In order for all the UV-maps in the joined object to also be combined into one, they must all have the same name.