【发布时间】:2010-12-25 07:02:07
【问题描述】:
我使用以下代码在 Maya 中创建了一个拖动上下文,pos 保存我的鼠标光标的 2D 坐标,我想将其转换为 3D 坐标作为我想要发射的射线的源,我想要它要么通过python脚本或通过python api,,,
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--------
????????
提前致谢
【问题讨论】:
-
# 错误:RuntimeError:文件
第 4 行:#
标签: python scripting 3d maya autodesk