Add-ons

How to programmatically check if the Blender add-on is registered

To start working every Blender add-on must be registered by setting up the checkbox before add-on name in the User Preferences window – Add-ons page.

To programmatically find out if the required add-on is registered, run the following command:

Where:

add-on_name – the name of the add-on file (without the .py extension) or the name of the add-on package, if it was installed from the package.

Debugging multifile Blender add-on by quick reinstall

It is convenient to use the following system for debugging developing multi-file Blender add-ons. But it has one drawback: modules imported in __init__.py file becomes available only after the file running (after the execution of the register() function). This means that any access to the imported modules before they are registered will cause an error. This is not critical in most cases, but it will cause a problem if, for example, in one imported module is used inheritance from the class, described in the other imported module, because the classes descriptions are processed before the add-on registration.

To get more freedom working with imported modules, we can use another way to debug the add-on – do not run the add-on directly from the development directory, but install it in Blender and check its “live” work. However, manual add-on reinstallation requires a set of routine actions, which complicates such sort of debugging. This issue can be solved by reinstalling the add-on in automatic mode.

Creating pop-up panels with user UI in Blender add-on

In addition to common panels (N/T/Properties) and their sub-panels, to display the user interface elements while developing Blender add-ons you can also use pop-up panels appearing on the screen when a user presses a certain key combination or perform any action. The simplest example of such panels is the panel that appears when the f6 key is pressed immediately after adding an object (shift+a) to the scene.

Blender API provides developers the ability to create such panels for their add-ons. Let’s consider the creating of a pop-up panel as an example of the “Message box” window.

BIS v.1.0.0 – Release

BIS (Blender Interplanety Storage) add-on release.

Finally, I finished it. It’s release now!

BIS add-on v.0.0.3

BIS (Blender Interplanety Storage) add-on intermediate update to v.0.0.3

The addon is almost in the prerelease state.

  • All Cycles nodes are supported, including script and nested groups.
  • Also added the ability to save scripts/texts from the Text Editor.

To make a release, it was left to clean up a bit the server (site) side – increase the size of the previews, add tags and node names editing, make a separate list for saved texts. And also test the add-on with complex materials.

Active objects access

How to access the active (selected) objects through the Blender Python API from scripts/add-ons:

  1. The active window (in which current action occurs):

  1. The active scene:

  1. The active (selected) mesh:

  1. The active (selected) material node (in the NODE_EDITOR window):

  1. The active (selected) material node (in the COMPOSITING window):

  1. The current text in TEXT_EDITOR window:

  1. The active (selected) UV-Map: