Home Technical Talk

MAYA query of normals are locked

polycounter lvl 12
Offline / Send Message
hannes d polycounter lvl 12
Hi,

Does anyone know how to query Maya if normals are locked?
The manual way to do it is go to display/polygons/vert normals and it will display yellow lines if the normals are locked.
But is there a way to do this trough scripting? Preferably with Pymel or OpenMaya.

Replies

  • throttlekitty
    Options
    Offline / Send Message
    Check this page out, you can do something like pm.polyNormalPerVertex(q=True, al=True) to get a true/false on a vertex selection. I don't know pymel too good, couldn't quickly figure out the best way to go from an object selection to a vertex to give you a little starter script, sorry.
  • hannes d
    Options
    Offline / Send Message
    hannes d polycounter lvl 12
    That looks perfect, can't believe I missed that. Thanks!

    update:
    pm.polyNormalPerVertex(q=True, al=True) only works if all normals are locked.

    however this command returns an array with booleans quering locked for every vertex
    pm.polyNormalPerVertex(q=True, freezeNormal =True) 

    so then it's just a simple
    if True in pm.polyNormalPerVertex(q=True, freezeNormal =True):
        print "contains locked verts" 
Sign In or Register to comment.