Moguri / blend2bam

A CLI tool to convert Blender blend files to Panda3D BAM files
MIT License
66 stars 17 forks source link

Textures not loading when loading .blend files, but glTF works #85

Closed izzyboris closed 11 months ago

izzyboris commented 1 year ago

blend2bam: 0.21 (Python 3.11 pip) Blender: 3.6.0, 3.3.9, 2.9 (tried all three with --blender-dir) Panda3d: 1.10.13.post1

Textures added in Blender do not load or display in Panda3d or pview; model appears blank.

Import/conversion runs without logged errors. Defaults to Blender 3.3.9, but all three versions noted above have been tried with manual conversion to .bam. Also tried using '--texture embed' explicitly and other --texture options with no change.

However, exporting the same .blend model using Blender (all three versions) to .gltf/.glb first does display the texture properly in both Panda3d and pview.

To reproduce:

1x1base.zip 1x1base

Moguri commented 1 year ago

I suspect this is actually a duplicate of #78.

Moguri commented 1 year ago

Taking a closer look at this, the default --textures ref does not work with packed textures, which I suppose makes sense. However, when I use --textures embed, it works for me using pview.

izzyboris commented 1 year ago

I confirmed that '--textures embed' does work and textures appear normally either when the .blend file either packs or references the original texture. However the textures don't load when using either 'copy' or 'ref', even with the .blend file using an unpacked texture, at least with Blender 3.6. Same behavior was seen both in a test driver program and also pview.

Tested this running blend2bam to pre-convert to .bam and load the .bam file explicitly.

Since 'ref' is the default texture mode, is there any way to default blend2bam to 'embed' mode when importing models on-the-fly at runtime?

Moguri commented 1 year ago

--textures copy is also working for me, but only with a dev/master build of blend2bam.

There probably is a way to auto switch to embed when using ref on packed textures. However, I plan to switch the default to copy here soon since it works in more situations.

jez-moxmo commented 10 months ago

not sure if I can post in closed comments but I think blend2bam is where my issues stem. I am having a hard to applying textures to a rigged model. As soon as there are geoms, it seems like it's difficult to apply textures. I don't know if this is related to this issue or it's something with the bam2egg process. Either way it's giving me a migraine.

Moguri commented 10 months ago

@jez-moxmo It's probably better to open a new issue and further explain the issue you are running into along with a way to reproduce the issue (ideally a blend file that shows the problem).