From 4e29ff2f1c08e3a720b74184d4f595e403401799 Mon Sep 17 00:00:00 2001 From: Joseph Slomka Date: Fri, 29 Jul 2011 12:04:09 -0700 Subject: [PATCH] updated and simplified the configurations also, renamed configs --- spi-anim/makeconfig_anim.py | 221 ++++++++++++++++++++++++++++ spi-anim/{config.ocio => spi-anim.ocio} | 177 ++++++++++------------ spi-vfx/make_vfx_ocio.py | 242 +++++++++++++++++++++++++++++++ spi-vfx/{config.ocio => spi-vfx.ocio} | 165 ++++++++------------- 4 files changed, 594 insertions(+), 211 deletions(-) create mode 100644 spi-anim/makeconfig_anim.py rename spi-anim/{config.ocio => spi-anim.ocio} (56%) create mode 100644 spi-vfx/make_vfx_ocio.py rename spi-vfx/{config.ocio => spi-vfx.ocio} (61%) diff --git a/spi-anim/makeconfig_anim.py b/spi-anim/makeconfig_anim.py new file mode 100644 index 0000000..c703737 --- /dev/null +++ b/spi-anim/makeconfig_anim.py @@ -0,0 +1,221 @@ +#!/usr/bin/env python + +import SpImport, math, os, sys +OCIO = SpImport.SpComp2("PyOpenColorIO",1) + + + + +outputfilename = "spi-anim.ocio" + +config = OCIO.Config() + +LUT_SEARCH_PATH = ['luts'] +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") + +## 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.setAllocationVars([-13.0,4.0]) +cs.setAllocation(OCIO.Constants.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.setAllocationVars([-13.0,4.0]) +cs.setAllocation(OCIO.Constants.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) +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) +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.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) +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) +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) +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) +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) +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) +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) +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) +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) +config.addColorSpace(cs) + + +## TEXTURE PUBLISHING ######################################################################## + +cs = OCIO.ColorSpace(family='dt',name='dt16') +cs.setDescription("dt16 :diffuse texture conversion") +cs.setBitDepth(OCIO.Constants.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) +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) +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) +config.addColorSpace(cs) + + +## COLOR PICKER ######################################################################## + +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) +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.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.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.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.setIsData(True) +config.addColorSpace(cs) + +## DISPLAY SPACES ################################################################## + +# +# This is not as clean as would be desired +# THere is a conversion made from srgb to P3 +# then there is a tone range correction that limits the dynamic range of the DLP to +# be appropaite for material created on the DreamColor display. +# +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) +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) +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) +groupTransform = OCIO.GroupTransform() +groupTransform.push_back(OCIO.ColorSpaceTransform(src='lnf',dst='vd16')) +groupTransform.push_back(OCIO.FileTransform('hdOffset.spimtx' ,direction= OCIO.Constants.TRANSFORM_DIR_FORWARD,interpolation=OCIO.Constants.INTERP_LINEAR)) +groupTransform.push_back(OCIO.FileTransform('hd10_to_xyz16.spi3d' ,direction=OCIO.Constants.TRANSFORM_DIR_FORWARD,interpolation=OCIO.Constants.INTERP_LINEAR)) +cs.setTransform(groupTransform, OCIO.Constants.COLORSPACE_DIR_FROM_REFERENCE) +config.addColorSpace(cs) +""" +## DISPLAY SPACES ################################################################## + +for name,colorspace in [ ['Film','vd16'], ['Log','lm10'],['Raw','nc10']]: + config.addDisplay('sRGB',name,colorspace) + +for name,colorspace in [ ['Film','p3dci8'], ['Log','lm10'], ['Raw','nc10']]: + config.addDisplay('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" + sys.exit() +else: + f = file(outputfilename,"w") + f.write(config.serialize()) + f.close() + print "Wrote",outputfilename + + + diff --git a/spi-anim/config.ocio b/spi-anim/spi-anim.ocio similarity index 56% rename from spi-anim/config.ocio rename to spi-anim/spi-anim.ocio index 2394809..ea86125 100644 --- a/spi-anim/config.ocio +++ b/spi-anim/spi-anim.ocio @@ -1,4 +1,3 @@ ---- ocio_profile_version: 1 search_path: luts @@ -7,23 +6,25 @@ luma: [0.2126, 0.7152, 0.0722] roles: color_picking: cpf - color_timing: lmf + color_timing: lm10 compositing_log: lmf data: ncf default: ncf + matte_paint: mp16 reference: lnf scene_linear: lnf - spi_spm: lm8 + texture_paint: dt16 displays: DCIP3: - - ! {name: Raw, colorspace: nc10} - - ! {name: Log, colorspace: lm10} - ! {name: Film, colorspace: p3dci8} - sRGB: + - ! {name: Log, colorspace: lm10} - ! {name: Raw, colorspace: nc10} + sRGB: + - ! {name: Film, colorspace: vd16} - ! {name: Log, colorspace: lm10} - - ! {name: Film, colorspace: vd8} + - ! {name: Raw, colorspace: nc10} + active_displays: [sRGB, DCIP3] active_views: [Film, Log, Raw] @@ -32,6 +33,8 @@ colorspaces: name: lnf family: ln bitdepth: 32f + description: | + lnf :linear show space isdata: false allocation: lg2 allocationvars: [-13, 4] @@ -40,210 +43,178 @@ colorspaces: name: lnh family: ln bitdepth: 16f + description: | + lnh :linear show space isdata: false allocation: lg2 allocationvars: [-13, 4] - ! name: lm16 - family: lg + family: lm bitdepth: 16ui + description: | + lm16 : Log Monitor this space has a log like response and srgb primaries, it is used for color grading isdata: false allocation: uniform - allocationvars: [0, 1] - to_reference: ! {src: lm16.spi1d, interpolation: nearest} + to_reference: ! {src: lm16.spi1d, interpolation: linear} - ! name: lm10 - family: lg + family: lm bitdepth: 10ui + description: | + lm10 : Log Monitor this space has a log like response and srgb primaries, it is used for color grading isdata: false allocation: uniform - allocationvars: [0, 1] - to_reference: ! {src: lm10.spi1d, interpolation: nearest} - - - ! - name: lm8 - family: lg - bitdepth: 8ui - isdata: false - allocation: uniform - allocationvars: [0, 1] - to_reference: ! {src: lm8.spi1d, interpolation: nearest} + to_reference: ! {src: lm10.spi1d, interpolation: linear} - ! name: lmf - family: lg + family: lm bitdepth: 32f + 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.25, 1.5] + allocationvars: [-0.2, 2.484] to_reference: ! {src: lmf.spi1d, interpolation: linear} - ! name: vd16 family: vd bitdepth: 16ui + description: | + vd16 : The simple video conversion from a gamma 2.2 srgb space isdata: false allocation: uniform - allocationvars: [0, 1] - to_reference: ! {src: vd16.spi1d, interpolation: nearest} + to_reference: ! + children: + - ! {src: vd16.spi1d, interpolation: nearest} - ! name: vd10 family: vd bitdepth: 10ui + description: | + vd10 : The simple video conversion from a gamma 2.2 srgb space isdata: false allocation: uniform - allocationvars: [0, 1] - to_reference: ! {src: vd10.spi1d, interpolation: nearest} + to_reference: ! + children: + - ! {src: vd10.spi1d, interpolation: nearest} - ! name: vd8 family: vd bitdepth: 8ui + description: | + vd8 : The simple video conversion from a gamma 2.2 srgb space isdata: false allocation: uniform - allocationvars: [0, 1] - to_reference: ! {src: vd8.spi1d, interpolation: nearest} - - - ! - name: vdf - family: vd - bitdepth: 32f - isdata: false - allocation: uniform - allocationvars: [0, 1] - to_reference: ! {src: vd16.spi1d, interpolation: linear} + to_reference: ! + children: + - ! {src: vd8.spi1d, interpolation: nearest} - ! - name: dt8 - family: dt - bitdepth: 8ui + name: hd10 + family: hd + bitdepth: 10ui + description: | + hd10 : The simple conversion for REC709 isdata: false allocation: uniform - allocationvars: [0, 1] to_reference: ! children: - - ! {src: dt.spimtx, interpolation: unknown} - - ! {src: vdf, dst: lnf} + - ! {src: hdOffset.spimtx, interpolation: nearest, direction: inverse} + - ! {src: vd16, dst: lnf} - ! name: dt16 family: dt bitdepth: 16ui + description: | + dt16 :diffuse texture conversion isdata: false allocation: uniform - allocationvars: [0, 1] to_reference: ! children: - - ! {src: dt.spimtx, interpolation: unknown} - - ! {src: vdf, dst: lnf} - - - ! - name: mp8 - family: mp - bitdepth: 8ui - isdata: false - allocation: uniform - allocationvars: [0, 1] - to_reference: ! - children: - - ! {src: mp.spimtx, interpolation: unknown} - - ! {src: vdf, dst: lnf} + - ! {src: dt.spimtx, interpolation: nearest} + - ! {src: vd16, dst: lnf} - ! name: mp16 family: mp bitdepth: 16ui + description: | + mp16 : conversion for matte painting isdata: false allocation: uniform - allocationvars: [0, 1] - to_reference: ! - children: - - ! {src: mp.spimtx, interpolation: unknown} - - ! {src: vdf, dst: lnf} - - - ! - name: hd10 - family: hd - bitdepth: 10ui - isdata: false - allocation: uniform - allocationvars: [0, 1] to_reference: ! children: - - ! {src: hdOffset.spimtx, interpolation: nearest, direction: inverse} - - ! {src: vdf, dst: lnf} + - ! {src: mp.spimtx, interpolation: nearest} + - ! {src: vd16, dst: lnf} - ! name: cpf family: cp bitdepth: 32f + description: | + cpf :video like conversion used for color picking isdata: false allocation: uniform - allocationvars: [0, 1] - to_reference: ! {src: cpf.spi1d, interpolation: linear} + to_reference: ! {src: cpf.spi1d, interpolation: nearest} - ! name: nc8 family: nc bitdepth: 8ui + description: | + nc8 :nc,Non-color used to store non-color data such as depth or surface normals isdata: true allocation: uniform - allocationvars: [0, 1] - ! name: nc10 family: nc bitdepth: 10ui + description: | + nc10 :nc,Non-color used to store non-color data such as depth or surface normals isdata: true allocation: uniform - allocationvars: [0, 1] - ! name: nc16 family: nc bitdepth: 16ui - isdata: false + description: | + nc16 :nc,Non-color used to store non-color data such as depth or surface normals + isdata: true allocation: uniform - allocationvars: [0, 1] - ! name: ncf family: nc bitdepth: 32f + description: | + ncf :nc,Non-color used to store non-color data such as depth or surface normals isdata: true allocation: uniform - allocationvars: [0, 1] - - - ! - name: xyz16 - family: xyz - bitdepth: 16ui - isdata: false - allocation: uniform - allocationvars: [0, 1] - from_reference: ! - children: - - ! {src: lnf, dst: p3dci8} - - ! {value: [2.6, 2.6, 2.6, 1]} - - ! {src: p3_to_xyz16.spimtx, interpolation: unknown} - - ! {value: [2.6, 2.6, 2.6, 1], direction: inverse} - ! name: p3dci8 family: p3dci - bitdepth: 16ui + bitdepth: 8ui + description: | + p3dci8 : 8 Bit int rgb display space for gamma 2.6 P3 projection. isdata: false allocation: uniform - allocationvars: [0, 1] from_reference: ! children: - - ! {src: lnf, dst: vdf} + - ! {src: lnf, dst: vd16} - ! {value: [2.2, 2.2, 2.2, 1]} - - ! {src: srgb_to_p3d65.spimtx, interpolation: unknown} - - ! {src: p3d65_to_pdci.spimtx, interpolation: unknown} - - ! {src: htr_dlp_tweak.spimtx, interpolation: unknown} + - ! {src: srgb_to_p3d65.spimtx, interpolation: linear} + - ! {src: p3d65_to_pdci.spimtx, interpolation: linear} + - ! {src: htr_dlp_tweak.spimtx, interpolation: linear} - ! {value: [2.6, 2.6, 2.6, 1], direction: inverse} - - ! {src: correction.spi1d, interpolation: linear} + - ! {src: correction.spi1d, cccid: forward, interpolation: linear} diff --git a/spi-vfx/make_vfx_ocio.py b/spi-vfx/make_vfx_ocio.py new file mode 100644 index 0000000..dbe8a55 --- /dev/null +++ b/spi-vfx/make_vfx_ocio.py @@ -0,0 +1,242 @@ +#!/usr/bin/env python + + +import math, os, sys +import SpImport +OCIO = SpImport.SpComp2("PyOpenColorIO",1) + +print "OCIO",OCIO.version + +outputfilename = "spi-vfx.ocio" + +config = OCIO.Config() + +LUT_SEARCH_PATH = ['luts'] +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, "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") +## Scene Linear ############################################################### + +cs = OCIO.ColorSpace(family='ln',name='lnf') +cs.setDescription("lnf : linear show space") +cs.setBitDepth(OCIO.Constants.BIT_DEPTH_F32) +cs.setAllocationVars([-15.0,6.0]) +cs.setAllocation(OCIO.Constants.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.setAllocationVars([-15.0,6.0]) +cs.setAllocation(OCIO.Constants.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.setAllocationVars([-15.0,0.0]) +cs.setAllocation(OCIO.Constants.ALLOCATION_LG2) +config.addColorSpace(cs) + + +## Log ######################################################################## + +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) +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) +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.setAllocationVars([-0.25,1.5]) +t = OCIO.FileTransform('lgf.spi1d',interpolation=OCIO.Constants.INTERP_LINEAR) +cs.setTransform(t, OCIO.Constants.COLORSPACE_DIR_TO_REFERENCE) +config.addColorSpace(cs) + + + +## PANALOG ######################################################################## + +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) +config.addColorSpace(cs) + + +## VD ######################################################################## + +cs = OCIO.ColorSpace(family='vd',name='vd16') +cs.setDescription("vd16 :conversion from a gamma 2.2 ") +cs.setBitDepth(OCIO.Constants.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) +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) +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) +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) +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) +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) +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) +config.addColorSpace(cs) + + +## TEXTURE PUBLISHING ######################################################################## +""" +cs = OCIO.ColorSpace(family='dt',name='dt8') +cs.setDescription("dt8 :conversion for diffuse texture") +cs.setBitDepth(OCIO.Constants.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) +config.addColorSpace(cs) +""" +cs = OCIO.ColorSpace(family='dt',name='dt16') +cs.setDescription("dt16 :conversion for diffuse texture") +cs.setBitDepth(OCIO.Constants.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) +config.addColorSpace(cs) + + +## COLOR PICKER ######################################################################## + +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) +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.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.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.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.setIsData(True) +config.addColorSpace(cs) + +## DISPLAY SPACES ################################################################## + +cs = OCIO.ColorSpace(family='srgb',name='srgb8') +cs.setDescription("srgb8 :rgb display space for the srgb standard.") +cs.setBitDepth(OCIO.Constants.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) +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) +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) +config.addColorSpace(cs) +""" +cs = OCIO.ColorSpace(family='xyz',name='xyz16') +cs.setDescription("xyz16 :Conversion for DCP creation.") +cs.setBitDepth(OCIO.Constants.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.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) +config.addColorSpace(cs) +""" + + +## DISPLAY SPACES ################################################################## + +for name,colorspace in [ ['Film','srgb8'], ['Log','lg10'], ['Raw','nc10']]: + config.addDisplay('sRGB',name,colorspace) + +for name,colorspace in [ ['Film','p3dci8'], ['Log','lg10'], ['Raw','nc10']]: + config.addDisplay('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" + sys.exit() +else: + f = file(outputfilename,"w") + f.write(config.serialize()) + f.close() + print "Wrote",outputfilename diff --git a/spi-vfx/config.ocio b/spi-vfx/spi-vfx.ocio similarity index 61% rename from spi-vfx/config.ocio rename to spi-vfx/spi-vfx.ocio index fb5f21b..25e488e 100644 --- a/spi-vfx/config.ocio +++ b/spi-vfx/spi-vfx.ocio @@ -1,4 +1,3 @@ ---- ocio_profile_version: 1 search_path: luts @@ -11,19 +10,21 @@ roles: compositing_log: lgf data: ncf default: ncf + matte_paint: vd8 reference: lnf scene_linear: lnf - spi_spm: lg8 + texture_paint: dt16 displays: DCIP3: - - ! {name: Raw, colorspace: nc10} - - ! {name: Log, colorspace: lg10} - ! {name: Film, colorspace: p3dci8} - sRGB: - - ! {name: Raw, colorspace: nc10} - ! {name: Log, colorspace: lg10} + - ! {name: Raw, colorspace: nc10} + sRGB: - ! {name: Film, colorspace: srgb8} + - ! {name: Log, colorspace: lg10} + - ! {name: Raw, colorspace: nc10} + active_displays: [sRGB, DCIP3] active_views: [Film, Log, Raw] @@ -32,14 +33,18 @@ colorspaces: name: lnf family: ln bitdepth: 32f + description: | + lnf : linear show space isdata: false allocation: lg2 - allocationvars: [-15, 6, 0.01] + allocationvars: [-15, 6] - ! name: lnh family: ln bitdepth: 16f + description: | + lnh : linear show space isdata: false allocation: lg2 allocationvars: [-15, 6] @@ -48,6 +53,8 @@ colorspaces: name: ln16 family: ln bitdepth: 16ui + description: | + ln16 : linear show space isdata: false allocation: lg2 allocationvars: [-15, 0] @@ -56,93 +63,51 @@ colorspaces: name: lg16 family: lg bitdepth: 16ui + description: | + lg16 : conversion from film log isdata: false allocation: uniform - allocationvars: [0, 1] to_reference: ! {src: lg16.spi1d, interpolation: nearest} - ! name: lg10 family: lg bitdepth: 10ui + description: | + lg10 : conversion from film log isdata: false allocation: uniform - allocationvars: [0, 1] - to_reference: ! {src: lg10.spi1d, interpolation: nearest} - - - ! - name: lg8 - family: lg - bitdepth: 8ui - isdata: false - allocation: uniform - allocationvars: [0, 1] to_reference: ! {src: lg10.spi1d, interpolation: nearest} - ! name: lgf family: lg bitdepth: 32f + description: | + lgf : conversion from film log isdata: false allocation: uniform allocationvars: [-0.25, 1.5] to_reference: ! {src: lgf.spi1d, interpolation: linear} - ! - name: gn16 - family: gn - bitdepth: 16ui - isdata: false - allocation: uniform - allocationvars: [0, 1] - to_reference: ! {src: gn16.spi1d, interpolation: nearest} - - - ! name: gn10 family: gn bitdepth: 10ui + description: | + gn10 : The 10bit int conversion from Panalog to linear isdata: false allocation: uniform - allocationvars: [0, 1] - to_reference: ! {src: gn16.spi1d, interpolation: nearest} - - - ! - name: gn8 - family: gn - bitdepth: 8ui - isdata: false - allocation: uniform - allocationvars: [0, 1] - to_reference: ! {src: gn16.spi1d, interpolation: nearest} - - - ! - name: gnf - family: gn - bitdepth: 32f - isdata: false - allocation: uniform - allocationvars: [-0.25, 1.5] - to_reference: ! {src: gnf.spi1d, interpolation: linear} + to_reference: ! {src: gn10.spi1d, interpolation: nearest} - ! name: vd16 family: vd bitdepth: 16ui + description: | + vd16 :conversion from a gamma 2.2 isdata: false allocation: uniform - allocationvars: [0, 1] - to_reference: ! - children: - - ! {src: version_8_whitebalanced.spimtx, interpolation: unknown, direction: inverse} - - ! {src: vd16.spi1d, interpolation: nearest} - - - ! - name: vd8 - family: vd - bitdepth: 8ui - isdata: false - allocation: uniform - allocationvars: [0, 1] to_reference: ! children: - ! {src: version_8_whitebalanced.spimtx, interpolation: unknown, direction: inverse} @@ -152,111 +117,108 @@ colorspaces: name: vd10 family: vd bitdepth: 10ui + description: | + vd10 :conversion from a gamma 2.2 isdata: false allocation: uniform - allocationvars: [0, 1] to_reference: ! children: - ! {src: version_8_whitebalanced.spimtx, interpolation: unknown, direction: inverse} - - ! {src: vd16.spi1d, interpolation: nearest} + - ! {src: vd10.spi1d, interpolation: nearest} - ! - name: vdf + name: vd8 family: vd - bitdepth: 32f + bitdepth: 8ui + description: | + vd8 :conversion from a gamma 2.2 isdata: false allocation: uniform - allocationvars: [0, 1] to_reference: ! children: - - ! {src: vd16, dst: lnf} + - ! {src: version_8_whitebalanced.spimtx, interpolation: unknown, direction: inverse} + - ! {src: vd8.spi1d, interpolation: nearest} - ! name: hd10 family: hd bitdepth: 10ui + description: | + hd10 : The simple 10bit int conversion from REC709 to linear isdata: false allocation: uniform - allocationvars: [0, 1] to_reference: ! children: - ! {src: hdOffset.spimtx, interpolation: nearest, direction: inverse} - - ! {src: vdf, dst: lnf} - - - ! - name: dt8 - family: dt - bitdepth: 8ui - isdata: false - allocation: uniform - allocationvars: [0, 1] - to_reference: ! - children: - - ! {src: diffuseTextureMultiplier.spimtx, interpolation: nearest} - - ! {src: vdf, dst: lnf} + - ! {src: vd16, dst: lnf} - ! name: dt16 family: dt bitdepth: 16ui + description: | + dt16 :conversion for diffuse texture isdata: false allocation: uniform - allocationvars: [0, 1] to_reference: ! children: - ! {src: diffuseTextureMultiplier.spimtx, interpolation: nearest} - - ! {src: vdf, dst: lnf} + - ! {src: vd16, dst: lnf} - ! name: cpf family: cp bitdepth: 32f + description: | + cpf :video like conversion used for color picking isdata: false allocation: uniform - allocationvars: [0, 1] - to_reference: ! - children: - - ! {src: cpf.spi1d, interpolation: linear} + to_reference: ! {src: cpf.spi1d, interpolation: linear} - ! name: nc8 family: nc bitdepth: 8ui + description: | + nc8 :nc,Non-color used to store non-color data such as depth or surface normals isdata: true allocation: uniform - allocationvars: [0, 1] - ! name: nc10 family: nc bitdepth: 10ui + description: | + nc10 :nc,Non-color used to store non-color data such as depth or surface normals isdata: true allocation: uniform - allocationvars: [0, 1] - ! name: nc16 family: nc bitdepth: 16ui - isdata: false + description: | + nc16 :nc,Non-color used to store non-color data such as depth or surface normals + isdata: true allocation: uniform - allocationvars: [0, 1] - ! name: ncf family: nc bitdepth: 32f + description: | + ncf :nc,Non-color used to store non-color data such as depth or surface normals isdata: true allocation: uniform - allocationvars: [0, 1] - ! name: srgb8 family: srgb bitdepth: 8ui + description: | + srgb8 :rgb display space for the srgb standard. isdata: false allocation: uniform - allocationvars: [0, 1] from_reference: ! children: - ! {src: lnf, dst: lg10} @@ -265,25 +227,12 @@ colorspaces: - ! name: p3dci8 family: p3dci - bitdepth: 16ui + bitdepth: 8ui + description: | + p3dci8 :rgb display space for gamma 2.6 P3 projection. isdata: false allocation: uniform - allocationvars: [0, 1] from_reference: ! children: - ! {src: lnf, dst: lg10} - ! {src: colorworks_filmlg_to_p3.3dl, interpolation: linear} - - - ! - name: xyz16 - family: xyz - bitdepth: 16ui - isdata: false - allocation: uniform - allocationvars: [0, 1] - from_reference: ! - children: - - ! {src: lnf, dst: p3dci8} - - ! {value: [2.6, 2.6, 2.6, 1]} - - ! {src: p3_to_xyz16.spimtx, interpolation: unknown} - - ! {value: [2.6, 2.6, 2.6, 1], direction: inverse} -- 1.7.10.4