diff --git a/spi-anim/config.ocio b/spi-anim/config.ocio index 32f148c3..d64ae1ab 100644 --- a/spi-anim/config.ocio +++ b/spi-anim/config.ocio @@ -1,5 +1,7 @@ -ocio_profile_version: 1 +ocio_profile_version: 2 +environment: + {} search_path: luts strictparsing: true luma: [0.2126, 0.7152, 0.0722] @@ -15,15 +17,18 @@ roles: scene_linear: lnf texture_paint: dt16 +file_rules: + - ! {name: Default, colorspace: default} + displays: - DCIP3: - - ! {name: Film, colorspace: p3dci8} - - ! {name: Log, colorspace: lm10} - - ! {name: Raw, colorspace: nc10} sRGB: - ! {name: Film, colorspace: vd16} - ! {name: Log, colorspace: lm10} - ! {name: Raw, colorspace: nc10} + DCIP3: + - ! {name: Film, colorspace: p3dci8} + - ! {name: Log, colorspace: lm10} + - ! {name: Raw, colorspace: nc10} active_displays: [sRGB, DCIP3] active_views: [Film, Log, Raw] @@ -32,10 +37,9 @@ colorspaces: - ! name: lnf family: ln - equalitygroup: + equalitygroup: "" bitdepth: 32f - description: | - lnf :linear show space + description: lnf :linear show space JJS isdata: false allocation: lg2 allocationvars: [-13, 4] @@ -43,10 +47,9 @@ colorspaces: - ! name: lnh family: ln - equalitygroup: + equalitygroup: "" bitdepth: 16f - description: | - lnh :linear show space + description: lnh :linear show space isdata: false allocation: lg2 allocationvars: [-13, 4] @@ -54,10 +57,9 @@ colorspaces: - ! name: lm16 family: lm - equalitygroup: + equalitygroup: "" bitdepth: 16ui - description: | - lm16 : Log Monitor this space has a log like response and srgb primaries, it is used for color grading + description: "lm16 : Log Monitor this space has a log like response and srgb primaries, it is used for color grading " isdata: false allocation: uniform to_reference: ! {src: lm16.spi1d, interpolation: linear} @@ -65,10 +67,9 @@ colorspaces: - ! name: lm10 family: lm - equalitygroup: + equalitygroup: "" bitdepth: 10ui - description: | - lm10 : Log Monitor this space has a log like response and srgb primaries, it is used for color grading + description: "lm10 : Log Monitor this space has a log like response and srgb primaries, it is used for color grading " isdata: false allocation: uniform to_reference: ! {src: lm10.spi1d, interpolation: linear} @@ -76,10 +77,9 @@ colorspaces: - ! name: lmf family: lm - equalitygroup: + equalitygroup: "" bitdepth: 32f - description: | - lmf : Log Monitor this space has a log like response and srgb primaries, it is used as a compositing log + description: "lmf : Log Monitor this space has a log like response and srgb primaries, it is used as a compositing log" isdata: false allocation: uniform allocationvars: [-0.2, 2.484] @@ -88,10 +88,9 @@ colorspaces: - ! name: vd16 family: vd - equalitygroup: + equalitygroup: "" bitdepth: 16ui - description: | - vd16 : The simple video conversion from a gamma 2.2 srgb space + description: "vd16 : The simple video conversion from a gamma 2.2 srgb space" isdata: false allocation: uniform to_reference: ! @@ -101,10 +100,9 @@ colorspaces: - ! name: vd10 family: vd - equalitygroup: + equalitygroup: "" bitdepth: 10ui - description: | - vd10 : The simple video conversion from a gamma 2.2 srgb space + description: "vd10 : The simple video conversion from a gamma 2.2 srgb space" isdata: false allocation: uniform to_reference: ! @@ -114,10 +112,9 @@ colorspaces: - ! name: vd8 family: vd - equalitygroup: + equalitygroup: "" bitdepth: 8ui - description: | - vd8 : The simple video conversion from a gamma 2.2 srgb space + description: "vd8 : The simple video conversion from a gamma 2.2 srgb space" isdata: false allocation: uniform to_reference: ! @@ -127,52 +124,48 @@ colorspaces: - ! name: hd10 family: hd - equalitygroup: + equalitygroup: "" bitdepth: 10ui - description: | - hd10 : The simple conversion for REC709 + description: "hd10 : The simple conversion for REC709" isdata: false allocation: uniform to_reference: ! children: - - ! {src: hdOffset.spimtx, interpolation: nearest, direction: inverse} - ! {src: vd16, dst: lnf} + - ! {src: hdOffset.spimtx, interpolation: nearest, direction: inverse} - ! name: dt16 family: dt - equalitygroup: + equalitygroup: "" bitdepth: 16ui - description: | - dt16 :diffuse texture conversion + description: dt16 :diffuse texture conversion isdata: false allocation: uniform to_reference: ! children: - - ! {src: dt.spimtx, interpolation: nearest} - ! {src: vd16, dst: lnf} + - ! {src: dt.spimtx, interpolation: nearest} - ! name: mp16 family: mp - equalitygroup: + equalitygroup: "" bitdepth: 16ui - description: | - mp16 : conversion for matte painting + description: "mp16 : conversion for matte painting" isdata: false allocation: uniform to_reference: ! children: - - ! {src: mp.spimtx, interpolation: nearest} - ! {src: vd16, dst: lnf} + - ! {src: mp.spimtx, interpolation: nearest} - ! name: cpf family: cp - equalitygroup: + equalitygroup: "" bitdepth: 32f - description: | - cpf :video like conversion used for color picking + description: "cpf :video like conversion used for color picking " isdata: false allocation: uniform to_reference: ! {src: cpf.spi1d, interpolation: nearest} @@ -180,74 +173,68 @@ colorspaces: - ! name: nc8 family: nc - equalitygroup: + equalitygroup: "" bitdepth: 8ui - description: | - nc8 :nc,Non-color used to store non-color data such as depth or surface normals + description: nc8 :nc,Non-color used to store non-color data such as depth or surface normals isdata: true allocation: uniform - ! name: nc10 family: nc - equalitygroup: + equalitygroup: "" bitdepth: 10ui - description: | - nc10 :nc,Non-color used to store non-color data such as depth or surface normals + description: nc10 :nc,Non-color used to store non-color data such as depth or surface normals isdata: true allocation: uniform - ! name: nc16 family: nc - equalitygroup: + equalitygroup: "" bitdepth: 16ui - description: | - nc16 :nc,Non-color used to store non-color data such as depth or surface normals + description: nc16 :nc,Non-color used to store non-color data such as depth or surface normals isdata: true allocation: uniform - ! name: ncf family: nc - equalitygroup: + equalitygroup: "" bitdepth: 32f - description: | - ncf :nc,Non-color used to store non-color data such as depth or surface normals + description: ncf :nc,Non-color used to store non-color data such as depth or surface normals isdata: true allocation: uniform - ! name: p3dci8 family: p3dci - equalitygroup: + equalitygroup: "" bitdepth: 8ui - description: | - p3dci8 : 8 Bit int rgb display space for gamma 2.6 P3 projection. + description: "p3dci8 : 8 Bit int rgb display space for gamma 2.6 P3 projection." isdata: false allocation: uniform from_reference: ! children: - - ! {src: lnf, dst: vd16} - - ! {value: [2.2, 2.2, 2.2, 1]} - - ! {src: srgb_to_p3d65.spimtx, interpolation: linear} - - ! {src: p3d65_to_pdci.spimtx, interpolation: linear} + - ! {src: correction.spi1d} + - ! {value: 2.6, direction: inverse} - ! {src: htr_dlp_tweak.spimtx, interpolation: linear} - - ! {value: [2.6, 2.6, 2.6, 1], direction: inverse} - - ! {src: correction.spi1d, cccid: forward, interpolation: linear} + - ! {src: p3d65_to_pdci.spimtx, interpolation: linear} + - ! {src: srgb_to_p3d65.spimtx, interpolation: linear} + - ! {value: 2.2} + - ! {src: lnf, dst: vd16} - ! name: xyz16 family: xyz - equalitygroup: + equalitygroup: "" bitdepth: 16ui - description: | - xyz16 : 16 Bit int space for DCP creation. + description: "xyz16 : 16 Bit int space for DCP creation." isdata: false allocation: uniform from_reference: ! children: + - ! {value: 2.6, direction: inverse} + - ! {src: p3_to_xyz16_corrected_wp.spimtx} + - ! {value: 2.6} - ! {src: lnf, dst: p3dci8} - - ! {value: [2.6, 2.6, 2.6, 1]} - - ! {src: p3_to_xyz16_corrected_wp.spimtx, interpolation: unknown} - - ! {value: [2.6, 2.6, 2.6, 1], direction: inverse} diff --git a/spi-anim/makeconfig_anim.py b/spi-anim/makeconfig_anim.py index 20ffd37a..e12c6481 100644 --- a/spi-anim/makeconfig_anim.py +++ b/spi-anim/makeconfig_anim.py @@ -1,9 +1,7 @@ -#!/usr/bin/env python - -import SpImport, math, os, sys -OCIO = SpImport.SpComp2("PyOpenColorIO",2) - +#!/usr/bin/env python3 +import math,os,sys +import PyOpenColorIO as OCIO outputfilename = "config.ocio" @@ -14,92 +12,92 @@ config.setSearchPath(':'.join(LUT_SEARCH_PATH)) # Set roles -config.setRole(OCIO.Constants.ROLE_SCENE_LINEAR, "lnf") -config.setRole(OCIO.Constants.ROLE_REFERENCE, "lnf") -config.setRole(OCIO.Constants.ROLE_COLOR_TIMING, "lm10") -config.setRole(OCIO.Constants.ROLE_COMPOSITING_LOG, "lmf") -config.setRole(OCIO.Constants.ROLE_COLOR_PICKING,"cpf") -config.setRole(OCIO.Constants.ROLE_DATA,"ncf") -config.setRole(OCIO.Constants.ROLE_DEFAULT,"ncf") -config.setRole(OCIO.Constants.ROLE_MATTE_PAINT,"mp16") -config.setRole(OCIO.Constants.ROLE_TEXTURE_PAINT,"dt16") +config.setRole(OCIO.ROLE_SCENE_LINEAR, "lnf") +config.setRole(OCIO.ROLE_REFERENCE, "lnf") +config.setRole(OCIO.ROLE_COLOR_TIMING, "lm10") +config.setRole(OCIO.ROLE_COMPOSITING_LOG, "lmf") +config.setRole(OCIO.ROLE_COLOR_PICKING,"cpf") +config.setRole(OCIO.ROLE_DATA,"ncf") +config.setRole(OCIO.ROLE_DEFAULT,"ncf") +config.setRole(OCIO.ROLE_MATTE_PAINT,"mp16") +config.setRole(OCIO.ROLE_TEXTURE_PAINT,"dt16") ## Scene OCIO.Constants.INTERP_LINEAR ############################################################### cs = OCIO.ColorSpace(family='ln', name='lnf') -cs.setDescription("lnf :linear show space") -cs.setBitDepth(OCIO.Constants.BIT_DEPTH_F32) +cs.setDescription("lnf :linear show space JJS") +cs.setBitDepth(OCIO.BIT_DEPTH_F32) cs.setAllocationVars([-13.0,4.0]) -cs.setAllocation(OCIO.Constants.ALLOCATION_LG2) +cs.setAllocation(OCIO.ALLOCATION_LG2) config.addColorSpace(cs) cs = OCIO.ColorSpace(family='ln', name='lnh') cs.setDescription("lnh :linear show space") -cs.setBitDepth(OCIO.Constants.BIT_DEPTH_F16) +cs.setBitDepth(OCIO.BIT_DEPTH_F16) cs.setAllocationVars([-13.0,4.0]) -cs.setAllocation(OCIO.Constants.ALLOCATION_LG2) +cs.setAllocation(OCIO.ALLOCATION_LG2) config.addColorSpace(cs) ## Log Monitor ######################################################################## cs = OCIO.ColorSpace(family='lm',name='lm16') cs.setDescription("lm16 : Log Monitor this space has a log like response and srgb primaries, it is used for color grading ") -cs.setBitDepth(OCIO.Constants.BIT_DEPTH_UINT16) -t=OCIO.FileTransform('lm16.spi1d',direction=OCIO.Constants.TRANSFORM_DIR_FORWARD,interpolation=OCIO.Constants.INTERP_LINEAR) -cs.setTransform(t, OCIO.Constants.COLORSPACE_DIR_TO_REFERENCE) +cs.setBitDepth(OCIO.BIT_DEPTH_UINT16) +t=OCIO.FileTransform('lm16.spi1d',direction=OCIO.TRANSFORM_DIR_FORWARD,interpolation=OCIO.INTERP_LINEAR) +cs.setTransform(t, OCIO.COLORSPACE_DIR_TO_REFERENCE) config.addColorSpace(cs) cs = OCIO.ColorSpace(family='lm',name='lm10') cs.setDescription("lm10 : Log Monitor this space has a log like response and srgb primaries, it is used for color grading ") -cs.setBitDepth(OCIO.Constants.BIT_DEPTH_UINT10) -t=OCIO.FileTransform('lm10.spi1d',direction=OCIO.Constants.TRANSFORM_DIR_FORWARD,interpolation=OCIO.Constants.INTERP_LINEAR) -cs.setTransform(t, OCIO.Constants.COLORSPACE_DIR_TO_REFERENCE) +cs.setBitDepth(OCIO.BIT_DEPTH_UINT10) +t=OCIO.FileTransform('lm10.spi1d',direction=OCIO.TRANSFORM_DIR_FORWARD,interpolation=OCIO.INTERP_LINEAR) +cs.setTransform(t, OCIO.COLORSPACE_DIR_TO_REFERENCE) config.addColorSpace(cs) cs = OCIO.ColorSpace(family='lm',name='lmf') cs.setDescription("lmf : Log Monitor this space has a log like response and srgb primaries, it is used as a compositing log") -cs.setBitDepth(OCIO.Constants.BIT_DEPTH_F32) +cs.setBitDepth(OCIO.BIT_DEPTH_F32) cs.setAllocationVars([-0.2,2.484]) -t=OCIO.FileTransform('lmf.spi1d',direction=OCIO.Constants.TRANSFORM_DIR_FORWARD,interpolation=OCIO.Constants.INTERP_LINEAR) -cs.setTransform(t, OCIO.Constants.COLORSPACE_DIR_TO_REFERENCE) +t=OCIO.FileTransform('lmf.spi1d',direction=OCIO.TRANSFORM_DIR_FORWARD,interpolation=OCIO.INTERP_LINEAR) +cs.setTransform(t, OCIO.COLORSPACE_DIR_TO_REFERENCE) config.addColorSpace(cs) ## VD ######################################################################## cs = OCIO.ColorSpace(family='vd',name='vd16') cs.setDescription("vd16 : The simple video conversion from a gamma 2.2 srgb space") -cs.setBitDepth(OCIO.Constants.BIT_DEPTH_UINT16) +cs.setBitDepth(OCIO.BIT_DEPTH_UINT16) groupTransform = OCIO.GroupTransform() -groupTransform.push_back(OCIO.FileTransform('vd16.spi1d',direction=OCIO.Constants.TRANSFORM_DIR_FORWARD,interpolation=OCIO.Constants.INTERP_NEAREST)) -cs.setTransform(groupTransform, OCIO.Constants.COLORSPACE_DIR_TO_REFERENCE) +groupTransform.prependTransform(OCIO.FileTransform('vd16.spi1d',direction=OCIO.TRANSFORM_DIR_FORWARD,interpolation=OCIO.INTERP_NEAREST)) +cs.setTransform(groupTransform, OCIO.COLORSPACE_DIR_TO_REFERENCE) config.addColorSpace(cs) cs = OCIO.ColorSpace(family='vd',name='vd10') cs.setDescription("vd10 : The simple video conversion from a gamma 2.2 srgb space") -cs.setBitDepth(OCIO.Constants.BIT_DEPTH_UINT10) +cs.setBitDepth(OCIO.BIT_DEPTH_UINT10) groupTransform = OCIO.GroupTransform() -groupTransform.push_back(OCIO.FileTransform('vd10.spi1d',direction=OCIO.Constants.TRANSFORM_DIR_FORWARD,interpolation=OCIO.Constants.INTERP_NEAREST)) -cs.setTransform(groupTransform, OCIO.Constants.COLORSPACE_DIR_TO_REFERENCE) +groupTransform.prependTransform(OCIO.FileTransform('vd10.spi1d',direction=OCIO.TRANSFORM_DIR_FORWARD,interpolation=OCIO.INTERP_NEAREST)) +cs.setTransform(groupTransform, OCIO.COLORSPACE_DIR_TO_REFERENCE) config.addColorSpace(cs) cs = OCIO.ColorSpace(family='vd',name='vd8') cs.setDescription("vd8 : The simple video conversion from a gamma 2.2 srgb space") -cs.setBitDepth(OCIO.Constants.BIT_DEPTH_UINT8) +cs.setBitDepth(OCIO.BIT_DEPTH_UINT8) groupTransform = OCIO.GroupTransform() -groupTransform.push_back(OCIO.FileTransform('vd8.spi1d',direction=OCIO.Constants.TRANSFORM_DIR_FORWARD,interpolation=OCIO.Constants.INTERP_NEAREST)) -cs.setTransform(groupTransform, OCIO.Constants.COLORSPACE_DIR_TO_REFERENCE) +groupTransform.prependTransform(OCIO.FileTransform('vd8.spi1d',direction=OCIO.TRANSFORM_DIR_FORWARD,interpolation=OCIO.INTERP_NEAREST)) +cs.setTransform(groupTransform, OCIO.COLORSPACE_DIR_TO_REFERENCE) config.addColorSpace(cs) ## REC709 CONVERSIONS ######################################################################## cs = OCIO.ColorSpace(family='hd',name='hd10') cs.setDescription("hd10 : The simple conversion for REC709") -cs.setBitDepth(OCIO.Constants.BIT_DEPTH_UINT10) +cs.setBitDepth(OCIO.BIT_DEPTH_UINT10) groupTransform = OCIO.GroupTransform() -groupTransform.push_back(OCIO.FileTransform('hdOffset.spimtx',direction=OCIO.Constants.TRANSFORM_DIR_INVERSE,interpolation=OCIO.Constants.INTERP_NEAREST)) -groupTransform.push_back(OCIO.ColorSpaceTransform(src='vd16', dst='lnf')) -cs.setTransform(groupTransform, OCIO.Constants.COLORSPACE_DIR_TO_REFERENCE) +groupTransform.prependTransform(OCIO.FileTransform('hdOffset.spimtx',direction=OCIO.TRANSFORM_DIR_INVERSE,interpolation=OCIO.INTERP_NEAREST)) +groupTransform.prependTransform(OCIO.ColorSpaceTransform(src='vd16', dst='lnf')) +cs.setTransform(groupTransform, OCIO.COLORSPACE_DIR_TO_REFERENCE) config.addColorSpace(cs) @@ -107,22 +105,22 @@ cs = OCIO.ColorSpace(family='dt',name='dt16') cs.setDescription("dt16 :diffuse texture conversion") -cs.setBitDepth(OCIO.Constants.BIT_DEPTH_UINT16) +cs.setBitDepth(OCIO.BIT_DEPTH_UINT16) groupTransform = OCIO.GroupTransform() -groupTransform.push_back(OCIO.FileTransform('dt.spimtx',direction=OCIO.Constants.TRANSFORM_DIR_FORWARD,interpolation=OCIO.Constants.INTERP_NEAREST)) -groupTransform.push_back(OCIO.ColorSpaceTransform(src='vd16', dst='lnf')) -cs.setTransform(groupTransform, OCIO.Constants.COLORSPACE_DIR_TO_REFERENCE) +groupTransform.prependTransform(OCIO.FileTransform('dt.spimtx',direction=OCIO.TRANSFORM_DIR_FORWARD,interpolation=OCIO.INTERP_NEAREST)) +groupTransform.prependTransform(OCIO.ColorSpaceTransform(src='vd16', dst='lnf')) +cs.setTransform(groupTransform, OCIO.COLORSPACE_DIR_TO_REFERENCE) config.addColorSpace(cs) ## MATTE PUBLISHING ######################################################################## cs = OCIO.ColorSpace(family='mp',name='mp16') cs.setDescription("mp16 : conversion for matte painting") -cs.setBitDepth(OCIO.Constants.BIT_DEPTH_UINT16) +cs.setBitDepth(OCIO.BIT_DEPTH_UINT16) groupTransform = OCIO.GroupTransform() -groupTransform.push_back(OCIO.FileTransform('mp.spimtx',direction=OCIO.Constants.TRANSFORM_DIR_FORWARD,interpolation=OCIO.Constants.INTERP_NEAREST)) -groupTransform.push_back(OCIO.ColorSpaceTransform(src='vd16', dst='lnf')) -cs.setTransform(groupTransform, OCIO.Constants.COLORSPACE_DIR_TO_REFERENCE) +groupTransform.prependTransform(OCIO.FileTransform('mp.spimtx',direction=OCIO.TRANSFORM_DIR_FORWARD,interpolation=OCIO.INTERP_NEAREST)) +groupTransform.prependTransform(OCIO.ColorSpaceTransform(src='vd16', dst='lnf')) +cs.setTransform(groupTransform, OCIO.COLORSPACE_DIR_TO_REFERENCE) config.addColorSpace(cs) @@ -130,33 +128,33 @@ cs = OCIO.ColorSpace(family='cp',name='cpf') cs.setDescription("cpf :video like conversion used for color picking ") -cs.setBitDepth(OCIO.Constants.BIT_DEPTH_F32) -cs.setTransform(OCIO.FileTransform('cpf.spi1d',direction=OCIO.Constants.TRANSFORM_DIR_FORWARD,interpolation=OCIO.Constants.INTERP_NEAREST), OCIO.Constants.COLORSPACE_DIR_TO_REFERENCE) +cs.setBitDepth(OCIO.BIT_DEPTH_F32) +cs.setTransform(OCIO.FileTransform('cpf.spi1d',direction=OCIO.TRANSFORM_DIR_FORWARD,interpolation=OCIO.INTERP_NEAREST), OCIO.COLORSPACE_DIR_TO_REFERENCE) config.addColorSpace(cs) ## DATA ######################################################################## cs = OCIO.ColorSpace(family='nc',name='nc8') cs.setDescription("nc8 :nc,Non-color used to store non-color data such as depth or surface normals") -cs.setBitDepth(OCIO.Constants.BIT_DEPTH_UINT8) +cs.setBitDepth(OCIO.BIT_DEPTH_UINT8) cs.setIsData(True) config.addColorSpace(cs) cs = OCIO.ColorSpace(family='nc',name='nc10') cs.setDescription("nc10 :nc,Non-color used to store non-color data such as depth or surface normals") -cs.setBitDepth(OCIO.Constants.BIT_DEPTH_UINT10) +cs.setBitDepth(OCIO.BIT_DEPTH_UINT10) cs.setIsData(True) config.addColorSpace(cs) cs = OCIO.ColorSpace(family='nc',name='nc16') cs.setDescription("nc16 :nc,Non-color used to store non-color data such as depth or surface normals") -cs.setBitDepth(OCIO.Constants.BIT_DEPTH_UINT16) +cs.setBitDepth(OCIO.BIT_DEPTH_UINT16) cs.setIsData(True) config.addColorSpace(cs) cs = OCIO.ColorSpace(family='nc',name='ncf') cs.setDescription("ncf :nc,Non-color used to store non-color data such as depth or surface normals") -cs.setBitDepth(OCIO.Constants.BIT_DEPTH_F32) +cs.setBitDepth(OCIO.BIT_DEPTH_F32) cs.setIsData(True) config.addColorSpace(cs) @@ -170,52 +168,53 @@ # cs = OCIO.ColorSpace(family='p3dci',name='p3dci8') cs.setDescription("p3dci8 : 8 Bit int rgb display space for gamma 2.6 P3 projection.") -cs.setBitDepth(OCIO.Constants.BIT_DEPTH_UINT8) +cs.setBitDepth(OCIO.BIT_DEPTH_UINT8) groupTransform = OCIO.GroupTransform() -groupTransform.push_back(OCIO.ColorSpaceTransform(src='lnf', dst='vd16')) -groupTransform.push_back(OCIO.ExponentTransform(value=[2.2,2.2,2.2,1.0], direction=OCIO.Constants.TRANSFORM_DIR_FORWARD)) -groupTransform.push_back(OCIO.FileTransform('srgb_to_p3d65.spimtx',direction=OCIO.Constants.TRANSFORM_DIR_FORWARD,interpolation=OCIO.Constants.INTERP_LINEAR)) -groupTransform.push_back(OCIO.FileTransform('p3d65_to_pdci.spimtx',direction=OCIO.Constants.TRANSFORM_DIR_FORWARD,interpolation=OCIO.Constants.INTERP_LINEAR)) -groupTransform.push_back(OCIO.FileTransform('htr_dlp_tweak.spimtx',direction=OCIO.Constants.TRANSFORM_DIR_FORWARD,interpolation=OCIO.Constants.INTERP_LINEAR)) -groupTransform.push_back(OCIO.ExponentTransform(value=[2.6,2.6,2.6,1.0], direction=OCIO.Constants.TRANSFORM_DIR_INVERSE)) -groupTransform.push_back(OCIO.FileTransform('correction.spi1d',OCIO.Constants.TRANSFORM_DIR_FORWARD,interpolation=OCIO.Constants.INTERP_LINEAR)) -cs.setTransform(groupTransform, OCIO.Constants.COLORSPACE_DIR_FROM_REFERENCE) +groupTransform.prependTransform(OCIO.ColorSpaceTransform(src='lnf', dst='vd16')) +groupTransform.prependTransform(OCIO.ExponentTransform(value=[2.2,2.2,2.2,1.0], direction=OCIO.TRANSFORM_DIR_FORWARD)) +groupTransform.prependTransform(OCIO.FileTransform('srgb_to_p3d65.spimtx',direction=OCIO.TRANSFORM_DIR_FORWARD,interpolation=OCIO.INTERP_LINEAR)) +groupTransform.prependTransform(OCIO.FileTransform('p3d65_to_pdci.spimtx',direction=OCIO.TRANSFORM_DIR_FORWARD,interpolation=OCIO.INTERP_LINEAR)) +groupTransform.prependTransform(OCIO.FileTransform('htr_dlp_tweak.spimtx',direction=OCIO.TRANSFORM_DIR_FORWARD,interpolation=OCIO.INTERP_LINEAR)) +groupTransform.prependTransform(OCIO.ExponentTransform(value=[2.6,2.6,2.6,1.0], direction=OCIO.TRANSFORM_DIR_INVERSE)) +groupTransform.prependTransform(OCIO.FileTransform('correction.spi1d')) +cs.setTransform(groupTransform, OCIO.COLORSPACE_DIR_FROM_REFERENCE) config.addColorSpace(cs) cs = OCIO.ColorSpace(family='xyz',name='xyz16') cs.setDescription("xyz16 : 16 Bit int space for DCP creation.") -cs.setBitDepth(OCIO.Constants.BIT_DEPTH_UINT16) +cs.setBitDepth(OCIO.BIT_DEPTH_UINT16) groupTransform = OCIO.GroupTransform() -groupTransform.push_back(OCIO.ColorSpaceTransform(src='lnf',dst='p3dci8')) -groupTransform.push_back(OCIO.ExponentTransform([2.6,2.6,2.6,1.0])) -groupTransform.push_back(OCIO.FileTransform('p3_to_xyz16_corrected_wp.spimtx')) -groupTransform.push_back(OCIO.ExponentTransform([2.6,2.6,2.6,1.0],direction=OCIO.Constants.TRANSFORM_DIR_INVERSE)) -cs.setTransform(groupTransform, OCIO.Constants.COLORSPACE_DIR_FROM_REFERENCE) +groupTransform.prependTransform(OCIO.ColorSpaceTransform(src='lnf',dst='p3dci8')) +groupTransform.prependTransform(OCIO.ExponentTransform([2.6,2.6,2.6,1.0])) +groupTransform.prependTransform(OCIO.FileTransform('p3_to_xyz16_corrected_wp.spimtx')) +groupTransform.prependTransform(OCIO.ExponentTransform([2.6,2.6,2.6,1.0],direction=OCIO.TRANSFORM_DIR_INVERSE)) +cs.setTransform(groupTransform, OCIO.COLORSPACE_DIR_FROM_REFERENCE) config.addColorSpace(cs) + + ## DISPLAY SPACES ################################################################## for name,colorspace in [ ['Film','vd16'], ['Log','lm10'],['Raw','nc10']]: - config.addDisplay('sRGB',name,colorspace) - + config.addDisplayView('sRGB',name,colorspace) for name,colorspace in [ ['Film','p3dci8'], ['Log','lm10'], ['Raw','nc10']]: - config.addDisplay('DCIP3',name,colorspace) - + config.addDisplayView('DCIP3',name,colorspace) config.setActiveViews(','.join(['Film','Log','Raw'])) config.setActiveDisplays(','.join(['sRGB','DCIP3'])) + try: - config.sanityCheck() -except Exception,e: - print e - print "Configuration was not written due to a failed Sanity Check" + config.validate() +except e: + print(e) + print ("Configuration was not written due to a failed Sanity Check") sys.exit() -else: - f = file(outputfilename,"w") +else: + f = open(outputfilename,"w") f.write(config.serialize()) f.close() - print "Wrote",outputfilename + print ("Wrote %s"%outputfilename) diff --git a/spi-vfx/config.ocio b/spi-vfx/config.ocio index 21aa3379..5a4597ce 100644 --- a/spi-vfx/config.ocio +++ b/spi-vfx/config.ocio @@ -1,5 +1,7 @@ -ocio_profile_version: 1 +ocio_profile_version: 2 +environment: + {} search_path: luts strictparsing: true luma: [0.2126, 0.7152, 0.0722] @@ -15,15 +17,18 @@ roles: scene_linear: lnf texture_paint: dt16 +file_rules: + - ! {name: Default, colorspace: default} + displays: - DCIP3: - - ! {name: Film, colorspace: p3dci8} - - ! {name: Log, colorspace: lg10} - - ! {name: Raw, colorspace: nc10} sRGB: - ! {name: Film, colorspace: srgb8} - ! {name: Log, colorspace: lg10} - ! {name: Raw, colorspace: nc10} + DCIP3: + - ! {name: Film, colorspace: p3dci8} + - ! {name: Log, colorspace: lg10} + - ! {name: Raw, colorspace: nc10} active_displays: [sRGB, DCIP3] active_views: [Film, Log, Raw] @@ -32,10 +37,9 @@ colorspaces: - ! name: lnf family: ln - equalitygroup: + equalitygroup: "" bitdepth: 32f - description: | - lnf : linear show space + description: "lnf : linear show space" isdata: false allocation: lg2 allocationvars: [-15, 6] @@ -43,10 +47,9 @@ colorspaces: - ! name: lnh family: ln - equalitygroup: + equalitygroup: "" bitdepth: 16f - description: | - lnh : linear show space + description: "lnh : linear show space" isdata: false allocation: lg2 allocationvars: [-15, 6] @@ -54,10 +57,9 @@ colorspaces: - ! name: ln16 family: ln - equalitygroup: + equalitygroup: "" bitdepth: 16ui - description: | - ln16 : linear show space + description: "ln16 : linear show space" isdata: false allocation: lg2 allocationvars: [-15, 0] @@ -65,10 +67,9 @@ colorspaces: - ! name: lg16 family: lg - equalitygroup: + equalitygroup: "" bitdepth: 16ui - description: | - lg16 : conversion from film log + description: "lg16 : conversion from film log " isdata: false allocation: uniform to_reference: ! {src: lg16.spi1d, interpolation: nearest} @@ -76,10 +77,9 @@ colorspaces: - ! name: lg10 family: lg - equalitygroup: + equalitygroup: "" bitdepth: 10ui - description: | - lg10 : conversion from film log + description: "lg10 : conversion from film log" isdata: false allocation: uniform to_reference: ! {src: lg10.spi1d, interpolation: nearest} @@ -87,10 +87,9 @@ colorspaces: - ! name: lgf family: lg - equalitygroup: + equalitygroup: "" bitdepth: 32f - description: | - lgf : conversion from film log + description: "lgf : conversion from film log" isdata: false allocation: uniform allocationvars: [-0.25, 1.5] @@ -99,10 +98,9 @@ colorspaces: - ! name: gn10 family: gn - equalitygroup: + equalitygroup: "" bitdepth: 10ui - description: | - gn10 :conversion from Panalog + description: gn10 :conversion from Panalog isdata: false allocation: uniform to_reference: ! {src: gn10.spi1d, interpolation: nearest} @@ -110,80 +108,74 @@ colorspaces: - ! name: vd16 family: vd - equalitygroup: + equalitygroup: "" bitdepth: 16ui - description: | - vd16 :conversion from a gamma 2.2 + description: "vd16 :conversion from a gamma 2.2 " isdata: false allocation: uniform to_reference: ! children: - - ! {src: version_8_whitebalanced.spimtx, interpolation: unknown, direction: inverse} - ! {src: vd16.spi1d, interpolation: nearest} + - ! {src: version_8_whitebalanced.spimtx, direction: inverse} - ! name: vd10 family: vd - equalitygroup: + equalitygroup: "" bitdepth: 10ui - description: | - vd10 :conversion from a gamma 2.2 + description: "vd10 :conversion from a gamma 2.2 " isdata: false allocation: uniform to_reference: ! children: - - ! {src: version_8_whitebalanced.spimtx, interpolation: unknown, direction: inverse} - ! {src: vd10.spi1d, interpolation: nearest} + - ! {src: version_8_whitebalanced.spimtx, direction: inverse} - ! name: vd8 family: vd - equalitygroup: + equalitygroup: "" bitdepth: 8ui - description: | - vd8 :conversion from a gamma 2.2 + description: vd8 :conversion from a gamma 2.2 isdata: false allocation: uniform to_reference: ! children: - - ! {src: version_8_whitebalanced.spimtx, interpolation: unknown, direction: inverse} - ! {src: vd8.spi1d, interpolation: nearest} + - ! {src: version_8_whitebalanced.spimtx, direction: inverse} - ! name: hd10 family: hd - equalitygroup: + equalitygroup: "" bitdepth: 10ui - description: | - hd10 : conversion from REC709 + description: "hd10 : conversion from REC709" isdata: false allocation: uniform to_reference: ! children: - - ! {src: hdOffset.spimtx, interpolation: nearest, direction: inverse} - ! {src: vd16, dst: lnf} + - ! {src: hdOffset.spimtx, interpolation: nearest, direction: inverse} - ! name: dt16 family: dt - equalitygroup: + equalitygroup: "" bitdepth: 16ui - description: | - dt16 :conversion for diffuse texture + description: dt16 :conversion for diffuse texture isdata: false allocation: uniform to_reference: ! children: - - ! {src: diffuseTextureMultiplier.spimtx, interpolation: nearest} - ! {src: vd16, dst: lnf} + - ! {src: diffuseTextureMultiplier.spimtx, interpolation: nearest} - ! name: cpf family: cp - equalitygroup: + equalitygroup: "" bitdepth: 32f - description: | - cpf :video like conversion used for color picking + description: "cpf :video like conversion used for color picking " isdata: false allocation: uniform to_reference: ! {src: cpf.spi1d, interpolation: linear} @@ -191,83 +183,76 @@ colorspaces: - ! name: nc8 family: nc - equalitygroup: + equalitygroup: "" bitdepth: 8ui - description: | - nc8 :nc,Non-color used to store non-color data such as depth or surface normals + description: nc8 :nc,Non-color used to store non-color data such as depth or surface normals isdata: true allocation: uniform - ! name: nc10 family: nc - equalitygroup: + equalitygroup: "" bitdepth: 10ui - description: | - nc10 :nc,Non-color used to store non-color data such as depth or surface normals + description: nc10 :nc,Non-color used to store non-color data such as depth or surface normals isdata: true allocation: uniform - ! name: nc16 family: nc - equalitygroup: + equalitygroup: "" bitdepth: 16ui - description: | - nc16 :nc,Non-color used to store non-color data such as depth or surface normals + description: nc16 :nc,Non-color used to store non-color data such as depth or surface normals isdata: true allocation: uniform - ! name: ncf family: nc - equalitygroup: + equalitygroup: "" bitdepth: 32f - description: | - ncf :nc,Non-color used to store non-color data such as depth or surface normals + description: ncf :nc,Non-color used to store non-color data such as depth or surface normals isdata: true allocation: uniform - ! name: srgb8 family: srgb - equalitygroup: + equalitygroup: "" bitdepth: 8ui - description: | - srgb8 :rgb display space for the srgb standard. + description: srgb8 :rgb display space for the srgb standard. isdata: false allocation: uniform from_reference: ! children: - - ! {src: lnf, dst: lg10} - ! {src: spi_ocio_srgb_test.spi3d, interpolation: linear} + - ! {src: lnf, dst: lg10} - ! name: p3dci8 family: p3dci - equalitygroup: + equalitygroup: "" bitdepth: 8ui - description: | - p3dci8 :rgb display space for gamma 2.6 P3 projection. + description: p3dci8 :rgb display space for gamma 2.6 P3 projection. isdata: false allocation: uniform from_reference: ! children: - - ! {src: lnf, dst: lg10} - ! {src: colorworks_filmlg_to_p3.3dl, interpolation: linear} + - ! {src: lnf, dst: lg10} - ! name: xyz16 family: xyz - equalitygroup: + equalitygroup: "" bitdepth: 16ui - description: | - xyz16 :Conversion for DCP creation. + description: xyz16 :Conversion for DCP creation. isdata: false allocation: uniform from_reference: ! children: + - ! {value: 2.6, direction: inverse} + - ! {src: p3_to_xyz16_corrected_wp.spimtx} + - ! {value: 2.6} - ! {src: lnf, dst: p3dci8} - - ! {value: [2.6, 2.6, 2.6, 1]} - - ! {src: p3_to_xyz16_corrected_wp.spimtx, interpolation: unknown} - - ! {value: [2.6, 2.6, 2.6, 1], direction: inverse} diff --git a/spi-vfx/make_vfx_ocio.py b/spi-vfx/make_vfx_ocio.py old mode 100644 new mode 100755 index d5908049..9a324937 --- a/spi-vfx/make_vfx_ocio.py +++ b/spi-vfx/make_vfx_ocio.py @@ -1,11 +1,9 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 +import math,os,sys +import PyOpenColorIO as OCIO -import math, os, sys -import SpImport -OCIO = SpImport.SpComp2("PyOpenColorIO",2) -print "OCIO",OCIO.version outputfilename = "config.ocio" @@ -16,36 +14,36 @@ # Set roles -config.setRole(OCIO.Constants.ROLE_SCENE_LINEAR, "lnf") -config.setRole(OCIO.Constants.ROLE_REFERENCE, "lnf") -config.setRole(OCIO.Constants.ROLE_COLOR_TIMING, "lg10") -config.setRole(OCIO.Constants.ROLE_COMPOSITING_LOG, "lgf") -config.setRole(OCIO.Constants.ROLE_COLOR_PICKING,"cpf") -config.setRole(OCIO.Constants.ROLE_DATA,"ncf") -config.setRole(OCIO.Constants.ROLE_DEFAULT,"ncf") -config.setRole(OCIO.Constants.ROLE_MATTE_PAINT,"vd8") -config.setRole(OCIO.Constants.ROLE_TEXTURE_PAINT,"dt16") +config.setRole(OCIO.ROLE_SCENE_LINEAR, "lnf") +config.setRole(OCIO.ROLE_REFERENCE, "lnf") +config.setRole(OCIO.ROLE_COLOR_TIMING, "lg10") +config.setRole(OCIO.ROLE_COMPOSITING_LOG, "lgf") +config.setRole(OCIO.ROLE_COLOR_PICKING,"cpf") +config.setRole(OCIO.ROLE_DATA,"ncf") +config.setRole(OCIO.ROLE_DEFAULT,"ncf") +config.setRole(OCIO.ROLE_MATTE_PAINT,"vd8") +config.setRole(OCIO.ROLE_TEXTURE_PAINT,"dt16") ## Scene Linear ############################################################### cs = OCIO.ColorSpace(family='ln',name='lnf') cs.setDescription("lnf : linear show space") -cs.setBitDepth(OCIO.Constants.BIT_DEPTH_F32) +cs.setBitDepth(OCIO.BIT_DEPTH_F32) cs.setAllocationVars([-15.0,6.0]) -cs.setAllocation(OCIO.Constants.ALLOCATION_LG2) +cs.setAllocation(OCIO.ALLOCATION_LG2) config.addColorSpace(cs) cs = OCIO.ColorSpace(family='ln',name='lnh') cs.setDescription("lnh : linear show space") -cs.setBitDepth(OCIO.Constants.BIT_DEPTH_F16) +cs.setBitDepth(OCIO.BIT_DEPTH_F16) cs.setAllocationVars([-15.0,6.0]) -cs.setAllocation(OCIO.Constants.ALLOCATION_LG2) +cs.setAllocation(OCIO.ALLOCATION_LG2) config.addColorSpace(cs) cs = OCIO.ColorSpace(family='ln',name='ln16') cs.setDescription("ln16 : linear show space") -cs.setBitDepth(OCIO.Constants.BIT_DEPTH_UINT16) +cs.setBitDepth(OCIO.BIT_DEPTH_UINT16) cs.setAllocationVars([-15.0,0.0]) -cs.setAllocation(OCIO.Constants.ALLOCATION_LG2) +cs.setAllocation(OCIO.ALLOCATION_LG2) config.addColorSpace(cs) @@ -53,24 +51,24 @@ cs = OCIO.ColorSpace(family='lg',name='lg16') cs.setDescription("lg16 : conversion from film log ") -cs.setBitDepth(OCIO.Constants.BIT_DEPTH_UINT16) -t = OCIO.FileTransform('lg16.spi1d',interpolation=OCIO.Constants.INTERP_NEAREST ) -cs.setTransform(t, OCIO.Constants.COLORSPACE_DIR_TO_REFERENCE) +cs.setBitDepth(OCIO.BIT_DEPTH_UINT16) +t = OCIO.FileTransform('lg16.spi1d',interpolation=OCIO.INTERP_NEAREST ) +cs.setTransform(t, OCIO.COLORSPACE_DIR_TO_REFERENCE) config.addColorSpace(cs) cs = OCIO.ColorSpace(family='lg',name='lg10') cs.setDescription("lg10 : conversion from film log") -cs.setBitDepth(OCIO.Constants.BIT_DEPTH_UINT10) -t = OCIO.FileTransform('lg10.spi1d',interpolation=OCIO.Constants.INTERP_NEAREST ) -cs.setTransform(t, OCIO.Constants.COLORSPACE_DIR_TO_REFERENCE) +cs.setBitDepth(OCIO.BIT_DEPTH_UINT10) +t = OCIO.FileTransform('lg10.spi1d',interpolation=OCIO.INTERP_NEAREST ) +cs.setTransform(t, OCIO.COLORSPACE_DIR_TO_REFERENCE) config.addColorSpace(cs) cs = OCIO.ColorSpace(family='lg',name='lgf') cs.setDescription("lgf : conversion from film log") -cs.setBitDepth(OCIO.Constants.BIT_DEPTH_F32) +cs.setBitDepth(OCIO.BIT_DEPTH_F32) cs.setAllocationVars([-0.25,1.5]) -t = OCIO.FileTransform('lgf.spi1d',interpolation=OCIO.Constants.INTERP_LINEAR) -cs.setTransform(t, OCIO.Constants.COLORSPACE_DIR_TO_REFERENCE) +t = OCIO.FileTransform('lgf.spi1d',interpolation=OCIO.INTERP_LINEAR) +cs.setTransform(t, OCIO.COLORSPACE_DIR_TO_REFERENCE) config.addColorSpace(cs) @@ -79,9 +77,9 @@ cs = OCIO.ColorSpace(family='gn',name='gn10') cs.setDescription("gn10 :conversion from Panalog") -cs.setBitDepth(OCIO.Constants.BIT_DEPTH_UINT10) -t = OCIO.FileTransform('gn10.spi1d',interpolation=OCIO.Constants.INTERP_NEAREST) -cs.setTransform(t, OCIO.Constants.COLORSPACE_DIR_TO_REFERENCE) +cs.setBitDepth(OCIO.BIT_DEPTH_UINT10) +t = OCIO.FileTransform('gn10.spi1d',interpolation=OCIO.INTERP_NEAREST) +cs.setTransform(t, OCIO.COLORSPACE_DIR_TO_REFERENCE) config.addColorSpace(cs) @@ -89,39 +87,39 @@ cs = OCIO.ColorSpace(family='vd',name='vd16') cs.setDescription("vd16 :conversion from a gamma 2.2 ") -cs.setBitDepth(OCIO.Constants.BIT_DEPTH_UINT16) +cs.setBitDepth(OCIO.BIT_DEPTH_UINT16) groupTransform = OCIO.GroupTransform() -groupTransform.push_back(OCIO.FileTransform('version_8_whitebalanced.spimtx',direction=OCIO.Constants.TRANSFORM_DIR_INVERSE)) -groupTransform.push_back(OCIO.FileTransform('vd16.spi1d',interpolation=OCIO.Constants.INTERP_NEAREST )) -cs.setTransform(groupTransform, OCIO.Constants.COLORSPACE_DIR_TO_REFERENCE) +groupTransform.prependTransform(OCIO.FileTransform('version_8_whitebalanced.spimtx',direction=OCIO.TRANSFORM_DIR_INVERSE)) +groupTransform.prependTransform(OCIO.FileTransform('vd16.spi1d',interpolation=OCIO.INTERP_NEAREST )) +cs.setTransform(groupTransform, OCIO.COLORSPACE_DIR_TO_REFERENCE) config.addColorSpace(cs) cs = OCIO.ColorSpace(family='vd',name='vd10') cs.setDescription("vd10 :conversion from a gamma 2.2 ") -cs.setBitDepth(OCIO.Constants.BIT_DEPTH_UINT10) +cs.setBitDepth(OCIO.BIT_DEPTH_UINT10) groupTransform = OCIO.GroupTransform() -groupTransform.push_back(OCIO.FileTransform('version_8_whitebalanced.spimtx',direction=OCIO.Constants.TRANSFORM_DIR_INVERSE)) -groupTransform.push_back(OCIO.FileTransform('vd10.spi1d',interpolation=OCIO.Constants.INTERP_NEAREST )) -cs.setTransform(groupTransform, OCIO.Constants.COLORSPACE_DIR_TO_REFERENCE) +groupTransform.prependTransform(OCIO.FileTransform('version_8_whitebalanced.spimtx',direction=OCIO.TRANSFORM_DIR_INVERSE)) +groupTransform.prependTransform(OCIO.FileTransform('vd10.spi1d',interpolation=OCIO.INTERP_NEAREST )) +cs.setTransform(groupTransform, OCIO.COLORSPACE_DIR_TO_REFERENCE) config.addColorSpace(cs) cs = OCIO.ColorSpace(family='vd',name='vd8') cs.setDescription("vd8 :conversion from a gamma 2.2") -cs.setBitDepth(OCIO.Constants.BIT_DEPTH_UINT8) +cs.setBitDepth(OCIO.BIT_DEPTH_UINT8) groupTransform = OCIO.GroupTransform() -groupTransform.push_back(OCIO.FileTransform('version_8_whitebalanced.spimtx',direction=OCIO.Constants.TRANSFORM_DIR_INVERSE)) -groupTransform.push_back(OCIO.FileTransform('vd8.spi1d',interpolation=OCIO.Constants.INTERP_NEAREST )) -cs.setTransform(groupTransform, OCIO.Constants.COLORSPACE_DIR_TO_REFERENCE) +groupTransform.prependTransform(OCIO.FileTransform('version_8_whitebalanced.spimtx',direction=OCIO.TRANSFORM_DIR_INVERSE)) +groupTransform.prependTransform(OCIO.FileTransform('vd8.spi1d',interpolation=OCIO.INTERP_NEAREST )) +cs.setTransform(groupTransform, OCIO.COLORSPACE_DIR_TO_REFERENCE) config.addColorSpace(cs) # REC709 CONVERSIONS############################################################################# cs = OCIO.ColorSpace(family='hd',name='hd10') cs.setDescription("hd10 : conversion from REC709") -cs.setBitDepth(OCIO.Constants.BIT_DEPTH_UINT10) +cs.setBitDepth(OCIO.BIT_DEPTH_UINT10) groupTransform = OCIO.GroupTransform() -groupTransform.push_back(OCIO.FileTransform('hdOffset.spimtx',interpolation=OCIO.Constants.INTERP_NEAREST ,direction=OCIO.Constants.TRANSFORM_DIR_INVERSE)) -groupTransform.push_back(OCIO.ColorSpaceTransform(src='vd16',dst='lnf')) -cs.setTransform(groupTransform, OCIO.Constants.COLORSPACE_DIR_TO_REFERENCE) +groupTransform.prependTransform(OCIO.FileTransform('hdOffset.spimtx',interpolation=OCIO.INTERP_NEAREST ,direction=OCIO.TRANSFORM_DIR_INVERSE)) +groupTransform.prependTransform(OCIO.ColorSpaceTransform(src='vd16',dst='lnf')) +cs.setTransform(groupTransform, OCIO.COLORSPACE_DIR_TO_REFERENCE) config.addColorSpace(cs) @@ -129,20 +127,20 @@ """ cs = OCIO.ColorSpace(family='dt',name='dt8') cs.setDescription("dt8 :conversion for diffuse texture") -cs.setBitDepth(OCIO.Constants.BIT_DEPTH_UINT8) +cs.setBitDepth(OCIO.BIT_DEPTH_UINT8) groupTransform = OCIO.GroupTransform() -groupTransform.push_back(OCIO.FileTransform('diffuseTextureMultiplier.spimtx',interpolation=OCIO.Constants.INTERP_NEAREST ,direction=OCIO.Constants.TRANSFORM_DIR_FORWARD)) -groupTransform.push_back(OCIO.ColorSpaceTransform(dst='lnf',src='vd16')) -cs.setTransform(groupTransform, OCIO.Constants.COLORSPACE_DIR_TO_REFERENCE) +groupTransform.prependTransform(OCIO.FileTransform('diffuseTextureMultiplier.spimtx',interpolation=OCIO.INTERP_NEAREST ,direction=OCIO.TRANSFORM_DIR_FORWARD)) +groupTransform.prependTransform(OCIO.ColorSpaceTransform(dst='lnf',src='vd16')) +cs.setTransform(groupTransform, OCIO.COLORSPACE_DIR_TO_REFERENCE) config.addColorSpace(cs) """ cs = OCIO.ColorSpace(family='dt',name='dt16') cs.setDescription("dt16 :conversion for diffuse texture") -cs.setBitDepth(OCIO.Constants.BIT_DEPTH_UINT16) +cs.setBitDepth(OCIO.BIT_DEPTH_UINT16) groupTransform = OCIO.GroupTransform() -groupTransform.push_back(OCIO.FileTransform('diffuseTextureMultiplier.spimtx',interpolation=OCIO.Constants.INTERP_NEAREST ,direction=OCIO.Constants.TRANSFORM_DIR_FORWARD)) -groupTransform.push_back(OCIO.ColorSpaceTransform(dst='lnf',src='vd16')) -cs.setTransform(groupTransform, OCIO.Constants.COLORSPACE_DIR_TO_REFERENCE) +groupTransform.prependTransform(OCIO.FileTransform('diffuseTextureMultiplier.spimtx',interpolation=OCIO.INTERP_NEAREST ,direction=OCIO.TRANSFORM_DIR_FORWARD)) +groupTransform.prependTransform(OCIO.ColorSpaceTransform(dst='lnf',src='vd16')) +cs.setTransform(groupTransform, OCIO.COLORSPACE_DIR_TO_REFERENCE) config.addColorSpace(cs) @@ -150,9 +148,9 @@ cs = OCIO.ColorSpace(family='cp',name='cpf') cs.setDescription("cpf :video like conversion used for color picking ") -cs.setBitDepth(OCIO.Constants.BIT_DEPTH_F32) -t=OCIO.FileTransform(src='cpf.spi1d',interpolation=OCIO.Constants.INTERP_LINEAR ) -cs.setTransform(t, OCIO.Constants.COLORSPACE_DIR_TO_REFERENCE) +cs.setBitDepth(OCIO.BIT_DEPTH_F32) +t=OCIO.FileTransform(src='cpf.spi1d',interpolation=OCIO.INTERP_LINEAR ) +cs.setTransform(t, OCIO.COLORSPACE_DIR_TO_REFERENCE) config.addColorSpace(cs) @@ -162,25 +160,25 @@ cs = OCIO.ColorSpace(family='nc',name='nc8') cs.setDescription("nc8 :nc,Non-color used to store non-color data such as depth or surface normals") -cs.setBitDepth(OCIO.Constants.BIT_DEPTH_UINT8) +cs.setBitDepth(OCIO.BIT_DEPTH_UINT8) cs.setIsData(True) config.addColorSpace(cs) cs = OCIO.ColorSpace(family='nc',name='nc10') cs.setDescription("nc10 :nc,Non-color used to store non-color data such as depth or surface normals") -cs.setBitDepth(OCIO.Constants.BIT_DEPTH_UINT10) +cs.setBitDepth(OCIO.BIT_DEPTH_UINT10) cs.setIsData(True) config.addColorSpace(cs) cs = OCIO.ColorSpace(family='nc',name='nc16') cs.setDescription("nc16 :nc,Non-color used to store non-color data such as depth or surface normals") -cs.setBitDepth(OCIO.Constants.BIT_DEPTH_UINT16) +cs.setBitDepth(OCIO.BIT_DEPTH_UINT16) cs.setIsData(True) config.addColorSpace(cs) cs = OCIO.ColorSpace(family='nc',name='ncf') cs.setDescription("ncf :nc,Non-color used to store non-color data such as depth or surface normals") -cs.setBitDepth(OCIO.Constants.BIT_DEPTH_F32) +cs.setBitDepth(OCIO.BIT_DEPTH_F32) cs.setIsData(True) config.addColorSpace(cs) @@ -188,53 +186,53 @@ cs = OCIO.ColorSpace(family='srgb',name='srgb8') cs.setDescription("srgb8 :rgb display space for the srgb standard.") -cs.setBitDepth(OCIO.Constants.BIT_DEPTH_UINT8) +cs.setBitDepth(OCIO.BIT_DEPTH_UINT8) groupTransform = OCIO.GroupTransform() -groupTransform.push_back(OCIO.ColorSpaceTransform(src='lnf', dst='lg10')) -groupTransform.push_back(OCIO.FileTransform('spi_ocio_srgb_test.spi3d',interpolation=OCIO.Constants.INTERP_LINEAR)) -cs.setTransform(groupTransform, OCIO.Constants.COLORSPACE_DIR_FROM_REFERENCE) +groupTransform.prependTransform(OCIO.ColorSpaceTransform(src='lnf', dst='lg10')) +groupTransform.prependTransform(OCIO.FileTransform('spi_ocio_srgb_test.spi3d',interpolation=OCIO.INTERP_LINEAR)) +cs.setTransform(groupTransform, OCIO.COLORSPACE_DIR_FROM_REFERENCE) config.addColorSpace(cs) cs = OCIO.ColorSpace(family='p3dci',name='p3dci8') cs.setDescription("p3dci8 :rgb display space for gamma 2.6 P3 projection.") -cs.setBitDepth(OCIO.Constants.BIT_DEPTH_UINT8) +cs.setBitDepth(OCIO.BIT_DEPTH_UINT8) groupTransform = OCIO.GroupTransform() -groupTransform.push_back(OCIO.ColorSpaceTransform(src='lnf', dst='lg10')) -groupTransform.push_back( OCIO.FileTransform('colorworks_filmlg_to_p3.3dl',interpolation=OCIO.Constants.INTERP_LINEAR)) -cs.setTransform(groupTransform, OCIO.Constants.COLORSPACE_DIR_FROM_REFERENCE) +groupTransform.prependTransform(OCIO.ColorSpaceTransform(src='lnf', dst='lg10')) +groupTransform.prependTransform( OCIO.FileTransform('colorworks_filmlg_to_p3.3dl',interpolation=OCIO.INTERP_LINEAR)) +cs.setTransform(groupTransform, OCIO.COLORSPACE_DIR_FROM_REFERENCE) config.addColorSpace(cs) cs = OCIO.ColorSpace(family='xyz',name='xyz16') cs.setDescription("xyz16 :Conversion for DCP creation.") -cs.setBitDepth(OCIO.Constants.BIT_DEPTH_UINT16) +cs.setBitDepth(OCIO.BIT_DEPTH_UINT16) groupTransform = OCIO.GroupTransform() -groupTransform.push_back(OCIO.ColorSpaceTransform(src='lnf', dst='p3dci8')) -groupTransform.push_back(OCIO.ExponentTransform([2.6,2.6,2.6,1.0])) -groupTransform.push_back(OCIO.FileTransform('p3_to_xyz16_corrected_wp.spimtx')) -groupTransform.push_back(OCIO.ExponentTransform([2.6,2.6,2.6,1.0],direction=OCIO.Constants.TRANSFORM_DIR_INVERSE)) -cs.setTransform(groupTransform, OCIO.Constants.COLORSPACE_DIR_FROM_REFERENCE) +groupTransform.prependTransform(OCIO.ColorSpaceTransform(src='lnf', dst='p3dci8')) +groupTransform.prependTransform(OCIO.ExponentTransform([2.6,2.6,2.6,1.0])) +groupTransform.prependTransform(OCIO.FileTransform('p3_to_xyz16_corrected_wp.spimtx')) +groupTransform.prependTransform(OCIO.ExponentTransform([2.6,2.6,2.6,1.0],direction=OCIO.TRANSFORM_DIR_INVERSE)) +cs.setTransform(groupTransform, OCIO.COLORSPACE_DIR_FROM_REFERENCE) config.addColorSpace(cs) ## DISPLAY SPACES ################################################################## for name,colorspace in [ ['Film','srgb8'], ['Log','lg10'], ['Raw','nc10']]: - config.addDisplay('sRGB',name,colorspace) + config.addDisplayView('sRGB',name,colorspace) for name,colorspace in [ ['Film','p3dci8'], ['Log','lg10'], ['Raw','nc10']]: - config.addDisplay('DCIP3',name,colorspace) + config.addDisplayView('DCIP3',name,colorspace) config.setActiveViews(','.join(['Film','Log','Raw'])) config.setActiveDisplays(','.join(['sRGB','DCIP3'])) try: - config.sanityCheck() -except Exception,e: - print e - print "Configuration was not written due to a failed Sanity Check" + config.validate() +except e: + print(e) + print ("Configuration was not written due to a failed Sanity Check") sys.exit() -else: - f = file(outputfilename,"w") +else: + f = open(outputfilename,"w") f.write(config.serialize()) f.close() - print "Wrote",outputfilename + print ("Wrote %s"%outputfilename)