Package nukescripts :: Module viewsettingsprefs
[hide private]
[frames] | no frames]

Source Code for Module nukescripts.viewsettingsprefs

 1  import nuke 
 2   
3 -def onCreateRoot():
4 5 preferencesNode = nuke.toNode('preferences') 6 7 # This should only be done if the Root being created is the global root used 8 # in the DAG, *not* Root nodes created by Studio 9 root = nuke.thisRoot() 10 if root != nuke.root(): 11 return 12 13 isNewComp = not root['name'].getValue() 14 if isNewComp: 15 root.knob('views').fromScript(preferencesNode.knob('views').toScript()) 16 root.knob('hero_view').fromScript(preferencesNode.knob('hero_view').toScript()) 17 root.knob('views_colours').fromScript(preferencesNode.knob('views_colours').toScript())
18 19 20 nuke.addOnCreate(onCreateRoot, nodeClass='Root') 21