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