It is never acceptable to update a UI from any thread other than the one that created it, which is almost always the ‘main’ or ‘primary’ thread. Nuke spawns separate, dependent threads for all engine calls, and as such, updating any UI element from inside an engine call is an undefined operation. The _validate, _open, _close, _invalidate, and knobs function calls are all executed in the main thread, and are UI-safe.
This, in fact, is a major problem for many Nuke developers that want to manipulate the display as a part of processing. The only way to do it properly is to save state changes in a module-global variable inside your engine call, and then use the new values to update the UI in either _close or _invalidate. It’s not a question of engine being thread-safe – it is – rather, it’s a question of the UI elements being thread-safe, which is not guaranteed. Steve From: [email protected] [mailto:[email protected]] On Behalf Of Nathan Rusch Sent: Tuesday, November 29, 2011 10:51 AM To: [email protected] Subject: Re: [Nuke-dev] Re: progressFraction bar not showing Can you elaborate on this at all? I’m calling progressFraction in a plugin’s engine method with zero crashes, but while calling it, my engine is locked to a single thread... do you mean these functions aren’t thread-safe? Or are you talking about other UI update calls? -Nathan From: Steve3D<mailto:[email protected]> Sent: Tuesday, November 29, 2011 7:41 AM To: [email protected]<mailto:[email protected]> Subject: [Nuke-dev] Re: progressFraction bar not showing I hope you're not trying to update the UI from inside an 'engine' thread, because that's not allowed, and if it works, it will work intermittently and cause crashes. ________________________________ _______________________________________________ Nuke-dev mailing list [email protected]<mailto:[email protected]>, http://forums.thefoundry.co.uk/ http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev (CONFIDENTIALITY NOTICE: The information contained in this email may be confidential and/or privileged. This email is intended to be reviewed by only the individual or organization named above. If you are not the intended recipient, or an authorized representative of the intended recipient, you are hereby notified that any review, dissemination or copying of this email, or the information contained herein is strictly prohibited. If you have received this communication in error, please notify the sender by return email and delete this email from your system. Thank You.)
_______________________________________________ Nuke-dev mailing list [email protected], http://forums.thefoundry.co.uk/ http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev
