Baking Graph with Lua script v 3.02

Forums: Baking Graph with Lua script v 3.02
Forum for OctaneRender Lua scripting examples, discussion and support.

Baking Graph with Lua script v 3.02

Postby bepeg4d » Fri Feb 19, 2016 1:55 pm

bepeg4d Fri Feb 19, 2016 1:55 pm
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:
BakingGraph_3.02.lua
(17.22 KiB) Downloaded 933 times

Previous version for v3 between alpha 1 and beta 1:
BakingGraph_3.01.lua
(17.8 KiB) Downloaded 533 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.
baking_graph_3_01_default_settings.jpg

After the script has been executed, a dialog window should inform you about the baking render target created:
baking_graph_3_01_results.jpg
baking_graph_3_01_results.jpg (16.34 KiB) Viewed 7992 times

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

then double click the new node graph just below the render target previously selected:
baking_graph_3_01_double_click.jpg
baking_graph_3_01_double_click.jpg (15.77 KiB) Viewed 7992 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
baking_graph_material_ids.jpg (15.22 KiB) Viewed 7992 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.
baking_graph_3_01_batch_rendering.jpg

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.
https://vimeo.com/155954955
[vimeo]http://www.vimeo.com/155954955[/vimeo]
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
Last edited by bepeg4d on Wed May 18, 2016 2:46 pm, edited 1 time in total.
User avatar
bepeg4d
Octane Guru
Octane Guru
 
Posts: 9940
Joined: Wed Jun 02, 2010 6:02 am
Location: Italy

Re: Baking Graph with Lua script v 3.01

Postby bepeg4d » Wed May 18, 2016 2:46 pm

bepeg4d Wed May 18, 2016 2:46 pm
I have updated the script to work with v3 beta 2 and above in the first post ;)
happy baking,
ciao beppe
User avatar
bepeg4d
Octane Guru
Octane Guru
 
Posts: 9940
Joined: Wed Jun 02, 2010 6:02 am
Location: Italy

Re: Baking Graph with Lua script v 3.02

Postby Jolbertoquini » Sun May 29, 2016 7:04 pm

Jolbertoquini Sun May 29, 2016 7:04 pm
Great script thanks a lot Beppe :D
Octane Render for Maya.
https://vimeo.com/jocg/videos
https://www.linkedin.com/in/jocgtd
http://www.hmxmedia.com/
--------------------
Join MAYA OCTANE USERS Skype discussion here :
https://join.skype.com/LXEQaqqfN15w
User avatar
Jolbertoquini
Licensed Customer
Licensed Customer
 
Posts: 1067
Joined: Sun Aug 31, 2014 7:08 am
Location: London

Re: Baking Graph with Lua script v 3.02

Postby Jolbertoquini » Tue Jun 07, 2016 12:46 pm

Jolbertoquini Tue Jun 07, 2016 12:46 pm
Hi

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,

JO
Octane Render for Maya.
https://vimeo.com/jocg/videos
https://www.linkedin.com/in/jocgtd
http://www.hmxmedia.com/
--------------------
Join MAYA OCTANE USERS Skype discussion here :
https://join.skype.com/LXEQaqqfN15w
User avatar
Jolbertoquini
Licensed Customer
Licensed Customer
 
Posts: 1067
Joined: Sun Aug 31, 2014 7:08 am
Location: London

Re: Baking Graph with Lua script v 3.02

Postby bepeg4d » Tue Jun 07, 2016 2:05 pm

bepeg4d Tue Jun 07, 2016 2:05 pm
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
User avatar
bepeg4d
Octane Guru
Octane Guru
 
Posts: 9940
Joined: Wed Jun 02, 2010 6:02 am
Location: Italy

Return to Lua Scripting


Who is online

Users browsing this forum: No registered users and 14 guests

Thu Mar 28, 2024 9:51 am [ UTC ]