Transparency Issue

I’m having a hard time making an object to fade in slowly… I’m using .setColor(R,G,B,A) and all it does is to make my object totaly invisible.

Any suggestions??? THX!!

Hi,
I’m no expert but maybe you could try these threads?:

https://discourse.panda3d.org/viewtopic.php?t=737&highlight=fade&sid=9bd74e3ecc93c299a3b6c28a5ab0bfb8

https://discourse.panda3d.org/viewtopic.php?t=2019&highlight=fade&sid=9bd74e3ecc93c299a3b6c28a5ab0bfb8

Hope that helps!

I’m using a different technique mentioned in this thread https://discourse.panda3d.org/viewtopic.php?t=1952

From my experience it’s faster then changing the alpha values of a model, especially when fading in. I have implemented this code in one of my projects posted here (https://discourse.panda3d.org/viewtopic.php?t=2648). You could probably just copy the 2 functions makeFadeIn and modelFadeIn from the plants.py, just create the dictionary self.fadingNodepaths before and call the modelFadeIn in a task.

Note that in the next version of Panda–post 1.3.2–this faster technique will be applied automatically whenever you just do setColor(), setColorScale(), or setAlphaScale().

David

Thanks Hypnos, I managed to copy the 2 functions and everything works perfectly now.

One question remains, Why am I not able to modify the Alpha value of a model which is textured with a png that contains an AlphaChannel

I have models that use a seperate alpha texture which work using this method. you may have to use the same technique to get it working. (look in the data file models/3d-plant/fern_3ds) as reference what i mean.

hope this helps