Thanks for your suggestion. However, the problem I'm having isn't really of the 
specific backup script. It's more what approach to use when using a layered 
setup of init.py (global, show specific) where one should override the other 
(just like gizmos).

Best regards,
Simon 

Skickat från min iPhone

> 21 aug 2014 kl. 17:12 skrev José Alejandro Enríquez <zaban...@gmail.com>:
> 
> Haven't you tried to create a post render backup using the override for 
> executeMultiple? It works perfectly for me, and the advantage is that if 
> something went wrong with the render it won't save the .nk until is fixed so 
> you keep a good file.
> 
> 
> 2014-08-21 7:18 GMT-05:00 Simon Björk <si...@bjorkvisuals.com>:
>> Hi all,
>> 
>> I have a script that saves a backup of the current script before rendering, 
>> using the nuke.addBeforeRender callback. Example (temp) script:
>> 
>> def saveBackup(path):
>>  print path
>> 
>> In my global init.py:
>> 
>> import saveBackup
>> backupPath = "D:/nuke_backup/"
>> nuke.addBeforeRender(saveBackup.saveBackup, (backupPath) )
>> 
>> This all works as expected, but what if I want to override the backupPath in 
>> a show specific init.py (loaded after the global)? If I add the callback 
>> again to my show init.py (using a different path)  I end up with a script 
>> that is run twice. What is the best way to get around this?
>> 
>> I tried setting the backupPath as an environment variable, and then just 
>> changing the environment variable in the show specific init.py, and also 
>> removing the callback before adding it again, but none of those seems to 
>> work.
>> 
>> Best regards,
>> Simon
>> 
>> 
>> 
>> 
>> -------------------------------
>> Simon Björk
>> Compositor/TD
>> 
>> +46 (0)70-2859503
>> www.bjorkvisuals.com
>> 
>> _______________________________________________
>> Nuke-python mailing list
>> Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
>> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
> 
> _______________________________________________
> Nuke-python mailing list
> Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
_______________________________________________
Nuke-python mailing list
Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

Reply via email to