1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- import KEnv
- import os
- import nuke
-
- # KEnv
- try:
- project = os.getenv('PROJECT')
- except:
- project = "GEN"
-
- env = KEnv.create(PROJECT=project, APP_ID='nuke')
- ociopath = env.get('OCIO_CONFIG')
- projectID = env.get('PROJECT_ID')
- formats = env.get('IMAGEFORMATS')
- fps = env.get('FPS')
-
- class ProjectDefaults(KellerNukePlugin):
-
- def configurePlugin(self):
- ############################################################################################################################################
- # DEFAULTS
- #
- # JOB SPECIFIC DEFAULTS
- #
- ############################################################################################################################################
-
- # add formats from KEnv
- for key, value in formats.items():
- fav = '{1} {0}'.format(key, value)
- nuke.addFormat(fav)
-
- # add fileout Defaults
- nuke.knobDefault('Write.channels', 'rgba')
- nuke.knobDefault('Root.colorManagement', 'OCIO')
- nuke.knobDefault('Root.OCIO_config', 'custom')
- nuke.knobDefault('Root.customOCIOConfigPath', ociopath)
- # set format
- nuke.knobDefault('Root.format', projectID + '_WORK')
- # fps
- nuke.knobDefault('Root.fps', str(fps))
- # set viewer
- # viewer is set via config.ocio: active_views: [P3D65 Rec.709 Limited, sRGB, DCDM, DCDM P3D60 Limited..]
-
- # Write
- nuke.knobDefault("Write.channels", "rgba")
- nuke.knobDefault("Write.dpx.channels", "rgb")
- nuke.knobDefault("Write.create_directories", "1")
- nuke.knobDefault("Write.exr.noprefix", "1")
- nuke.knobDefault("Write.exr.metadata", "all metadata")
- # exr compression
- nuke.knobDefault("Write.exr.compression", "DWAA")
- def unconfigurePlugin(self):
- pass
|