Page 1 of 1

Baking Graph with Lua script v 3.02

PostPosted: Fri Feb 19, 2016 1:55 pm
by bepeg4d
Hi all,
here is a new version of the Baking Graph Lua script to speed up the baking process with Octane Render v3.
I have updated the script to work with v3 beta 2 and above:
(17.22 KiB) Downloaded 591 times

Previous version for v3 between alpha 1 and beta 1:
(17.8 KiB) Downloaded 322 times

This time, the idea is to select only a render target node already set up previously, and then run the script. The result should be a new node graph with a copy of the selected Render Target and all the nodes connected to it and all the necessary additional nodes to automate the baking process.
For every material pins of any mesh node connected to the selected Render Target node, the script generate an object layer node and a new Render Target with a specific baking camera node with proper attributes.
In this way the original scene is not touched and we can modify the render settings in one go because all the new Render Target nodes shares the same nodes (except for the camera pin that has a specific baking camera node for each Baking group).
There are some limitations:
    If the script is executed with a version of Octane Render v3 prior than Alpha 4, a dialog will appear informing that all the displacement nodes will be disconnected because they are not supported by the first v3 versions.
    if the .obj node doesn't have a proper .mtl file or doesn't have any material group information, the script generate a Render Target node for every object of the mesh node, not per material.
    The Alembic mesh nodes are a bit more tricky to manage, and for now, the script generate always a Render Target node for every object of the Alembic mesh node, not per material.
    The mesh nodes cannot be grouped in a different node graph and must be ungrouped before running the script, an error message should inform you about this issue if necessary.
For the above reasons, it should be preferred to use .obj nodes with proper mtl file if possible.

Every objects in any mesh node must have a proper unwrapped UV without overlapping for a correct baking result.

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, a dialog window should inform you about the baking render target created:
baking_graph_3_01_results.jpg (16.34 KiB) Viewed 5881 times

or if an alembic or obj node without material group information was found:

then double click the new node graph just below the render target previously selected:
baking_graph_3_01_double_click.jpg (15.77 KiB) Viewed 5881 times

At the center of the node graph should be visible an annotation node that stores all the materials names with the proper baking ID, a generic copy of the render target just above and a group that stores all the baking render targets:
baking_graph_material_ids.jpg (15.22 KiB) Viewed 5881 times

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 tried the script in different scenarios and it seems to work correctly in all of them, but probably I have not found all the possibility :roll:
Please, let me know of any issue or comment and critics, your feedback is greatly appreciated, thanks :)
Happy baking :)
ciao beppe

Re: Baking Graph with Lua script v 3.01

PostPosted: Wed May 18, 2016 2:46 pm
by bepeg4d
I have updated the script to work with v3 beta 2 and above in the first post ;)
happy baking,
ciao beppe

Re: Baking Graph with Lua script v 3.02

PostPosted: Sun May 29, 2016 7:04 pm
by Jolbertoquini
Great script thanks a lot Beppe :D

Re: Baking Graph with Lua script v 3.02

PostPosted: Tue Jun 07, 2016 12:46 pm
by Jolbertoquini

Is not working at Octane 3 and I use a export from maya.
gives error render node need be select when they are selected.
very best,


Re: Baking Graph with Lua script v 3.02

PostPosted: Tue Jun 07, 2016 2:05 pm
by bepeg4d
Hi Jolbertoquini,
the script is working here, please, could you share a simple example orbx file (or ocs with geometry and textures) that shows the issue?
It would be very useful, thanks :)
ciao beppe