キューブの回転 X に基づいて関数 ( Maya-Python ) を呼び出す必要があります。そのためには、プログラムでイベントをキャプチャする必要があります。
while ループを使ってみたのですが、ループの中でスタックしてしまい、その間何もできません。私はテディング(python)を試しましたが、それでも同じです。
これまたは他の方法で行うことはできますか?はいの場合、どのように?
Windows XP の Maya 2009
いくつかの失敗したコード参照:
import maya.cmds as cmds
while (count < 90):
lock = cmds.getAttr('pCube1.rotateX',lock=False)
print lock
count = count + 1
ここでPythonが賢明です:
#!/usr/bin/python
import thread
import time
# Define a function for the thread
def cubeRotateX( threadName, delay):
count = 0
while count < 5:
time.sleep(delay)
count += 1
try:
thread.start_new_thread( cubeRotateX, ("Thread-1", 2, ) )
except:
print "Error: unable to start thread"
while 1:
pass