Skip to content

Instantly share code, notes, and snippets.

@kpprt
Created October 18, 2019 18:31
Show Gist options
  • Save kpprt/ba84661da888aeeecd0d98a0fbf0d588 to your computer and use it in GitHub Desktop.
Save kpprt/ba84661da888aeeecd0d98a0fbf0d588 to your computer and use it in GitHub Desktop.
Short snippet to create output folders of a Write Node in Nuke.
import os
n = nuke.selectedNode()
if n.Class() != 'Write':
nuke.message('No Write Node selected')
else:
filepath = os.path.dirname(n['file'].evaluate())
proxypath = os.path.dirname(n['proxy'].evaluate())
question = 'Yes = create normal file path:\n'
question += filepath
question += '\n\n'
question += 'No = create proxy file path\n'
question += proxypath
createfileorproxy = nuke.ask(question)
path = filepath if createfileorproxy else proxypath
if not os.path.isdir(path):
os.makedirs(path)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment