initialization script:
--in '<system driven>/Document and setting/.nuke' create a python scrip named 'menu.py'
write script in mene.py:
#menu.py -> your custom start up nuke script
import sys
import os
serverPath = <your custom server path> #example: r'Z:\nukescript'
sys.path.append(serverPath)
allFiles = os.listdir(serverPath)
allPys = []
for item in allFiles:
sp = item.split('.')
if 'py' in sp and len(sp) == 2:
allPys.append(sp[0])
ecex( 'import '+sp[0].__str__() )
now you can put all your nuke script in <your custom server path>,all scripts will be import when you starting nuke under this path .if you add command in these scripts, I suggest you add this at the end of your custom python script, that means command will be executed when you import this script as modual (not a root command):
if __name__ != '__main__':
<command...>
ok ,that's all ,cheers!!
qeeji20110324
--in '<system driven>/Document and setting/.nuke' create a python scrip named 'menu.py'
write script in mene.py:
#menu.py -> your custom start up nuke script
import sys
import os
serverPath = <your custom server path> #example: r'Z:\nukescript'
sys.path.append(serverPath)
allFiles = os.listdir(serverPath)
allPys = []
for item in allFiles:
sp = item.split('.')
if 'py' in sp and len(sp) == 2:
allPys.append(sp[0])
ecex( 'import '+sp[0].__str__() )
now you can put all your nuke script in <your custom server path>,all scripts will be import when you starting nuke under this path .if you add command in these scripts, I suggest you add this at the end of your custom python script, that means command will be executed when you import this script as modual (not a root command):
if __name__ != '__main__':
<command...>
ok ,that's all ,cheers!!
qeeji20110324