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.

Continue reading “Debugging multifile Blender add-on by quick reinstall”

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:

Continue reading “How to install and uninstall Blender add-on via python API”

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.

Continue reading “Mesh Custom Properties editing through the Blender API”

Working with UV-Maps through the Blender API

Active (selected) UV-Map:

Access to the active UV-Map by its name:

Continue reading “Working with UV-Maps through the Blender 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.

Continue reading “Rotating texture by nodes”

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.

Changing the modifier parameter for several objects at the same time

Modelling complex objects consisting of many separate parts, for each of which the Subdivision Surface modifier is added, it often needs to increase or decrease the number of modifier subdivisions at once for all of them. This can be done by selecting them and changing the modifier parameter value with the “alt” key pressed.

Testing my add-ons in Blender 2.79

I tested the functionality of my add-ons in new Blender 2.79.

  • BIS – Fully functional. The new Principled BSDF shader supported.
  • PartitionRender – Some code correction made. Add-on needs to reinstall. Fully function after reinstallation.
  • Wire – Fully functional.
  • Accurate Render Border – Fully functional.

Add-ons remains compatible with Blender 2.78.

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.

Continue reading “Creating pop-up panels with user UI in Blender add-on”

Modeling with curves: wires and pipes

Creating thin long objects like pipes and wires is the often task in the interior, scientific of fantastic scenes. One of the easiest and most convenient ways to create such objects is using curves.

The main curves advantage is the easiest control and editing: any time you can change the shape of the curve, move its points, add new and delete unnecessary ones. You do not have to work with a lot of mesh points, but only with several points of the curve, which is much more convenient. Preprocessing for rendering scene with curves is also performed faster than with meshes.

Continue reading “Modeling with curves: wires and pipes”

Installing Blender on Linux Debian server

One of the amazing Blender features is that the graphical user interface GUI is not absolutely necessary for its work. You can install Blender on an operating system without a graphical shell and successfully render your scenes. Such types of a Blender installations are usually required to organize various render farms.

For example, consider Blender installation on the server Linux Debian operating system.

Continue reading “Installing Blender on Linux Debian server”

BIS v.1.0.0 – Release

BIS (Blender Interplanety Storage) add-on release.

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

Download

Continue reading “BIS v.1.0.0 – Release”

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 previews size, add tags and node names editing, make a separate list for saved texts. And also test the add-on with complex materials.

Download

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 current text in TEXT_EDITOR window:

  1. The active (selected) UV-Map: