Creating separate elements of procedural textures in Blender is quite simply – find the desired formula, rebuilt it using mathematical nodes, and as a result, get the desired shape. However, textures created this way have one feature – no tiling. Tiling – a cyclic texture duplication, most time is considered harmful, and professional 3D artists try to avoid texture tiling. But sometimes tiling is necessary, for example, when creating patterns or ornaments.
The procedural texture element is always created in a single instance. This is because all the mathematics that forms the actual procedural image is based on the initial data – coordinates that start from 0, spread out to infinity and not repeat. However, the same mathematics helps us to solve this problem.
All procedural textures in Blender are based on math. Even such irregular structures as “Voronoi” and “Noise” are actually generated according to the mathematical formulas. An exact mathematical algorithm is sewed up into each base material node to obtain the desired image as a result.
We can not specify such algorithms in Blender in the usual mathematical format. However, among other nodes, Blender provides us the “Math” nodes – the wrap over simple mathematical operations. Using these nodes we can build complex mathematical algorithms yourself, generating interesting textures.
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.
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.
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.
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.
One of the distinguishing Blender features is that many things can be performed in various ways, choosing the most convenient and fastest for your taste. For example, a screw can be created not only by drawing the profile of its teeth. Let’s try an alternative way:
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.
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.
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.
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:
Sometimes it is necessary to add a single modifier to each part of some complex object. The easiest way is to cycle part by part through all the object and add the desired modifier to each its part manually. But if the object consists of many parts, it will take a lot of time.
There are some ways to greatly facilitate this work:
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.
Blender add-on allowing to interrupt the rendering process and resume it from the interrupted place. For those who are not able to have the powered-on computer for render for a long time.
For example, the whole image render takes 12 hours. And there is no way to have the computer powered on all the time, but it is possible to power it on for 5 hours with breaks. If you interrupt the standard rendering process to turn off the computer – next time render starts from the beginning, and all progress is lost. PartitionRender add-on allows dividing the image into several blocks – partitions, each of them is rendered separately. Choosing division by X and Y in 2 parts, the image is divided into 4 blocks. Each of them will be rendered about 3 hours that fit in the time to work. Each partition after rendering saves to file. The next time (after rebooting the computer) PartitionRender automatically continues with the partition on which the break occurred. After finishing all partitions renders, partitions automatically compile to the whole image in compositing.
In the development of add-ons, their modules should be abstracted as much as possible. For a very simple reason – functional, created for a current add-on, will likely need in the next add-on, and possibly not even in one. In the add-on release, the problem of accessing to such common functionality modules is easily solved – all the necessary modules are included in a single package and distributed together. However, during the add-ons development, such modules are much easier to store separately, in one instance, without associating them with any particular package, and import if necessary the desired modules to the desired add-on.
In accordance with the packages import rules, Python allows to refer modules in the following ways:
In the development of complex add-ons with large code volume storing all the code in a single file is inappropriate. When a single file contains logically unrelated classes, functions, and datasets, it is difficult to read, debug, find the necessary code pieces, reuse code. Such code layout is considered as very bad programming tone.
Blender Python supports modular system that allows subdividing logical code parts of the add-on into different files, and then connect them to use. Even if you have never thought about modules, creating scripts or add-ons, you have already used them – any code stored in the *.py file is a separate independent module. Just your addon consists of only one module. Complex add-ons may consist of several tens of modules.
Sometimes when debugging scripts or add-ons, errors not only interrupt the code execution but also causes the complete closure of Blender together with its system console. This case its impossible to check errors and view errors messages.
To find a failure, Blender can be started from the command line interpreter cmd. In this case, Blender output log is redirected to the cmd window which, when the program falls due to errors, not closed. If Blender closes all error messages stay available to check in the cmd window.
To start Blender from a command line interpreter:
Start the interpreter ( “Start” – Run – cmd)
In the cmd window type the full path to the installed Blender. For example: C:\”Program Files”\blender-2.78a-windows64\blender.exe
Part of the way contains spaces must be enclosed in double quotes – like “Programm Files” in this example.
We create spherical surfaces often in the modeling workflow. It would seem that the sphere is the simplest object to model and any three-dimension editors, including the Blender, provides a default sphere in a set of basic primitives – just add it to the scene. However, is it really so easy to create a beautiful sphere?
One of the essential conditions of comfortable work is the convenience and speed of accessing add-ons functional. It is not enough to write add-on and register it in Blender API system. Be sure to give the easily call add-on functions ability to user. So, any addon should determine a place to put interface buttons that provide access to its functionality.
All available Blender user interface located on panels. Three panels are the most used: T-bar – opens/hides by pressing the t keyboard button, N-bar – opens/hides by pressing the n button, and the Properties panel – called in the main menu of any window typed it as Properties.
Blender API allows to define users panels to place add-on functional buttons on any of this three main panels.
Blender scripting system provides lots of opportunities to simplify and accelerate the workflow, allowing to outsource routine operations to the system and expanding work opportunities through access to the scripting language. However, writing a good script which can be used frequently in various projects, uncomfortable each time to reconnect it to each new project. In addition, this script can be improved with some windows and editable parameters fields. Making complete add-on from the script, you can expand it with additional functionality and connect to the Blender add-ons system.