I’ve been trying to export a transparent object (like a marble) but with no results.
When I use a blender’s material with “ray tranparency” it makes no difference on the egg file, and if I use a texture it looks opaque when I load the model in panda3D.
And I use “.setTransparency(TransparencyAttrib.MAlpha)” on the model…
Is there any way to export transparent object from blender to panda3D.
This is because transparency isn’t determined by the material properties but by the texture mapping. Under the Texture Map To tab, make sure Alpha is selected.
You then must have a texture with an alpha channel assigned to this texture slot.
However, I find that even the Alpha Map To setting is not necessary; Panda3d is pretty smart about loading textures, in that if it detects an alpha channel it will automatically enable transparency for that node.
If you want to make an entire object semi-transparency without the use of an alpha-mapped texture, AFAIK, you’ll need to use the Egg file AlphaScale scalar (plus an appropriate Alpha blending mode) for that . This isn’t directly supported by the Chicken exporter yet, so you’ll have to add it by hand.
Or you could call it inconsistent behavior of Chicken.
It’s not Panda3D being smart, but Chicken being dumb. Unfortunately, this is one of those things that require overhauling of Chicken’s alpha handling, and in any case ditching backward compatibility.
Oh, yeah, the Targa reader in Panda3d doesn’t seem to handle the extra alpha channel. That threw me for a loop, too.
I normally use PNG, as it’s a much superior format in every way, but the last engine I’ve used didn’t handle PNGs very well so I had gotten into the habit of using TGAs. So my first attempts to import assets from the old engine didn’t work too well!
And ah, so I take it that Chicken isn’t properly outputting the file format tag or something for the Egg? Since Chicken doesn’t handle combined gloss/modulate maps, I noticed that before I hand-edit the Egg file to include the modulate_gloss EnvType, my model shows up in Panda as if the alpha channel was controlling transparency.