Game Baker v1.0 released!

Hello everyone!

I’m pleased to announce an addon I’ve been working on for a while. It’s a baking addon where I’ve tried to streamline the process of baking as well as ease of handling the bakes afterwards, in the node editor. More than that, it handles render/baking settings in an optimal way so the bakes are much faster than with default blender/cycles. The Addon is still in development, but you can get a short introduction of its current state here:

----UPDATES----

0.95.1 Update:

  • Cleaner and more responsive UI
  • Export functionality: Choose between pack/export
  • Automatically add material if none exists
  • Queued baking with partial feedback

1.0 update:

  • NEW bake types: Position, ID
  • Context aware UI
  • Higher quality bake sources
  • Export functionality: Format selection
  • Organized image node creation(Node Editor)

----ROADMAP AND FEATURES----

Ordered focus points:

  • PBR Export Presets
  • Capability of adding multiple high poly meshes
  • List of bakes with meta data(Name, res, type)

You can get the Addon here: https://gum.co/PTXvj


I’m very interested in any critique/feedback on the current state before implementing more features. However I’m writing everything down, so if there are any feature requests I’m also happy to hear! :slight_smile:

2 Likes

Problems that I see in all bake tools that don’t have one of the things

  • Multiple bake maps at same time with one click (normal, AO,…)
  • Export automatically all textures to a external folder at same time that I bake
  • Clean UI

You have the third. But not the first and second.

Good points. I will be looking into both. Thanks

  1. Multiple bake maps at same time with one click:

There is the addon “MeltDown”. Amazing tool except a bit clunky and buggy.

  1. Export automatically all textures to a external folder at same time that I bake:

def save_image(data, obj, scene):
    path = Pref.blendPath()
    size = Pref.bake_size()
    a = 0

    f_name = '_'.join([obj.name, data.img_type])
    f_path = os.path.join(path, f_name + '.png')
    while os.path.exists(f_path):
        a += 1
        f_name = '_'.join([obj.name, data.img_type, deci(a)])
        f_path = os.path.join(path, f_name +'.png')

    image = bpy.data.images[_img + _active]
    image.filepath_raw = (f_path)
    image.file_format = 'PNG'
    image.scale(size, size)
    image.save()

Most importantly, find the path to your relative Blender file.

Secondly, create a path including the “…\baked_image.png” part.

Check if such file already exist, therefore it grants the option to overwrite or version control.

Get the image you wanted to save as a ‘image’ variable/pointer, then image.save(), in my code, I used the image’s name to find the correct one.

Run this function after each “bpy.ops.object.bake_image()” code and make sure the correct image is passed in. There it is, automatic exporting.

If you fancy a specific image format and the image color depth, use image.save_render(context.scene, ???) with proper output settings.

Btw, automatically creating the materials for the user would be a big plus. At least that’s what I’m doing with my own script, but I haven’t figured out how to do it with Cycles. Though, with Blender Render, here is the example code:


# the parameter "data" is a specific class type I use to store settings for each type of bakes.

def set_material(data, objects):
    if hasattr(data, 'mat_name'):
        mat = bpy.data.materials.get(data.mat_name)
        if mat is None:
            mat = bpy.data.materials.new(name = data.mat_name)
            if hasattr(data, 'mat_emit'):
                mat.emit = data.mat_emit
            if hasattr(data, 'mat_albedo'):
                mat.diffuse_color = data.mat_albedo
            if hasattr(data, 'mat_specular'):
                mat.specular_color = data.mat_specular


        for obj in objects:
            obj.data.materials.clear()
            obj.active_material = mat
        return True
# these returns doesn't mean anything.  It's for error handling and laziness.
    else:
        return False

def clear_material(objects):
    for obj in objects:
        obj.data.materials.clear()

Cycles use nodes, which adds a layer of complexity and I haven’t figured out yet.

When 2.79 actually releases, It’s possible to save material linking data before setting the material and when the bake is done, re-link the original materials back onto the objects. IDproperties, wink wink.

