/blender-auto-palette

A Blender addon that combines separate materials into palette textures, suitable for glTF export.

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

Auto Palette

A Blender addon that combines separate materials into a single material with palette textures. The output follows the metal/rough PBR workflow compatible with glTF 2.0.

Limitations

Currently limited to use with Principled BSDF materials with unconnected input sockets.

Installation

Go to Edit -> Preferences, select Add-ons and press the 'Install...' button, then browse to the auto_palette.py file.

How to use it

Make sure that the object you want to use is active, and go to the material properties window. The object in this example has several materials (all principled BSDF) with varying color, metallic, roughness, and emission values.

image

Scroll down in the material properties window and you will see the Auto Palette panel, press the button to start generating the textures.

image

When the textures have been generated, the materials will be replaced by a new 'Palette' material.

image

This material will be set up to use the generated palette textures.

image

The UV mapped palette textures will look like the images below. The image dimensions will be the smallest possible power of two that fits all material values, in this case 4x4 px.

Color Roughness + Metallic Emission
image image image