Advertisement
Guest User

Untitled

a guest
Apr 25th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. import nuke
  2. import os.path
  3.  
  4. reads = nuke.allNodes('Read')
  5. err_cnt = 0
  6. for i, r in enumerate(reads):
  7. raw = r.knob('file').getValue()
  8. evaluated = r.knob('file').getEvaluatedValue()
  9. full_path = '{}/{}'.format(os.path.dirname(evaluated), os.path.basename(raw))
  10. try:
  11. r.knob('file').setValue(full_path)
  12. print('[Info] {}:\n"{}"->\n"{}"\n\n'.format(r.name(), raw, full_path))
  13. except Exception, e:
  14. print(e)
  15. print('[Error] Skipp: {}'.format(r.name()))
  16. err_cnt += 1
  17. if err_cnt == 0:
  18. print('# Done all successfully.')
  19. else:
  20. print('# Error has occured. Please check log.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement