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:
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
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:
So the model doesn’t seem to hold texture information, but even after setting it manually it doesn’t get mapped properly.
December 6, 2022, 9:19pm
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
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
There are no messages from loading the actor.
December 6, 2022, 10:38pm
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.
December 6, 2022, 11:02pm
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?
December 6, 2022, 11:57pm
Fixed this using blend2bam’s
December 7, 2022, 11:24am