B3D Interplanety discord server.
The community about Blender 3D, its API, programming, scripting, and add-ons development.
To hide an object in the 3D Viewport window for the current scene we use the “object.hide_view_set” operator, which calls when we clicking the icon with an “eye” in the outliner. However, to hide the object in the viewport for all scenes of the project at once (clicking on the icon with the “monitor” image) a special operator is not provided. We can make it ourselves.
To hide objects in the 3D Viewport window, we can click the “eye” icon in the outliner near the desired object name (press the “H” shortcode), or we can click the icon with the “monitor” image. In both cases, the object will be hidden.
So, what’s the difference between these two variants?
It is very simple:
Clicking on the “eye” icon hides objects only in the currently active scene of the blend file.
Pressing the icon with the “monitor” hides objects in all scenes of the blend file at once.
To apply all transformations to an object, all its vertices must be multiplied by its global matrix, the matrix itself must be made identity.
To apply all transformations to the active mesh, we need to execute the following:
obj = bpy.context.object
matrix = obj.matrix_world.copy()
for vert in obj.data.vertices:
vert.co = matrix @ vert.co
Rendering directly to a video file in Blender is not always useful. More often, a sequence (a set) of frames is received after render, which then, for example, after additional post-processing, must be assembled to the final video file.
We can compile a sequence of frames into a video with Blender itself, with the Visual Screen Editor (VSE). Or we can use third-party codecs, for example, FFmpeg.
A simple script for transferring the origin of all selected objects to the origin of the active object.
Since Blender 2.9, the ability to assign color tags has been added for collections. Collection with such tag is displaying in a specific color in the outliner.
The collection color tag value is stored in its “color_tag” property. To change the color label of a collection, we need to assign a certain value to this property.
For example, to mark the current active collection in green:
bpy.context.collection.color_tag = 'COLOR_04'