What is wrong with my openGL draw code?


Hello, what is wrong with my openGL code? I am suspecting it to be my push and popAttrib codes. As you can see, the wireframe is not showing at all when the object is covered behind the custom openGL locator. Any hints?


some code is inserted here


the above draw codes are my settings for the glPushAttrib…

Thanks in advance…


Actually i’ts not shown only for the objects that seem to me are polygons, the cone which looks like is a NURBS is showing fine… so I guess may be there is something else, connected to the way your graphics driver handles OGL transparency connected with the way Maya draws polygon edges…


i see, i will have somebody else test the code on a quadro card. this is very irritating,specially for animators who would like to see the deformation. i do not want them to be turning off the locator’s visibility just so that they can see the deformation of the mesh. thank you very much

has anybody experienced the same thing?


OK, now i have just discovered that even joints are also hidden when overlapped by the custom locators…


Out of curiosity I created a transparent cube with red lambert shader and placed it in a similar location. (See attachment, hopefully it loaded correctly). It seems normal to me, so I’m curious if you could just try to do that on your machine to rule out the possibility that your problem was due to the locator drawing code.


Hello, sir. I tried it out of curiosity, and it seems to be the same as your result…there is definitely something in my openGL draw codes that I did not understand fully, it could probably the MGL_BLEND, or that I have put lineWidth in the wrong order, I dont know…I will check my earlier codes to see where it started or if the problem was already there since the start. anyway, here is part of the code:

    if status == OpenMayaUI.M3dView.kLead:
        glFT.glColor4f(0.0+color_RVal, 0.0+color_GVal, 0.0+color_BVal, 0.2)
    if status == OpenMayaUI.M3dView.kActive:
        glFT.glColor4f(0.0+color_RVal+.3, 0.0+color_GVal+.3, 0.0+color_BVal+.3, 0.2)
    if status == OpenMayaUI.M3dView.kDormant:
        glFT.glColor4f(0.0+color_RVal-.3, 0.0+color_GVal-.3, 0.0+color_BVal-.3, 0.4)

#some openGL primitive draw codes#



#some openGL primitive draw codes#



Straight from the OGL FAQ - try adding this lines (can’t test this right now):

  glEnable (GL_BLEND)

of course you should convert them to python api calls :wink:


amazing! thank you very much,i will try to read this later after my game of starcraft. i was looking for this reference but i cannot seem to find it using google. i learned the basics of OGL’s class,methods and functions through another site. thank you very much again.


This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.