closestIntersection cannot consistently hit the target mesh


#1

Blockquote

from PySide2 import QtGui, QtCore, QtWidgets
import maya.cmds as cmds
import maya.api.OpenMaya as om2
import maya.api.OpenMayaUI as mui

        result= meshFn.closestIntersection(ray_sourceFloat,ray_directionFloat,4,9999,False,faceList,triList,False,params,0.1)
        print(result)

    return super(MyEventHandler, self).eventFilter(target, event)

handler = MyEventHandler()

app = QtWidgets.QApplication.instance()
app.installEventFilter(handler)
#app.removeEventFilter(handler)

Blockquote

#Sometimes it hits, and sometimes it doesn’t even hit when the mouse clicks on the mesh, please help me to #check what went wrong, thank you first.


#2

Damn,just delete some args.Like:
result= meshFn.closestIntersection(ray_sourceFloat,ray_directionFloat,4,9999)
print(result)

Damn again.