Does Maya have some sort of callbacks or script jobs that will allows me to run a function every 30 seconds (eg. for updating the contents in the tool) and this callback.scriptjob will be removed upon tool closure?
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/181c8fd3-8a6f-4407-ad56-64deefdfd97a%40googlegroups.com.
import threadingfrom maya import cmdst = None
def run_check(): global t t = threading.Timer(5.0, run_check) t.start() get_panels()
def get_panels(): for pane in cmds.getPanel(visiblePanels=True): print '>>> pane: ', pane
run_check()
# # Exception in thread Thread-8:# Traceback (most recent call last):# File "/builds/python_maya/2.7.11/852a2c8c4f/lib/python2.7/threading.py", line 801, in __bootstrap_inner# self.run()# File "/builds/python_maya/2.7.11/852a2c8c4f/lib/python2.7/threading.py", line 1073, in run# self.function(*self.args, **self.kwargs)# File "<maya console>", line 11, in run_check# File "<maya console>", line 29, in testTypeError: Flag 'visiblePanels' must be passed a boolean argument
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA3J1FiM6o6DLq2Y1fQF7io6T56SUJGH%2Bvdq2z6doALHGg%40mail.gmail.com.
What about MTimerMessage? That could help run something at regular intervals.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CADHeb2b2i9vsuXeEGJksjVeQUYFuozEjq%2BTuw3RTH01Q7J3-jQ%40mail.gmail.com.