Texture not appearing on model (blend2bam)

I’m trying to import a custom model into Panda3D by modelling and/or importing in Blender and turning them into .bam files with blend2bam. Here’s how my model looks in Blender with the texture settings I’m using:

I save the .blend file to my project folder and convert it to a .bam file (in the same folder) using blend2bam, using only the required arguments (src and dst).

Here’s the result:

Screenshot 2022-12-07 at 8.10.55 am

This is in an empty project, the entire game’s code is this:

from direct.showbase.ShowBase import ShowBase
from direct.actor.Actor import Actor

class App(ShowBase):
    def __init__(self):
        self.player = Actor("assets/models/player.bam")

app = App()

It seems to not load the texture at all. Furthermore, if I set the texture manually with set_texture, it looks like this:

Screenshot 2022-12-07 at 8.13.40 am

So the model doesn’t seem to hold texture information, but even after setting it manually it doesn’t get mapped properly.

Any ideas?

Were you seeing any messages during the blend2bam process?

Were you seeing any messages when loading the .bam model for the first time (ie. before it was cached to the model-cache)?

This is all I’m getting from the blend2bam output, nothing to me appears like an error:

mak@Lukes-Mac-mini sm64clone % blend2bam src/assets/models/player.blend src/assets/models/player.bam
Auto-detected Blender installed at /Applications/Blender.app
Blender 3.3.1 (hash b292cfe5a936 built 2022-10-04 23:46:43)
Read prefs: /Users/mak/Library/Application Support/Blender/3.3/config/userpref.blend
srcroot: /Volumes/Data/dev/python/sm64clone/src/assets/models/
Exporting: ['/Volumes/Data/dev/python/sm64clone/src/assets/models/player.blend']
Export to: /var/folders/x1/256jh89563l_rtwhsnw6kmlm0000gn/T/
Read blend: /Volumes/Data/dev/python/sm64clone/src/assets/models/player.blend
Converting .blend file (/Volumes/Data/dev/python/sm64clone/src/assets/models/player.blend) to .gltf (/var/folders/x1/256jh89563l_rtwhsnw6kmlm0000gn/T/player.gltf)
21:41:12 | INFO: Draco mesh compression is available, use library at /Applications/Blender.app/Contents/Resources/3.3/python/lib/python3.10/site-packages/libextern_draco.dylib
21:41:12 | INFO: Starting glTF 2.0 export
21:41:12 | INFO: Extracting primitive: characterMedium
21:41:12 | INFO: Primitives created: 1
21:41:12 | INFO: Finished glTF 2.0 export in 0.020967960357666016 s

Blender quit

There are no messages from loading the actor.

It looks like blend2bam doesn’t work with newer versions of Blender. I was using version 3.3.1 in that screenshot, but using the 2.83 LTS version worked. My guess is it also works with 2.9 since that’s what it says on blend2bam’s GitHub page, but I haven’t tested that.

There’s one more thing I’d like to ask about, however. The texture appears way darker in Panda3D than it does in Blender. Why is this?

Fixed this using blend2bam’s --no-srgb flag.

See this page:


1 Like