can anyone explain the set.Trasparencey command I have read the instructions in the manual. However it is not clear to me where i can change the transparency using the values between 0 and 1.0
I have tried several things but just get errors so I am not using the command correctly
I have tried
here the message i got in my terminal
Traceback (most recent call last):
File "ball02.py", line 142, in <module>
w = world()
File "ball02.py", line 28, in __init__
TypeError: integer argument expected, got float
So my question is where in the command can I change the attributes because it is not clear to me from reading the manual.
setTransparency() sets the mode of transparency, check this manual page panda3d.org/manual/index.php … d_Blending
If you want a model to be transparent you can use its texture alpha channel or vertex color. With the texture you’d be best using some image editing software (Gimp, Photoshop, etc), you can set the vertex alpha in a modeling package (if the export script supports that), in the models egg file or using nodePath.setAlphaScale(0.8) or nodePath.setColor(1,1,1,0.8)
cool thanks for the reply I will have a look at the links that you put up
also, i think the error message tells you to use integer as argument, such as any number between 0~255.
0.8 is not integer number.
Yes… and not really, no. setTransparency() should be used with one of these values:
These are constants, so TransparencyAttrib.MNone==0, TransparencyAttrib.MAlpha==1
TransparencyAttrib.MDual==6 and so on.
So You could use setTransparency(6), but don’t, use setTransparency(TransparencyAttrib.MDual).