Batchtool Baker

Hi today I release first version of baking addon for Blender and Substance Batchtools. You can get it here
This addon is based on Meltdown script by Piotr Adamowicz. I left the UI stuff not changed too much but I reworked the core of addon to integrate it with Substance Batchtools, fixed bugs, added new features, optimized redundant stuff etc.

I developed it for few reasons:

  • Substance Batchtools speed – you can bake 4k textures in minutes (compared to hours in blender)
  • Substance Batchtools reduced ram usage – I can bake hipoly 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.
  • Easy way to re-bake only parts of your texture, that were changed/updated. I will explain how to do this later below.

For this addon to work you have to have Substance Designer, and then install Substance Batchtools from all www.allegorithmic.com.

To install Batchtools on your PC, go to www.allegorithmic.com, login and go to Download tab.

 

Download

Then click on the icon, as shown in image above and grab Substance Batchtools.BatchToolDownload

After installing BatchTools you are good to go.
Run blender and search for ‘bake‘ phase(1). Enable Batchtools Baker, and point it (2) to sbsbaker.exe file, located in your Substance Batchtool installation folder. In my case it was located in: ‘E:\Program Files\Allegorithmic\Substance BatchTools\5\sbsbaker.exe

Batchtool Baker Addon Preferences

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
  • “AO”
  • “NORMAL” (Tangent and World Space, OpenGL and DirectX mode)
  • “UV”
  • “CURVATURE” – it requires normal map pass (just put normal pass bake, before/above curvature map bake)
  • “POSITION”  – all axis or one axis.
  • “THICKNESS”
  • “HEIGHT”
  • “OPACITY”

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 🙂 ).

Grid 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).

PairSideButtonsX – 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:

 

 

 

BakeDisable

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.

Example Batchtool Baker

Update:
I just added object picker for highpoly, lowpoly and cage.

Object Picker

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)

Advertisements

15 thoughts on “Batchtool Baker

  1. dear sir i purchased hard ops and have had trouble exporting stuff to other programs like zbrush and substance painter i have not tried substance designer will this addon help?

    • This is not addon for exporting files, but for baking textures. Hard
      Ops should not affect your exporting capabilities. But try triangulating your mesh befor exporting your mesh to zbrush. And add uv to your mesh before exporting to substance painter.

    • This addon works only with Substance Batchtools (which you can get for free If you bought Substance Designer). Everything is explained In main post above. Did you setup path to Batchtools (make sure it is absolute path). What are the errors in console?
      The bake result can be used anywhere you want (they are just image textures files – png).

      • I got it to work 🙂 and its awesome …
        but saddens me that I quickly bought it and thought that it’s ok to work without the substance (sigh) … I don’t have the substance tools yet, but glad that allegorithmic release Batchtools separate download, it dunno if it’ll work after the trial ends …

        I hope there’s the regular / internal baker for non-substance users …

  2. There is free version of this addon for baking with blender cycles but I do not have time to mantain it, so I’m not sure if it will work. https://github.com/JoseConseco/meltdown. Thing is, it was to slow for me.
    About non substance users, there is new free baking app now:
    http://www.handplane3d.com
    Maybe I will convert this addon if future, to it will work with handplane. But for now handplane is still missing some features and I’m not sure I development of handplane will continue. It would be bad if people who bought this addon, would be left with not working baking app.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s