Hi all,

just trying the get the Normal direction of a vertex so i can offset a point locally from its Normal.

at the moment i cant get a value from the Normal at all?

import maya.OpenMaya as OpenMaya
import maya.OpenMayaMPx as OpenMayaMPx

selList = OpenMaya.MSelectionList()
OpenMaya.MGlobal.getActiveSelectionList(selList)
dag1= OpenMaya.MDagPath()
selList.getDagPath(0,dag1)
meshIter1 = OpenMaya.MItMeshVertex(dag1)

ObjectSpace=OpenMaya.MSpace.kObject

while not meshIter1.isDone():
   p1 = meshIter1.position(ObjectSpace)
   print p1.x,p1.y,p1.z
   normal=OpenMaya.MVector()
   vector = meshIter1.getNormal(normal, ObjectSpace)
   meshIter1.next()

at the moment this crashes maya after it has finished the loop. i think its because i normal=OpenMaya.MVector() is inside the loop.

i have tried this outside the loop but i get "None" as a Print result of 'vector'. I'm pritty new to API so i could have done a few things wrong.

anyway any answers would be appreciated

john

--
http://groups.google.com/group/python_inside_maya

To unsubscribe, reply using "remove me" as the subject.

Reply via email to