If the object you need is located in a hidden collection, it can be difficult to find it in large scenes.
To find out in which collection the desired object is located by its type, we need to execute the following. For example for cameras:
[(obj.name, obj.users_collection) for obj in bpy.data.objects if obj.type=='CAMERA']
# [('Camera', (bpy.data.collections['camera'],))]
This code will return a list of cameras and collections in which they are located.
Modifiers can be applied to a mesh from the keyboard. To apply the modifier, move the mouse cursor over it and press the key combination:
ctrl + a
To get the number of vertices, edges, and polygons in a mesh, we can simply take their amount from the desired data block: “vertices”, “edges”, and “polygons”. However, there is no special data block for triangles in the mesh structure.
To get the number of triangles in the mesh, we need to execute the following code:
Continue reading “How to get the number of triangles in a mesh”
Since Blender 2.80 the deselect all function – complete deselection of all objects or geometry – has been switched from a single press of the “a” key to a double “a-a” or a combination of “alt+a” keycodes. To return the deselection function to a single “a” press, we can edit the settings of the selection operators. Or, since Blender 2.81, a special checkbox is provided for this in the keyboard shortcuts settings.
- Open the “Preferences” window
- Switch to the “KeyMap” section
- Turn on the “Select All Toggles” checkbox in the “Preferences” subsection
- Save the settings by pressing the “Save Preferences” button in the upper right corner of the window.
Now the selection of all objects/geometry and their total deselection will be performed by pressing the single “a” key.
To register Blender to open *.blend files by double-clicking we need to:
- Open the Windows Explorer (My Computer) and switch to the Blender directory.
Continue reading “Quickly registering Blender to open blend-files by double-clicking”
To scroll the animation in Blender without leaving the “Viewport” window – hold the Alt key and turn the mouse wheel.
This type of animation scroll works even if there is no “TimeLine” window open.
In the last Blender 2.83 version, the function to remove doubles and merge vertices is moved to the “m” key code. The “alt + m” key code, used before, now executes the “Split” functions.
For those who want to know “how Blender works” to write their own scripts and add-ons, the developers have provided a very convenient option – the ability to view any element source code in a single click.
To see the source code of any element: open the “Text Editor” window; then simply click on the desired element with the right mouse button and select “Edit Source”.
Continue reading “Edit Source”
When opening files through the “File Browser” in Blender 2.8x, directories (folders) are opened with mouse double-click. This change has been made for better compatibility with the standards (directories are opened by double-clicking in most file managers, for example, in the Windows Explorer), but this is not always convenient.
To make the folders opening by a single click:
Continue reading “How to open folders by a single click in Blender 2.8x”
To see the render time remaining just move the cursor over the render progress bar.
The direction of a Bezier curve, visually indicated by its normals slope, can be checked by the indices of its points.
The Bezier curve points indices always ascending in the curve direction.
So, having two points on the curve we can get the direction through their indices:
bezier_spline = bpy.context.object.data.splines
p0 = bezier_spline.bezier_points
p1 = bezier_spline.bezier_points
p0_index = next(iter([point for point in bezier_spline.bezier_points.items() if point == p0]), None)
p1_index = next(iter([point for point in bezier_spline.bezier_points.items() if point == p1]), None)
direction = 'p0 to p1' if p0_index < p1_index else 'p1 to p0'
# p0 to p1
To split a Blender viewport window to four projections: top, left, face and perspective, you can press the following key combination:
ctrl + alt + q
The cursor has to be on the viewport window.
Second pressing this combination returns viewport window to the previous state.
In Blender 2.81 with the “Vector Math” node we can simple regulate the subsurface radius:
To get current Blender version number through the Python API we need to execute the following command:
# (2, 81, 16)
# '2.81 (sub 16)'
Continue reading “How to get current Blender version number through the Python API”
Render starts in a new window in Blender 2.81 by default. And there is no more render display mode settings in the “Render” menu. These settings were moved into the “Preferences”. To configure render execution window – open the “Preferences” window, press the “Interface” button and in the “Temporary Windows” configure the “Render In” parameter as you need.
To translate cursor to the desired mesh vertex execute the following code:
bpy.context.scene.cursor.location = bpy.context.object.matrix_world @ bpy.context.object.data.vertices[_VERTEX_NUMBER_].co
Attention to the multiplication order – world matrix should be left.
To move the cursor to the start position of the active strip in Blender VSE:
bpy.context.scene.frame_current = bpy.context.scene.sequence_editor.active_strip.frame_start
To move the cursor to the end position of the active strip:
bpy.context.scene.frame_current = bpy.context.scene.sequence_editor.active_strip.frame_final_end
Blender has a very convenient ability to set the desired values through mathematical expressions. If we don’t know the exact value, instead of manually calculating it, we can simply enter an expression that will calculate the desired value.
Continue reading “How to correctly set parameters using mathematical expressions”
To get a list of vertices from the vertex group by its name we can use the following code:
[vert for vert in bpy.context.object.data.vertices if bpy.context.object.vertex_groups['vertex_group_name'].index in [i.group for i in vert.groups]]
# [bpy.data.meshes['Cube'].vertices, bpy.data.meshes['Cube'].vertices, ...
Blender Outliner supports a sequential selection of a number of objects or collections – hold the left mouse button and move the cursor in a required direction.
Blender supports opening projects by drag and drop. You can hold the *.blend file with the mouse, drag it to the Blender window and choose: open the entire file (replacing the currently open project), add or link objects from the dragged file to the current project.
The “Bloom” effect in the EEVEE rendering engine looks very impressive but does not visible when rendering on a transparent background.
But this can be fixed.
Continue reading “Bloom effect in EEVEE on transparent background”
To render only the shadow of the object in Blender Eevee:
- Assign to the object the default material with the Principled BSDF shader and set its Alpha value to 0.
- In material properties switch the Blend Mode to “Additive” or “Alpha Clip”.
To increase the speed and convenience of working with the “Pie Menu” in Blender you can use its “autoclick” option. To use it press the desired “Pie Menu” call keys, don’t release them, move the mouse cursor in the direction of the desired item, and only then release the buttons on the keyboard. You don’t need to click on a menu item, the choice is made automatically.
- Object selection
2.79: selecting with the right mouse button
2.80: left-click selection
2.79: called by pressing the “t” key
2.80: it’s gone, functions moved to the main menu and to the context right-click menu
2.79: “a” – select all and deselect all
2.80: “a” – select all, “a – a” or “alt+a” – deselect all
Continue reading “15 changes that you need to know when migrating from Blender 2.79 to Blender 2.80”