Blend2bam lightinf

i tried to export animations using blend2bam and when i load the model i do not get the same lighting that i get from .egg file i get a dark one


What happens if you apply a light to the model?

in blender you mean ?

Ah, sorry, that was unclear, wasn’t it? ^^;

No, I mean in Panda.

i tried this but it gives wierd colors

self.ambientLight = AmbientLight(‘ambientLight’)

self.ambientLight.setColor((0.8, 0.2, 0.2, 1))

self.ambientLightNP = self.render.attachNewNode(self.ambientLight)


What sort of weird colours?

For what it’s worth, you are setting that light to be red, I believe.

yes it red now i did not find the best light to test with it

Why not just make the light white?

i tried it now and i got the same object with nothing new

Do you mean that parts of the object are still black?

yes still like that


Okay, in that case it might be worth checking whether the relevant textures are in their expected places. And perhaps even examining the TextureAttribs on the nodes within the loaded model.

Another thought: How is the model displayed by PView?

i got the same thing with pview i do not know if blend2bam has problems with that

I’m afraid that I don’t use blend2bam, so I don’t know much about its features.

But again: Have you checked the textures?

how can i check them ?

First of all, look in any texture directories that you might be using. Are all of the textures present there?

And second, call “findAllTextures” on your model, and see what textures are being applied and whether they’re valid.

(There may be other things that you might do, too; I’m not sure.)

i converted the .blend file using this line of command
blend2bam --pipeline gltf --animations separate RiggingShapekeys.blend rig.bam

it returns only the mesh and the animations with no texture folder

and i tried to give a folder of textures using this line of command but it gives an error :

blend2bam --pipeline gltf --textures tex --animations separate RiggingShapekeys.blend rig.bam

blend2bam uses PBR materials by default, which the built-in auto-shader doesn’t handle. You can either use simplepbr to properly render PBR materials, or you can have blend2bam attempt to convert legacy materials with -m legacy. Also, --pipeline gltf is already the default and does not need to be specified.

1 Like

thank you