Just brainstorming, but I wonder if Op::add_timeout/repeat_timeout would do what you’re after.
There’s no indication of which thread they run on, but the fact that they’re static makes it seem like the main thread could be a possibility. Otherwise, I wonder if there’s a way you could make something happen using Qt directly. -Nathan From: Johannes Saam Sent: Wednesday, January 28, 2015 4:33 PM To: Nuke plug-in development discussion Subject: Re: [Nuke-dev] Accessing the Main Thread Loop Thanks for the quick answer, as this is a huge thing for me right now. Imagine something like i have an Http server that sits somewhere on a seperate thread. And i want to ececute certain events in the main loop of nuke to be clean. I would love to be able to have something like a "exectue thisInMainWhenIdle( *function ).... you would not be able to provide this once you are in that code? Basically i need to access the main application loop from there and it would decide when to fire my custom code when its free. The python way might work but i would REALLY appreciate if that could be in c++ somewhere. Thanks again! On Wed, Jan 28, 2015 at 4:00 PM, Frank Harrison <[email protected]> wrote: As always, it depends on what you're trying to do. I'm not aware of any way to do this in the C++ NDK. But, in the python API there is the nuke.excuteInMainThread() python function but it has caveats. a.. It only works in gui-mode as we don't activate the main application event loop in terminal mode. b.. We currently have a bug where the closure parameter can be ignored (which I'm looking at now). c.. Exceptions aren't always handled cleanly What are you trying to do? F. On 28 January 2015 at 23:52, Johannes Saam <[email protected]> wrote: Hey! I have another one of my obscure questions... Imaging i have a custom thread X runnung something. Can i tell the main thread to execute custom code for me? As in i tell the main thread next time you can please run this bit of code for me? Its pretty essential for what i am doing right now...and other 3d software packages allow that. Is there any way of doing this in nuke? Its quasi an idle event that i can control. Thanks for any support! Jo _______________________________________________ Nuke-dev mailing list [email protected], http://forums.thefoundry.co.uk/ http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev -- Frank Harrison Senior Nuke Software Engineer The Foundry Tel: +44 (0)20 7968 6828 - Fax: +44 (0)20 7930 8906 Web: www.thefoundry.co.uk Email: [email protected] _______________________________________________ Nuke-dev mailing list [email protected], http://forums.thefoundry.co.uk/ http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev -------------------------------------------------------------------------------- _______________________________________________ Nuke-dev mailing list [email protected], http://forums.thefoundry.co.uk/ http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev
_______________________________________________ Nuke-dev mailing list [email protected], http://forums.thefoundry.co.uk/ http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev
