다음 코드를 사용하여 마야에서 드래거 컨텍스트를 만들었습니다. pos는 마우스 커서의 2D 좌표를 보유하고 있습니다.이 포인터를 3D 좌표로 변환하여 시작하려는 레이의 소스가되도록하고 싶습니다. 파이썬 스크립트 나 파이썬 API를 통해 ,, 사전에어떻게 마야에서 마우스의 3D 위치를 얻을 수 있습니까?
import maya.cmds as mc
mc.draggerContext('testContext', pressCommand='getCursorPos()',
dragCommand='getCursorPos()', cursor='default')
def getCursorPos():
#--get the 2D position of cursor (on the view port)----
pos = mc.draggerContext('testContext', query=1, dragPoint=1)
#----convert to 3D coordinates in the scene--------
????????
덕분에
# Error : RuntimeError : file 4 행 : # –