Nuke Tutorial - how to add local path in Project files
Use this script menu.py file # relativePath import re def relativePathNodes(): projPath = str(nuke.root().knob('project_directory').evaluate()) relative = '[file dirname [value root.name]]' for i in nuke.allNodes(): if i.Class() == 'Read': nodePath = str(nuke.filename(i)) replacePath = re.sub(projPath, relative, nodePath) i['file'].setValue(replacePath) local = nuke.menu('Nodes') local.addCommand('Other/relativePath', 'relativePathNodes()', 'ctrl+l')
Use this script menu.py file # relativePath import re def relativePathNodes(): projPath = str(nuke.root().knob('project_directory').evaluate()) relative = '[file dirname [value root.name]]' for i in nuke.allNodes(): if i.Class() == 'Read': nodePath = str(nuke.filename(i)) replacePath = re.sub(projPath, relative, nodePath) i['file'].setValue(replacePath) local = nuke.menu('Nodes') local.addCommand('Other/relativePath', 'relativePathNodes()', 'ctrl+l')