gpt4 book ai didi

python - 如何返回 Maya Python 中绘画光标的 ws xyz 位置?

转载 作者:太空宇宙 更新时间:2023-11-03 15:23:16 25 4
gpt4 key购买 nike

我希望能够在绘制权重时将相机聚焦在 Maya 绘制光标周围。我需要获取光标的 XYZ 位置才能执行此操作,有谁知道我如何获取它?

enter image description here

最佳答案

之前在maya python组里也有过这样的讨论。这是link和片段下来就是你要找的东西

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()

关于python - 如何返回 Maya Python 中绘画光标的 ws xyz 位置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43348124/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com