Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import nuke
- import os.path
- reads = nuke.allNodes('Read')
- err_cnt = 0
- for i, r in enumerate(reads):
- raw = r.knob('file').getValue()
- evaluated = r.knob('file').getEvaluatedValue()
- full_path = '{}/{}'.format(os.path.dirname(evaluated), os.path.basename(raw))
- try:
- r.knob('file').setValue(full_path)
- print('[Info] {}:\n"{}"->\n"{}"\n\n'.format(r.name(), raw, full_path))
- except Exception, e:
- print(e)
- print('[Error] Skipp: {}'.format(r.name()))
- err_cnt += 1
- if err_cnt == 0:
- print('# Done all successfully.')
- else:
- print('# Error has occured. Please check log.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement