How to install and uninstall Blender add-on via python API

Blender add-ons installation and uninstallation can be managed through the python API. Use the following commands in a script:

To deactivate the add-on:

To uninstall the add-on:

Mesh Custom Properties editing through the Blender API

New mesh Custom Property can be created through the Blender python API by executing the following code:

with:

  • object_name – name of the mesh
  • property_name – new custom property name
  • property_value – value of this new property

After executing this command, the new property will be created and will be available in the Properties window – Object panel – Custom Properties sub-panel.

Like any object custom properties, the created property has a number of parameters that can be accessed by clicking the Edit button. These parameters can also be changed through the API.

Rotating texture by nodes

In order to achieve the desired texture mapping on the object surface, we need a convenient tool for manipulating the texture coordinates. Especially for procedural textures mapped to the object without using UV-s.

The “Mapping” node combines tools for texture moving, rotating and scaling is suitable for most of the texturing tasks. But sometimes its power is not enough. Its major drawback is that it allows setting adjustment values only in certain fields within the node body. These fields have no inputs and cannot be connected to the other nodes.

However, we can implement the required functionality devoid of the “Mapping” node lack with the help of some other nodes. Let’s consider how to build a node tree to rotate the texture around the Z-axis of the object by a random value.

Fast intermediate nodes view in compositing

Creating a node tree in the compositing window, sometimes it is necessary to see the intermediate result given by some parts of the node tree. For fast viewing click left mouse button on the desired node with the “ctrl” and “shift” keys pressed. Blender adds a new View node (or uses one of the existing) and connects the output of the selected node to it. The result is displayed on the backdrop (if the corresponding checkbox checked) or in the UV/Image Editor window in “Viewer Node” mode.

If the clicked node has several outputs, each subsequent click on that node switches the view to its next output.