Keep up the good work mate, Yours could save me a lot of time.

I think that I preffer save each image before use text scripts.

I’m only giving some examples for Derphouse as helps to automate the process. None of the code is even runnable in the text editor without adding probably 3 times more lines.

Why would I give you a text script for you to run manually, when you clearly wanted an automatic process? LOL

The people is weird sometimes, also you was replying me.

Hmmmm…

I used the “Reply with Quote” option just to save some time for manually quoting the points I’m talking about. Sorry for causing the confusion. Did you get a notification that I replied to you? I’m new on this forum and has never received any notification from people who quoted me, I assumed it would be the same for others if I quoted someone else.

Meant to use the points you made to help the OP. Probably better for me to use less of the term “You”. Again, sorry about that.

No, you don’t cause any problem. And the forum don’t have notifications for quotes. I only confuse the reply.

@TeaCrab Hey! Thanks for the suggestions. I’ll have a look at it when I get to those features :slight_smile: Appreciate the effort!

I just bought it , like it ! Big thanks your hard work .

Is it bossible to add your “GradientPainter” addon to Game Baker ? It is very useful when we need bake gradient map !

“thickness map” is also needed.

Maybe Game Baker also can bake more type maps for us , not onlly albedo but also metalic ,specular,roughness ,now we have principled BSDF . LowPoly can bake more maps from the shader not from HighPoly.

Glad you like it! :slight_smile:

I am researching thickness map, which I can’t promise will come soon, simply because AFAIK all you have in blender is the SSS node, which requires a lot of samples to get a decent bake. I am still trying to figure out if I can somehow get the inverse normal length till the penetration of the mesh, that would be much faster, but a bit too complicated to hit the top of the list for now.

I intend to have both ID and Position maps in fairly soon. In regards to metallic, spec, rough. I will be looking into the new principled BSDF and see what I can do. I will wait for the final release before getting to work on that though.

I do not think I’m going to add the painter to the baker. At least not for now. but I can definitely have a look at making minor changes that could improve the workflow greatly. Technically if you use the painter, you can just bake an albedo map, since that would give you the gradient.

Thanks for your reply!!

Another question ?
Game Baker support 16bit map ?

I’ll have a look into exposing some image quality settings :slight_smile:

Good point!

[B]0.95.1 Update:

[/B]

  • Cleaner and more responsive UI
  • Export functionality: Choose between pack/export
  • Automatically add material if none exists
  • Queued baking with partial feedback

Hi there,

I’m super happy with the addon and looking foward to see more updates, here are some ideas and problems i have been getting while using the addon.

1-Baking curvature gives poor results, when i apply a coloramp to clamp values the image shows lost of banding.

2- Would be great to add the option to bake light, can be done by just adding direct and indirect options into the albedo bake.

3- Baked images can only be packed as png?

Thanks for this great addon, makes things so easy.

Thanks a lot! I’m glad you’re finding it useful :slight_smile:

You raise a very valid concern, thank you for that. I looked into the quality of the bakes, and technically they are getting packed pre-baking. This is actually a minor work around so baking doesn’t freeze blender until the bakes are done. That being said, by your example, and doing some testing myself, I can see that the resulting bakes are not worth the sacrifice. What it means is that next update will have improved quality of bakes, but it also means reduced interface feedback. At least until I figure out how to properly solve that problem.

Images that are edited can only be packed as png yes, so that I cannot change sadly. Although packing bakes afterwards should not reduce the quality as far as I can see. I’m fairly certain it was only due to the ‘trick’ mentioned above. However, I will clarify in the tooltip that it packs as PNG.

I will look into doing diffuse bake rather than albedo, and have a color/albedo setting along with direct and indirect light. Makes sense :slight_smile:

Cool addon!
Thank you!

@brothermechanic Glad you like it :slight_smile:

@lynchon I might have spoken a bit too soon as far as the PNG packing not reducing. It’s quite clear that it does. I’ll make sure that exports will be higher quality, but as far as packing goes, I cannot adjust the quality there.