1

我希望能够在绘制权重时将相机聚焦在 Maya 绘制光标周围。我需要抓住光标的XYZ位置才能做到这一点,有人知道我怎么能得到这个吗?

在此处输入图像描述

4

1 回答 1

1

以前在maya python 群中有这样的讨论。这是链接,下面的片段是您要查找的内容

from PySide import QtGui, QtCore

def print_mouse_position():

    point = QtGui.QCursor().pos()
    print "x: %s; y: %s" % (point.x(), point.y())

timer = QtCore.QTimer()
timer.setInterval(1000.0 / 25)  # Print 25 times per second
timer.timeout.connect(print_mouse_position)
timer.start()

#when ever you want to stop it uncomment below line
#timer.stop()
于 2017-04-11T18:28:42.560 回答