No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

projectDefaults.py 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. import KEnv
  2. import os
  3. import nuke
  4. # KEnv
  5. try:
  6. project = os.getenv('PROJECT')
  7. except:
  8. project = "GEN"
  9. env = KEnv.create(PROJECT=project, APP_ID='nuke')
  10. ociopath = env.get('OCIO_CONFIG')
  11. projectID = env.get('PROJECT_ID')
  12. formats = env.get('IMAGEFORMATS')
  13. fps = env.get('FPS')
  14. class ProjectDefaults(KellerNukePlugin):
  15. def configurePlugin(self):
  16. ############################################################################################################################################
  17. # DEFAULTS
  18. #
  19. # JOB SPECIFIC DEFAULTS
  20. #
  21. ############################################################################################################################################
  22. # add formats from KEnv
  23. for key, value in formats.items():
  24. fav = '{1} {0}'.format(key, value)
  25. nuke.addFormat(fav)
  26. # add fileout Defaults
  27. nuke.knobDefault('Write.channels', 'rgba')
  28. nuke.knobDefault('Root.colorManagement', 'OCIO')
  29. nuke.knobDefault('Root.OCIO_config', 'custom')
  30. nuke.knobDefault('Root.customOCIOConfigPath', ociopath)
  31. # set format
  32. nuke.knobDefault('Root.format', projectID + '_WORK')
  33. # fps
  34. nuke.knobDefault('Root.fps', str(fps))
  35. # set viewer
  36. # viewer is set via config.ocio: active_views: [P3D65 Rec.709 Limited, sRGB, DCDM, DCDM P3D60 Limited..]
  37. # Write
  38. nuke.knobDefault("Write.channels", "rgba")
  39. nuke.knobDefault("Write.dpx.channels", "rgb")
  40. nuke.knobDefault("Write.create_directories", "1")
  41. nuke.knobDefault("Write.exr.noprefix", "1")
  42. nuke.knobDefault("Write.exr.metadata", "all metadata")
  43. # exr compression
  44. nuke.knobDefault("Write.exr.compression", "DWAA")
  45. def unconfigurePlugin(self):
  46. pass