Might not be the best way but i found this to work after copying nodes to a new 
file (scriptPath) :

            #####Copy Project settings#######
            currScript = nuke.Root().name()
            
            ## Get Root Settings
            with open(currScript, 'r') as f:
                readScript = f.read()
            f.closed
            readRoot_long = readScript[readScript.find('Root {'):]
            readRoot = readRoot_long[:readRoot_long.find('}')]
            rootSett = readRoot + '\n}'                    
            print rootSett
            
            ## Copy to new file
            f = open(scriptPath, 'r')
            temp = f.read()
            f.close()
            
            f = open(scriptPath, 'w')
            f.write(rootSett)
            f.write('\n' + temp)
            f.close()



_______________________________________________
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