Last active
May 11, 2020 13:50
-
-
Save shrimo/43a9a63dbb415905940adbc270eb1efb to your computer and use it in GitHub Desktop.
Reading multiple image files
This file contains 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
""" | |
Reading multiple image files | |
import sys | |
module_path = '/home/shrimo/Desktop/course/vfx_dev/nuke' | |
if module_path not in sys.path: | |
sys.path.append(module_path) | |
import multiple_reading | |
reload(multiple_reading) | |
multiple_reading.main() | |
""" | |
import os | |
import nuke | |
ext_list = ['.jpg', '.exr', '.png', '.tiff'] | |
unnecessary_ext = ['.xml', '.json'] | |
def main(): | |
folder = nuke.getFilename('Select folder', '*.*') | |
for seq in nuke.getFileNameList(folder): | |
if True in (ext in seq for ext in ext_list): | |
if True in (ext2 in seq for ext2 in unnecessary_ext): | |
continue | |
print seq | |
readNode = nuke.createNode('Read') | |
readNode.knob('file').fromUserText(folder + seq) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment