It looks like you're new here. If you want to get involved, click one of these buttons!
Is there any option to register timer callback (like qt timers) ?
Let's say NO to Autodesk®Fabric®
You mean, from KL? In KL, there is no such feature. Having a timer requires an external call from C++, either from a custom EDK extension that you build, or by modifying the canvas.py or Maya C++ plugin code. I agree however that having this can be valuable in various applications.
OR: maybe you can play with the async KL construct, which executes an operator asynchronously (on a background thread), in combination with the "MicroSleepWait( microSecs )" util function from the Synchrnization extension. You should be able to build a timer with these. But of course, it can be relatively dangerous to have KL code execution kicking in at any moment, so you have to be very careful in adding various logical safeguards around this kind of things (potentially by putting states in Singleton etc).
Re-reading youe post, the "async" solution is probably not what you want, since it would run on another thread, and you probably want something that runs from the "main" thread.
For example, it needs to get intermediate result from c++ loop not as log, but as data to draw it in Canvas. Is there a quick way to do it, like some EDK function?
I think that this would need you to modify the Canvas app so it requests a redraw (get the OGL viewport widget and call update() on it) from a timer. I don't know if that is feasible by only modifying the Python app files, hopefully it is. But I can't go into more details since it would require more in depth investigations.
I have been hacking in some changes to the canvas.py lately and I believe calling methods on the viewport widget is doable in python. I recently accessed the viewport widget quickly (not the most robust way) by calling centralWidget() on the CanvasWindow...
mainWin = CanvasWindow(settings, unguarded, noopt) print(mainWin.centralWidget())
from there you should be able to connect to signals and call methods.
©Copyright 2017 Fabric Software Inc. All rights reserved. | Privacy