2.79

How to check if Blender object property/attribute is read-only

To check is an attribute/property of any Blender object (mesh, node, modifier, etc.) read-only:

  1. With the is_property_readonly function, execute the following command:

<object> .is_property_readonly (‘<property name>’)

  1. Through the rna structure, execute the following command:

<object> .bl_rna.properties [‘<property name>’]. is_readonly

For example, for the “is_editmode” mesh property (is the mesh in edit mode or not):

How to find out in what version of Blender the blend file was saved

To check in what version of Blender the blend file was saved:

  • Open your file in Blender
  • In the Python Console window execute the following command:

Or open the blend file in any text editor, for example in Notepad++. The Blender version will be listed in the first 15 characters.

Also, the version of the open blend file can be viewed in the Outliner window in the Data Blocks group:

How to get the version of the add-on installed in Blender

A complete list of add-ons installed in Blender we can get using the addon_utils:

Having the add-ons list, we can get the version of the desired add-on by its name with the following code:

Where the ADD-ON_NAME is the name of the desired add-on.

If the add-on is missing a version indication, the default result will be returned.

 

How to programmatically switch between vertex, edge and face selection mode

Change the mesh_select_mode property to switch in mesh edit mode between vertex, edge and polygon selection mode in Blender.

For vertex selection mode:

Edge selection mode:

And face selection mode:

The multi-select mode is enabled too. For example for vertex and face selection mode:

In BMesh for vertex, edge and face selection mode:

For multi-select in BMesh: