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:
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
Last edited by bepeg4d on Sat Dec 29, 2018 5:48 pm, edited 5 times in total.
Hi, thanks man yes I could try to have a look at it, it's already on my todo list, but I have to confess that I already have several Lua projects opened that I must to close first, sorry If you are not in a hurry, I will certainly do it sooner or later ciao beppe
I am trying to get it working in Octane for Unity and it does not seem to register my scene.
I am getting the following error: [string "Baking Graph_3.02.lua"]:281: Cannot get connected attribute via pin.
This is likely because my Scene is not an OBJ, but a reference to the Unity Scene. Would it be possible to adapt the script to work with Unity? Or perhaps I am just doing something wrong.
In Unity, my geometry is already split by UVs. So each object is unwrapped on a single UV.
I am trying to find an efficient way to: -Assign a unique Bake ID to every single piece of geometry in Unity -Create a render target in Unity for the Denoised Diffuse channel -Render these images using the Batch Renderer through Unity -Create a Unity Material for each rendered map and assign the map to diffuse and emissive textures of the material -Assign these new materials to the appropriate objects in Unity
Hi, I have updated the script to make it working also with v4 in the first post. The script is designed to work with Octane Standalone, sorry I cannot help with Unity, better to ask in the proper section of the forum: viewforum.php?f=129 ciao Beppe