Hello to the community once more!
I am facing the following problem with transparency. when my objects are loaded from egg files, transparency works well as shown in the following picture
when i convert the eggs to bam using the egg2bam.exe it works as well.
the problem is that my original objects are neither egg or bam but fbx or obj so i need to perform a convertion that takes time. when i load the obj or fbx directly into panda3d, transparency no longer works:
the loader part of my code is:
obj_file = Filename.fromOsSpecific(obj_file) # convert path to pandas3d format mesh = loader.loadModel(obj_file) # load the egg into memory mesh.setTwoSided(True) # set rendering of both sides mesh.setCollideMask(BitMask32.bit(1)) # Set the model to be collideable with the ray. mesh.setTag('part', str(pid)) # so we can look up which piece this is later during the collision pass mesh.flattenStrong() # simplifies the node so it renders quicker mesh.setTransparency(TransparencyAttrib.MAlpha) # enable transparency change in that node mesh.reparentTo(self.vehicle)
and finally, when i want to make an object transparent i use:
mesh.setDepthWrite(True) mesh.setBin('fixed', 0) mesh.setAlphaScale(0.5)
anyone has an idea on how to achieve the desired result without having to use the egg or bam format?