I've been working on automating lightmapping in Unity with a few developers for the last 5 months. We are almost done our workflow, but there are a few blockages.
This is our overall workflow for the script:
-- In 3ds Max --
1 Split the object into maximum 18,000 pieces and rename the new pieces in a logical manner (Art001, Art002, etc). This is done because UV mapped objects in Unity over a certain amount of triangles cannot receive baked maps.
-- In Unity --
2a Set a baking ID for each geometry object
2b Create a backing camera for each individual object
2c Give the camera a logical name (Cam-Art001, etc)
2d Place all cameras in a "Camera" empty object for organization purposes
2e Set the appropriate baking ID for each camera to match the Object Baking ID
-- In Octane --
3 The user batch renders the baking cameras
-- In Unity --
4a Look into the rendered image folder
4b For each images create a material and assign the image to the albedo and self illumination slot
4c For each new material, go assign it to the associated object in the scene
(We may also implement a material shell switcher to part 4 )
-------
The main problem is that there is a loss of information between Unity and Octane.
In step 2a, we cannot set the Baking ID of the geometry with a script. The API does not allow it.
In step 2e, we cannot set the Baking ID of the camera with a script. The API does not allow it.
In step 3, we cannot render the images in a logical manner because the names of the cameras are lost in Octane and become "PBR Render Target, PBR Render Target (2), PBR Render Target (3)" in a seemingly random order compared to the camera creation order, Ideally the names of the cameras would flow from Unity to Octane so that we would get a render name like "Cam-Art001_Denoised beauty".
Could you help us out in our quest for automated lightbaking in Unity with Octane? I'm hoping to finish automating this in the next 1.5 months.