Posted By

charliefx on 11/11/09


Tagged

python nuke cfxProxyTools


Versions (?)

setProxyName


 / Published in: Python
 

requires proxydef.py

  1. # Copyright (c) 2009 Carlos Trijueque. All Rights Reserved.
  2. #
  3. # DESCRIPTION:
  4. #
  5. #
  6. #
  7. #
  8. #
  9.  
  10. import nuke
  11. from cfxProxyTools import *
  12.  
  13. def setProxyName():
  14. ''' asigns the proxy name to the proxy knob of a valid node'''
  15.  
  16. pn, pdir = '', proxy_dir + '/'
  17.  
  18. validNodes = [ i for i in nuke.selectedNodes() if 'proxy' in i.knobs() ]
  19. if len( validNodes ) != 0:
  20. for node in validNodes:
  21. pn = str(node['proxy'].getValue())
  22. if pn.find(pdir) >= 0:
  23. pn = pn.replace(pdir, '')
  24. else:
  25. pn = generateProxyName(node['file'].getValue())
  26. if os.name == "nt":
  27. pn = pn.replace('\\','/')
  28. node['proxy'].setValue(nuke.callbacks.filenameFilter(pn))
  29. else:
  30. nuke.message("No valid nodes selected")

Report this snippet  

You need to login to post a comment.