hey Ron,

i can give you the one we're using here.
not the most elegant solution probably but will do what you're after.

put the following code into wherever you keep your python functions:

/import os//
//
//def createOutputFolder(filePath)://
//
//    n = nuke.thisNode()//
// if filePath.find('%v') != -1 or filePath.find('%V') or filePath.find('-tb') != -1 ://
//        for curView in n['views'].value().split()://
//            curDir = os.path.dirname(n['file'].evaluate(view = curView))//
//            if not os.path.exists(curDir)://
//                try://
//                    os.makedirs(curDir)//
//                except://
//                    pass//
//    else://
//        curDir = os.path.dirname(n['file'].evaluate())/


in the python tab of the write node put the function into the beforeRender knob
passing the current's write node file knob value like this:

/createOutputFolder(nuke.thisNode()['file'].value())/

just remember to add the name space prefix to the function call depending on where
you put the function, e.g. /RonsPyStuff.createOutputFolder(...)/


cheers,
Holger


Am 17.05.2013 00:15, schrieb Ron Ganbar:
Hi,
anyone knows of a good script that I can use to automatically create the directories for my Write node, that includes %V?
Can't easily find it on Nukepedia.

Thanks,
Ron Ganbar
email: [email protected] <mailto:[email protected]>
tel: +44 (0)7968 007 309 [UK]
     +972 (0)54 255 9765 [Israel]
url: http://ronganbar.wordpress.com/


_______________________________________________
Nuke-users mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users


--
Holger Hummel  -  [email protected]

Celluloid Visual Effects GmbH & Co. KG
Paul-Lincke-Ufer 39/40, 10999 Berlin
phone +49 (0)30 / 54 735 220  -  [email protected]

_______________________________________________
Nuke-users mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users

Reply via email to