Hello, experts.
I am new to openGL coding and I am a technical artist using Maya and 3dsMAX, this is my first time to venture into openGL coding after about 12 years into my career.
I am coding with Python and I am making special locators for Maya using Maya’s Python API with openGL.
The above picture shows a problem with transparency. The red cubes are the locators that I made using openGL.
Please read this:
-
the cone was created before the red cubes/locators.
-
the sphere and the grey cube was created after the red cubes/locators.
as you can see, it is not showing the lines when intersected with the red cubes/locators.
Below is basically my draw codes. I hope that it is not confusing.
###########################################################
view.beginGL()
glFT.glPushAttrib(OpenMayaRender.MGL_CURRENT_BIT)
glFT.glPushAttrib(OpenMayaRender.MGL_ALL_ATTRIB_BITS)
glFT.glEnable(OpenMayaRender.MGL_BLEND)
glFT.glBlendFunc (OpenMayaRender.MGL_SRC_ALPHA, OpenMayaRender.MGL_ONE_MINUS_SRC_ALPHA)
#These are Maya specific status codes#
if status == OpenMayaUI.M3dView.kDormant:
glFT.glColor4f(color_RVal,color_GVal,color_BVal, 0.3)
if status == OpenMayaUI.M3dView.kLead:
glFT.glColor4f(0.0+color_RVal+.0,0.0+color_GVal+.0,0.0+color_BVal+.0, 0.4)
if status == OpenMayaUI.M3dView.kActive:
glFT.glColor4f(0.0+color_RVal+.3,0.0+color_GVal+.3,0.0+color_BVal+.3, 0.5)
#some openGL primitive codes are inserted here#
glFT.glLineWidth(widthVal)
glFT.glDisable(OpenMayaRender.MGL_BLEND)
glFT.glPopAttrib()
glFT.glPopAttrib()
view.endGL()
###########################################################
Thank you very much, I am trying to solve this on my own without any success. I hope that somebody more experienced in this can help me through. Rick