次のコードを使用して 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--------
????????
前もって感謝します