Does this callback solve your "right before render" problem? http://docs.thefoundry.co.uk/nuke/90/pythondevguide/callbacks.html?highlight=beforerender
As for calling something during render, well Nuke provides the executeInMainThread() set of functions, NOTE: these only work in GUI mode: http://docs.thefoundry.co.uk/nuke/90/pythondevguide/threading.html?highlight=executeinmainthread Otherwise, the problem is a standard threading issue, i.e. you could spawn a thread when you receive beforeRender() to do some tertiary work and kill it on afterRender(). However, if you want to communicate with Nuke from a custom thread whilst in render/terminal mode you may experience some problems calling non-thread safe interfaces (e.g. nuke.createNode()), which is something we hope to fix in the not to distant future. Does that answer you question? :) On 26 April 2015 at 04:16, Sam Cole <[email protected]> wrote: > In the same vein, what's the easiest way to call something during a render > without touching write nodes? e.g. If I want to call a pyscript buttons > execute right before a render but not mess with any of the facility > preflight etc. > > > > On Sat, Apr 25, 2015 at 1:44 AM, Frank Harrison <[email protected]> > wrote: > >> Just saying that you don't want to rely on having a valid nuke module, >> Root_Node, DDImage infrastructure, etc.. >> >> If it's a gui-only thing you could connect a slot to the aboutToQuit() >> signal >> >> http://doc.qt.io/qt-4.8/qcoreapplication.html#aboutToQuit >> >> >> On 24 April 2015 at 14:19, Fredrik Averpil <[email protected]> >> wrote: >> >>> Hi Frank, >>> >>> I just ran a test here with atExit, and that worked fine. Are you saying >>> I shouldn't rely on it? >>> If so, any other ideas? >>> >>> Regards, >>> Fredrik >>> >>> >>> >>> On Thu, Apr 23, 2015 at 3:07 PM Frank Harrison <[email protected]> >>> wrote: >>> >>>> Just to let you know that by the time atExit callbacks are called Nuke >>>> will have shut down most of its systems :) >>>> >>>> On 23 April 2015 at 09:05, Ben Dickson <[email protected]> wrote: >>>> >>>>> You can run code when the python interpreter exits with the 'atexit' >>>>> module: >>>>> >>>>> https://docs.python.org/2/library/atexit.html >>>>> >>>>> >>>>> On 23/04/15 17:27, Fredrik Averpil wrote: >>>>> >>>>>> Does anyone know if it is possible to tell Nuke to execute a function >>>>>> when it exits? >>>>>> >>>>>> Regards, >>>>>> Fredrik >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> Nuke-python mailing list >>>>>> [email protected], http://forums.thefoundry.co.uk/ >>>>>> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python >>>>>> >>>>>> >>>>> -- >>>>> ben dickson >>>>> 2D TD | [email protected] >>>>> rising sun pictures | www.rsp.com.au >>>>> _______________________________________________ >>>>> Nuke-python mailing list >>>>> [email protected], http://forums.thefoundry.co.uk/ >>>>> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python >>>>> >>>> >>>> >>>> >>>> -- >>>> 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-python mailing list >>>> [email protected], http://forums.thefoundry.co.uk/ >>>> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python >>>> >>> >>> _______________________________________________ >>> Nuke-python mailing list >>> [email protected], http://forums.thefoundry.co.uk/ >>> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python >>> >>> >> >> >> -- >> 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-python mailing list >> [email protected], http://forums.thefoundry.co.uk/ >> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python >> >> > > _______________________________________________ > Nuke-python mailing list > [email protected], http://forums.thefoundry.co.uk/ > http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python > > -- 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-python mailing list [email protected], http://forums.thefoundry.co.uk/ http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
