Hi,

thanks, that solved it. Somehow wasn't checking the onDestroy-Callback. :)

Would have wanted the user to manually be able to check what happens (by 
modifying the script by himself before closing.)
But now the user can just let it happen or not. :)

Cheers,
Dominic




---
Dominic Platz
Lead Artist Compositing

Mackevision Medien Design GmbH
Forststraße 7
70174 Stuttgart

T +49 711 93 30 48 639
F +49 711 93 30 48 90

[email protected]
www.mackevision.com<http://www.mackevision.com/?utm_source=E-Mail-Signatur&utm_medium=E-Mail&utm_campaign=Mackevision-Link>

Geschäftsführer: Armin Pohl, Joachim Lincke, Jens Pohl
HRB 243735 Amtsgericht Stuttgart

---
NEW PRODUCT: Innovation in moving images - 
Motionbox<http://www.mackevision.com/motionbox/?utm_source=E-Mail-Signatur&utm_medium=E-Mail&utm_campaign=Motionbox-Signatur>
VFX: Game of Thrones, Season 5 - VFX making of 
reel<http://www.mackevision.com/references/got-5-making-of/?utm_source=E-Mail-Signatur&utm_medium=E-Mail&utm_campaign=GoT-S5-making-of-Signatur>.
SOCIAL: Follow us on Facebook<https://www.facebook.com/mackevision.global>, 
Twitter<https://twitter.com/Mackevision>, 
Behance<https://www.behance.net/mackevision> and 
Vimeo<https://vimeo.com/mackevision>
From: [email protected] 
[mailto:[email protected]] On Behalf Of Holger 
Hummel|Celluloid VFX
Sent: Freitag, 17. Juni 2016 23:07
To: Nuke Python discussion <[email protected]>
Subject: Re: [Nuke-python] Cancel Nuke Closing with onScriptClose-Callback

True that.
I was assuming the main goal is to 'do something' before it actually closes but 
not to prevent it completely.

Holger
On 17.06.2016 19:14, Nathan Rusch wrote:
I don't think you can prevent the script from closing from within the 
onScriptClose callback.

-Nathan

From: Holger Hummel|Celluloid VFX<mailto:[email protected]>
Sent: Friday, June 17, 2016 1:44 AM
To: Nuke Python discussion<mailto:[email protected]>
Subject: Re: [Nuke-python] Cancel Nuke Closing with onScriptClose-Callback


Hi Dominic,

i think this should work for what you're after.
Instead of nuke.scriptSave() you can of course do whatever you want.

Cheers,
Holger

def closeCallback():
    n = nuke.thisNode()
    if n.name() == 'Root':
        close = nuke.ask('really close?')
        if close == True:
            pass
        else:
            nuke.scriptSave()

nuke.addOnDestroy(closeCallback)

On 16.06.2016 12:00, Dominic Platz wrote:

Hi there,



does anybody know if I can add a custom onScriptClose-Callback that interrupts 
the nuke-closing?

(e.g. like being asked for saving at closing and then clicking cancel)



So I want something like:



def function():

if nuke.ask("Really wanna close?"):

            pass     #close it

else:

                        #do something and don't close nuke







Or is this anyway not possible, because the onScriptClose-Callback acts after 
all the node onDestory-Callbacks? And I won't get a full intact script at that 
point?





Cheers,

Dominic

---
Dominic Platz
Lead Artist Compositing

Mackevision Medien Design GmbH
Forststraße 7
70174 Stuttgart

T +49 711 93 30 48 639
F +49 711 93 30 48 90


[email protected]<mailto:[email protected]>
www.mackevision.com<http://www.mackevision.com/?utm_source=E-Mail-Signatur&utm_medium=E-Mail&utm_campaign=Mackevision-Link>

Geschäftsführer: Armin Pohl, Joachim Lincke, Jens Pohl
HRB 243735 Amtsgericht Stuttgart



_______________________________________________

Nuke-python mailing list

[email protected]<mailto:[email protected]>,
 http://forums.thefoundry.co.uk/

http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python



--

Holger Hummel  -  [email protected]<mailto:[email protected]>



Celluloid Visual Effects GmbH & Co. KG

Paul-Lincke-Ufer 39/40, 10999 Berlin

phone +49 (0)30 / 54 735 220  -  
[email protected]<mailto:[email protected]>




_______________________________________________

Nuke-python mailing list

[email protected]<mailto:[email protected]>,
 http://forums.thefoundry.co.uk/

http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python



--

Holger Hummel  -  [email protected]<mailto:[email protected]>



Celluloid Visual Effects GmbH & Co. KG

Paul-Lincke-Ufer 39/40, 10999 Berlin

phone +49 (0)30 / 54 735 220  -  
[email protected]<mailto:[email protected]>
_______________________________________________
Nuke-python mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

Reply via email to