2.78

Working with MySQL database from Blender

Storing data in a remote database has become common practice in the development of software products. Blender is no exception. Writing scripts and add-ons, the developer may need to access the database to retrieve from it or write to it the necessary information. MySQL today is one of the most common and widely available databases and is well suited for working with Blender.

The interaction between Blender and MySQL database through the Blender Python API is not difficult, but it needs some preparation before stating:

How to render object with shadows on a transparent background

Sometimes it is necessary to create a render of an object with shadows on a transparent background. This occurs when you need to realistically embed a 3D into the photo or when creating an image to use it as a sprite in a computer game.

There is no special shader in Blender, like “Shadow catcher” in 3D Studio Max, which remains transparent display shadows. However, it is possible to achieve the desired result.

Let’s consider how we can get a shadow render on a transparent background using Blender:

Binding to timeline frames

Sometimes when creating an animation it is necessary to perform some actions according to the timeline or, the same, to the current animation frame number. Binding animation to timeline frames in Blender is possible using the built-in Python API.

As an example, let’s make a simple animation which turns one of the letters of any text from lowercase to uppercase in series.

Fighting with gradient aliasing when saving image as JPG

Background with simple gradient can greatly improve the final image. For example, a heart with gradient background looks like significantly better than the same heart with white background.

However, if you need to save such image as JPG, the gradient becomes aliased that fails the impression of the image. That problem is named “banding”. Is it possible to defeat the gradient aliasing?

Combining color and clay renders

For an effective portfolio demonstration, there is a good practice to show together with the color render the clay render to emphasize scene volume, lighting, models topology, as well as, in the case of photo-realistic rendering, showing scene “3D-essence”. The overlaying of these two renders in the same image could be an even more spectacular trick.

Overlayed render