Trees | Indices | Help |
|
---|
|
1 import nuke 24 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 15 # Do not override the view-related knobs from the Preferences 16 # if they've been set from a user-defined template.nk 17 isNotFromUserTemplate = not root['set_by_user_template'].getValue() 18 if isNewComp and isNotFromUserTemplate: 19 for knob in ("views", "hero_view", "views_colours"): 20 # Check knobDefaults to see if the value has been set. If it has been set, then preferences should not override it. 21 if(nuke.knobDefault("Root."+knob) is None): 22 root.knob(knob).fromScript(preferencesNode.knob(knob).toScript())23 24 25 nuke.addOnCreate(onCreateRoot, nodeClass='Root') 26
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Fri Feb 14 13:53:21 2020 | http://epydoc.sourceforge.net |