In MAYA 2009, is it possible to capture the cube rotate event?

Posted by Rahul2047 on Stack Overflow See other posts from Stack Overflow or by Rahul2047
Published on 2010-04-17T01:42:46Z Indexed on 2010/04/17 1:53 UTC
Read the original article Hit count: 250

Filed under:
|
|
|

I need to call a function ( Maya-Python ) based on cube rotationX. For that I have to capture the event, programmatically.

I tried using while loop but It stucks in the loop, Nothing can be done in that time. I tried theading (python), still same.

Can it be done this or other way? If yes, How?

Maya 2009 in Windows XP

Some failed code references:

import maya.cmds as cmds    
while (count < 90):
     lock = cmds.getAttr('pCube1.rotateX',lock=False)
     print lock
     count = count + 1 

Here Python wise:

#!/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

© Stack Overflow or respective owner

Related posts about maya

Related posts about python