Created
October 18, 2019 18:31
-
-
Save kpprt/ba84661da888aeeecd0d98a0fbf0d588 to your computer and use it in GitHub Desktop.
Short snippet to create output folders of a Write Node in Nuke.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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