Hi today I release first version of baking addon for Blender and Substance Batchtools.
I developed it for few reasons:
- speed – you can bake 8k textures in minutes
- reduced ram usage – I can bake highpoly meshes, without risk running out of ram
- I wanted to have quick way to bake complex objects made with GroupPro addon. But you don’t have to use it. This addon works for baking normal objects too.
- Easy iteration – no need to click Import/Export multiple times in blender, and your external baking app. This is usually tedious and time consuming process. All objects are exported automatically in background. Also addon is smart enough to know when object was changed, and export it only when needed.
- re-bake only parts of your texture, that were changed/updated.
- baking presets
- quick baked map texture preview inside blender
Batchtools is now called Command Line Tools. Addon work with both versions.
This addon work, by communicating with Substance
Batchtools Command Line Tools from all www.allegorithmic.com.
To install substance Command Line Tools (you get it for free if you own Substance Designer), go to www.allegorithmic.com, login and go to Download tab.
Then click on the icon, as shown in image above and grab
Substance Batchtools Command Line Tools.
After that run blender and search for ‘bake‘ phase(1). Enable Batchtools Baker, and paste path to sbsbaker.exe. In my case it was located in: ‘C:\Program Files\Allegorithmic\Substance Automation Toolkit\sbsbaker.exe’
After that you will have new tab in 3d View -> Tool shelf -> Baking.
Basic steps for baking are (make sure your blend file is saved):
- click button ‘Add Bake Job‘. Few options will popup (file path, resolution, etc)
- click ‘Add Pair‘ button, to select lowpoly mesh (with uv), and highpoly mesh.
- click ‘Add Pass‘ and select baking type you want to perform (normal, id, ao etc)
When you are done you can bake by pressing ‘Bake’ button on top. By default output directory is set to: ‘path to your blend file’/textures/‘. You can change it with Path property (just below Dilation parameter). Also you can open destination folder from blender by: shift+LMB clicking on folder icon.
‘Bake Job‘ corresponds to single UV set (one texture). When you want to bake another texture (eg. separate texture for head, and separate for body) then just add new ‘Bake Job’ for head. Each ‘Bake Job’ can bake multiple sets of high-low poly pairs and passes.
‘Pairs‘ multiple high-low poly pairs are useful when thing, that you are baking, is composed of many objects, but we don’t want them to influence each other. For example lets say body of character, has pants and shoes that are overlapping each other. Without this addon, you would have to move shoes object away from pants object, so they are not affecting each-other while baking. But with Batchtool Baker, you can just create two pairs high-low poly of objects – one for pants, one for shoes. No need to move them away.
‘Passes‘ Batchtool Baker in blender supports following passes:
- “MAT_ID” – from material color, Vertex Color, Mesh ID, Submesh ID
- “NORMAL” (Tangent and World Space, OpenGL and DirectX mode)
- “CURVATURE” – it requires normal map pass (just put normal pass bake, before/above curvature map bake)
- “POSITION” – all axis or one axis.
In addon preferences you can define suffix for each of those passes. So when your bake name is ‘head’, then your will get files like: head_ao, head_id, head_norm, etc (depending on your passes).
Each lowpoly-highpoly pair has bunch of settings.
First two fields are used for selecting your high,lowpoly objects. For highpoly you can also use group of objects or Group Instance (preferably made with GroupPro addon 🙂 ).
this button, when enabled allows you to select cage object. When disabled you can tweak forward and rear ray distance multiplier. Those values work as multipliers for main Rear and Forward ray distances defined just blow AA samples parameter. So eg. when you set rear distance to 0,02, and rear multiplier to 10, then the resulting rear ray distance is 0,2 (0,02*10).
X – deletes current low-high poly pair
Camera – disable baking of current low-high poly pair. Cool feature here is, that if you previously baked current low-high pair, and then disable it, script will use result of previous bake for new bake. This may save you some time, when you wan to re-bake only some pairs of objects, then just disable ‘Camera’ icon for not needed pairs and previous bake will be used for those.
Refresh – when enabled addon will export fbx file, with current pair of objects, on next bake. When disabled, fbx file will not be exported. Useful when working with heavy meshes, tweaking bake parameters, and you do not want to export all that heavy geometry on each small change. Actually script automatically detects any change to hipoly mesh and enables this button when needed. However there are some bugs in blender eg. if you grab hipoly object, and cancel grab command, update event on mesh will be triggered, resulting in enabling ‘Refresh’ icon, even though no geometry or position was changed. That is why, I added this manual override button, so you can disable exporting FBX file on new bake.
There are similar buttons placed on header of Pairs list:
They are here just for convenience – they allow to disables/enables exporting fbx and baking for all mesh pairs, with one click. See example:
And the last icon I wanted to explain – green icon – means baking of current baked job is enabled. If you click on it, it will become red – disable baking of bake job.
At he bottom I showed you example of how those features could be used. We have two pairs of objects:
- ‘pipe_low‘ and ‘PipeHi‘ (group of multiple objects)
- ‘cylinder_low‘ and ‘cylinder-hi‘
We see that ‘Camera’ icon is disabled for ‘pipe_low’ but it is baked into image, because addon used previous bake result for this pair of objects.
Cylinder_low – is using cage ‘cylinder_lowCage’ object. It has enabled ‘Camera’ icon – so it was baked. Also it has enabled ‘refresh’ icon, so geometry was updated with new fbx file on bake. This is very simple setup, so there is no much gain in terms of speed. But on complex models, you can introduce changes only where those are needed, without re-baking everything.
I just added object picker for highpoly, lowpoly and cage.
Update 1.03 (more info)
- added ability to bake second or next uv set (UV map)
- preview of frontal/rear ray distance
- one click cage setup
Update 1.11 (more info in this post)