I was working on a tutorial on model import when it is done and after getting familiar with the add-on a little, I will make a tutorial on this add-on too
One suggestion I can make is saving the solid colors as textures too when exporting them. Currently, when I export a scene, if a mesh has a solid color as texture, its texture is not exported.
Here is a script I use to export solid colors as 1 pixel texture image which may help:
import bpy
import os
import shutil
# Set your export directory here
export_dir = r"C:\YourExportDirectory" # Change this to your desired path
os.makedirs(export_dir, exist_ok=True)
def save_color_texture(color, name, export_dir):
# Create a new image
img = bpy.data.images.new(name=name+"_color", width=1, height=1)
# Set pixel color
img.pixels = [color[0], color[1], color[2], color[3]]
filepath = os.path.join(export_dir, f"{name}_color.png")
img.filepath_raw = filepath
img.file_format = 'PNG'
img.save()
print(f"Saved flat color texture: {filepath}")
bpy.data.images.remove(img)
# Iterate over selected objects
for obj in bpy.context.selected_objects:
if obj.type == 'MESH':
for mat_slot in obj.material_slots:
mat = mat_slot.material
if mat and mat.use_nodes:
has_texture = False
for node in mat.node_tree.nodes:
if node.type == 'TEX_IMAGE' and node.image:
has_texture = True
image = node.image
filepath = bpy.path.abspath(image.filepath)
if os.path.exists(filepath):
dest_path = os.path.join(export_dir, os.path.basename(filepath))
shutil.copy(filepath, dest_path)
print(f"Exported: {dest_path}")
else:
dest_path = os.path.join(export_dir, image.name + ".png")
image.save_render(dest_path)
print(f"Saved packed image: {dest_path}")
if not has_texture:
for node in mat.node_tree.nodes:
if node.type == 'BSDF_PRINCIPLED':
base_color = node.inputs['Base Color'].default_value
save_color_texture(base_color, mat.name, export_dir)
print("Texture export complete.")
I’m excited to share a major update to Reforge (v0.6.0) — an open-source Blender add-on & extension designed to streamline exporting 3D scenes, prototypes, materials, and collisions directly into your Defold projects.
Since the initial release, the tool has evolved significantly to solve real-world 3D pipeline headaches in Defold. Here is a breakdown of what’s new in v0.6.0:
Key Highlights in v0.6.0
1. Native Support for Defold Illumination & Multi-Sampler Models
If you use Astrochili’s popular Defold Illumination forward-shading library, you know the pain of configuring 5 texture samplers per model by hand (and remembering to plug /illumination/textures/empty.png into every unused slot so the shader doesn’t crash).
Reforge now automates this completely! When your material points to /illumination/materials/model.material:
DIFFUSE_TEXTURE: automatically mapped from Principled BSDF Base Color (or baked albedo).
DATA_TEXTURE: automatically points to /illumination/textures/data.png.
LIGHT_TEXTURE: extracted from Emission socket (or /empty.png).
SPECULAR_TEXTURE: extracted from Specular / Roughness (or /empty.png).
NORMAL_TEXTURE: extracted from Normal (with automatic traversal through Normal Map nodes to locate the source image!).
All unlinked slots are automatically safely filled with /illumination/textures/empty.png.
2. In-Engine Color Texture Baking (Cycles EMIT)
Blender’s standard glTF exporter cannot export procedural textures, color ramps, vertex colors, or layered paint graphs like Ucupaint.
Reforge now includes an automated background baking pipeline:
Bakes pure albedo via an unlit Cycles Emission pass (no lighting/shadow artifacts).
Automatically isolates material slots to prevent Blender’s “No active image found” errors.
Solid Color Fallback: If a mesh doesn’t have UV unwrapping but uses a solid color, Reforge outputs a clean, lightweight 1×1 PNG instead of failing.
Configurable per material (enable/disable, custom resolution 512–4096, and padding margin) directly in Blender’s Material tab.
3. Non-Destructive Scene Re-exports
Previously, re-exporting a .collection would wipe out your manual changes in Defold. Reforge now parses the existing collection and safely preserves:
Instance component_properties (script properties, uniforms, tints set in the Defold Editor).
4. Sub-Collections & Group Pivots (defold_group & group_center)
Tag objects with defold_group = "name" to organize instances under named embedded groups in Defold (root -> <group_name> -> instances).
Mark any object as group_center = True to act as the group’s pivot. The group in Defold receives the world transform of the center object, and all child instances are exported with local relative coordinates!
5. Duplicate Name Detection (detect_duplicates)
Duplicating objects in Blender creates names like Rock.001, Rock.002. With duplicate detection enabled, Reforge automatically maps them to the base prototype (Rock), exporting a single .glb / .model / .go while placing each instance with its unique transform in the .collection. This drastically cuts build size and disk space!
6. Transform Fixes & Blender 4.2+ Extensions
Origin Snap: Prototype objects are temporarily snapped to world (0, 0, 0) during .glb export, eliminating double-transformation offsets in Defold instances.
Blender 4.2+ Ready: Packaged as a native Blender Extension (blender_manifest.toml) with one-click installation and automatic updates via Blender’s extension repository.