How to find which collection contains the desired object

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:

This code will return a list of cameras and collections in which they are located.

How to get the number of triangles in a mesh

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”

Deselect all with a single pressing of the “a” keycode

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.

Edit Source

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”

How to open folders by a single click in Blender 2.8x

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”

How to check the direction of a Bezier curve

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:

 

How to get current Blender version number through the Python API

To get current Blender version number through the Python API we need to execute the following command:

or

Continue reading “How to get current Blender version number through the Python API”

How to start render in the main window in Blender 2.81

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.

How to move cursor to vertex

To translate cursor to the desired mesh vertex execute the following code:

Attention to the multiplication order – world matrix should be left.

How to move the cursor to the active strip start/end position in Blender VSE

To move the cursor to the start position of the active strip in Blender VSE:

To move the cursor to the end position of the active strip:

 

How to correctly set parameters using mathematical expressions

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”

How to get vertices from Vertex Group by its name

To get a list of vertices from the vertex group by its name we can use the following code:

 

Autoclick in Pie Menu

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.

15 changes that you need to know when migrating from Blender 2.79 to Blender 2.80

  1. Object selection

2.79: selecting with the right mouse button
2.80: left-click selection

  1. T-panel

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

  1. Deselection

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”