Created
December 1, 2015 12:24
-
-
Save SEVEZ/caa294586021f86a2290 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import maya.OpenMaya as OpenMaya | |
selection = OpenMaya.MSelectionList() | |
OpenMaya.MGlobal.getActiveSelectionList( selection ) | |
iterSel = OpenMaya.MItSelectionList(selection, OpenMaya.MFn.kMesh) | |
while not iterSel.isDone(): | |
dag_path_object = OpenMaya.MDagPath() | |
iterSel.getDagPath( dag_path_object ) | |
vert_iter = OpenMaya.MItMeshVertex(dag_path_object) | |
while not vert_iter.isDone(): | |
vertex_normal = OpenMaya.MVector() | |
vert_iter.getNormal(vertex_normal, OpenMaya.MSpace.kObject) | |
print 'VERTEX %s : %s,%s,%s' %(vert_iter.index(), vertex_normal.x, vertex_normal.y, vertex_normal.z) | |
vert_iter.next() | |
iterSel.next() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment