Textures missing when exporting from blender to gltf/glb

Hello Team!

Thank you for the wonderful engine. I am sure this is my lack of experience with 3d data formats. When I try to export a model from blender to gltf/glb, its missing its textures.
GLB in engine:

Blend2Bam also wont work with this error:
SystemError: GPU API is not available in background mode

Thanks for the assistance.

From Blender:

And fun render because its cute:

1 Like

Im guessing it has something to do with the materials. I also tried with simplepbr. No dice.

Ohhh it seems this may be related:

I see this in the docs now.

Alright so it looks like the importer for Ldraw formate (i build this in a lego cad program) creates a material called “Lego Standard”, but, it is indeed a principled BSDF to a material output surface.

While I could look into importing LDraw format directly into panda. I use blender for polygon optimization (removal of unseen studs etc) and want to animate with it. So any help would be very much appreciated. Thanks.

Very interesting to note that it appears the materials in the gltf are lacking fields. I export a basic cube with principled bsdf and the tuxWing.gltf, in tux, its missing parameters.




Yup, so once the lego standrd material was ungrouped and directly output, it looks like the parameters are present and the material rendering.

Screenshot from 2023-07-08 23-41-49

Maybe this will help others in the future debug there issues. I suppose what I will have to do now is fix the importer for my use case and or script an ungroup loop that stored the original color. Probably both are dooable cheers!

And we have liftoff! Learned alot about the blender api as well.

If anyone needs the bare bones script:

import bpy

# Run through all materials of the current blend file
for mat in bpy.data.materials:
    if mat.node_tree:
            output = mat.node_tree.nodes["Material Output"]
            group = mat.node_tree.nodes["Group"]
            group2 = mat.node_tree.nodes["Group.001"]
            r,g,b,a = group.inputs['Color'].default_value
            bsdf = mat.node_tree.nodes.new(type="ShaderNodeBsdfPrincipled")
            bsdf.inputs["Base Color"].default_value = (r,g,b,a)
            mat.node_tree.links.new(bsdf.outputs["BSDF"], output.inputs["Surface"])