Hi all,
here is a Lua script to speed up the baking process with OctaneRender v3/4.
- new update to work also with v4:
-old versions-
Little update to metch to the new OctaneRender™ v3 aplha 4 version with displacement enabled during Baking:
For OctaneRender v3 Alpha 3 or below, please continue to use the old 1.9 version:
The idea is to select an obj mesh node and the render target already set up previously and then run the script. The result should be a new node graph with all the necessary copies of the original nodes to automate the baking process, in this way the original scene is not touched and we can adapt the nodes, for example disabling any displacement node in the materials since is not currently supported by the baking feature. For every pin material of the mesh node, the script generate an object layer node and a new render target with a specific baking camera with proper attributes.
If the script is opened in the Script Editor window, almost on top, it is possible to change some default values for the baking cameras, then, if the script is saved, it can be execute directly from the script menu with the desired default values.
After the script has been executed, double click the new node graph just below the render target previously selected.
At the center of the node graph should be visible the generic copy of the render target and an annotation node that stores all the materials with the proper baking ID.
By selecting the generic copy, is possible to fine tune all the settings, like resolution, render passes, kernel settings and so on. Since they are shared with all the other baking render targets, when finished, just select the default Batch rendering script to render all the textures in one go.
Note that the baking camera setting in the generic copy are not automatically transferred to the other baking render targets, the script must to be executed again with different default settings.
I have prepared a little video to better demonstrate the work flow:
[vimeo]http://www.vimeo.com/150882103[/vimeo]
https://vimeo.com/150882103
I have tried the script in different scenarios and it seems to work correctly in all of them, but probably I have not catched all the possibility
Please, let me know of any issue or comment and critics.
Happy baking
ciao beppe