Blender 3D

How to pass command line arguments to a Blender python script or add-on

When starting Blender from the console it processes all parameters passed through the command line. However, some scripts and add-ons for proper work may require specifying their unique command line arguments. If you specify such additional parameters in the command line, Blender will also try to process them, which is likely to result in an error. Blender provides a special way to exclude such arguments from own processing.

How to make Blender fully portable

Even if Blender was downloaded as a zip-file and started from the unpacked archive instead of the installation, the files with its settings are stored separately in the user’s directory. The history, the start scene, and user-installed add-ons are also stored there. So if you transfer Blender to another computer, all these preferences will be lost.

However, at startup, Blender first looks for a config directory in its own folder and only if it does not find it there, it accesses the folder in the user’s directory.

In order to make Blender completely portable, it is enough to copy config folders “config” and “scripts” from the user’s directory into Blender’s own directory into the folder with the version number. This will transfer the settings and installed add-ons to the Blender directory, and now all the changes will be made already here, not in the user directory. Blender becomes portable and can be copied to another computer or removable device.

How to render an object with reflections on a white background

The single object visualization most often is performed on a clear white background. It is difficult to achieve this through the common configuring the scene – increasing the illumination of the scene “lights up” the object, decreasing – the background becomes gray instead of white. If the object itself can be simply rendered on a transparent background and then imposed on white, but what about its reflections?

Let’s consider the way how we can render the object and its reflection on a white background.

Creating radio buttons in the Blender add-ons interface

State switches so-called “radio buttons” are used in the case to limit the choice by one value from several available ones. There are a lot of such buttons in the Blender interface, for example, switching between RGB and BW rendering modes or setting the texture mapping mode. Such buttons can be created in the Blender add-ons interface too.

Let’s create our own radio button switcher.