Message 1 of 8
Maya crashed by calling <MItMeshVertex>.getNormal().

Not applicable
06-07-2020
04:00 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I was trying to get normal from the vertices that I select. but this code crashes maya.
I'm using maya 2019 in linux. if I use vert_itr.getNormals instead of vert_itr.getNormal, maya does not crash and returns proper vectors. but it returns the normals of the current vertex for all faces.
I want to use getNormal to get average normal for the vertex. but maya crashes with the function.
import maya.api.OpenMaya as OM2
sel = OM2.MGlobal.getActiveSelectionList()
dag, component = sel.getComponent(0)
if not component.isNull():
# There were components selected
vert_itr = OM2.MItMeshVertex(dag, component)
while not vert_itr.isDone():
rayDirection = vert_itr.getNormal(OM2.MSpace.kWorld)
vert_itr.next()