.png transparancy??! How to?

So I load the png texture and set it to an egg model. But I can not figure out how to get the black background of the png to not display.

How do you do that? I’ve searched all over and I get a hint that its suppose to be

object.setTransparency(TransparencyAttrib.MAlpha)

but I cant get it to work/ not dispay the black in the image :[

Does the PNG actually have an alpha channel in it? If you’ve made the image yourself make sure you set the right options when saving it from your image editor, otherwise open it with an image editor to check if it has one.

yeah, I followed these steps for photoshop:

ehow.com/how_2029201_png-photoshop.html

the code i use is:

    myframe = DirectFrame(frameSize=(-0.7, 0.7, -0.4, 0.4), frameColor=(1,1,1,.5), pos=(0,0,0))
    science = loader.loadModel('eve_rts/menu/gui/science_images/moon_object.egg')
    moon_texture = loader.loadTexture('eve_rts/menu/gui/science_images/moon.png')
    science.setTexture(moon_texture, 1)
    science.setScale(.3)
    science.reparentTo(myframe)
    science.setPos(-.4,0,.1)

[/code]

Try one of the other transparency modes instead of MAlpha.
MDual is for smooth transparency.
MBinary is for either on or off.
There are a couple other modes, not sure what their function is.
http://www.panda3d.org/reference/python/class!panda3d.core.TransparencyAttrib

MAlpha is the most basic kind of transparency and should work fine.

Check that if you pview the image directly (“pview eve_rts/menu/gui/science_images/moon.png”) that you can see through the tranparent parts (press the comma key to rotate the background color). If you can’t see the transparency there, then you didn’t create the alpha channel properly.

Note that a DirectFrame has an opaque background card that will appear behind your model and sometimes confuses people. Try setting relief = None on the frame just to prove that you’re not getting tricked by that.

Your sample code doesn’t show you actually applying the transparency. I assume you are doing that?

David