Package nuke :: Module colorspaces
[hide private]
[frames] | no frames]

Module colorspaces

source code

A collection of tools and functions to help manage LUTs and color configuration

Classes [hide private]
  ColorspaceLookupError
an excpetion that should be thrown when looking up the colorspace
Functions [hide private]
 
_attemptColorspaceNameMatch(colorspaceName)
Look through all options in the colorpsace knob, and see if we have an exact match to one of the items.
source code
 
_lookUpDataTypeDefaultSettings(colorspaceName, dataTypeHint)
Nuke's default handling of colorspace lookups.
source code
 
_nukeDefaultColorSpaceMapper(colorspaceName, dataTypeHint)
Allows colorspaces selections to be altered before use on Readers and Writers
source code
 
addDefaultColorspaceMapper(call, args=(), kwargs={}, nodeClass='*')
Add a function to modify default colorspaces before Nuke passes them to Readers or Writers.
source code
 
removeDefaultColorspaceMapper(call, args=(), kwargs={}, nodeClass='*')
Remove a previously-added callback with the same arguments.
source code
 
_doColorSpaceCallbacks(colorspace, dataTypeHint, callbacks, errorMsg)
Perform the colorspace callbacks expects a string or 'None' to be returned.
source code
 
defaultColorspaceMapper(colorspace, dataTypeHint)
Called by libnuke.
source code
 
getColorspaceList(colorspaceKnob)
Get a list of all colorspaces listed in an enumeration knob.
source code
Variables [hide private]
  defaultLUTMappers = {}
  __package__ = 'nuke'
Function Details [hide private]

_lookUpDataTypeDefaultSettings(colorspaceName, dataTypeHint)

source code 

Nuke's default handling of colorspace lookups.

Maps applicable dataTypeHint values to knobs on the Preferecne panel

Possible values for dataTypeHint are
  Nuke inbuilt data-type hints (map to knobs)
    nuke.MONITOR == 0
    nuke.VIEWER  == 1
    nuke.INT8    == 2
    nuke.INT16   == 3
    nuke.LOG     == 4
    nuke.FLOAT   == 5
  Other numeric values which map to those in DDImage/LUT.h
    6  == DD::Image::LUT::GAMMA1_8
    7  == DD::Image::LUT::GAMMA2_2
    8  == DD::Image::LUT::GAMMA2_4
    9  == DD::Image::LUT::PANALOG
    10 == DD::Image::LUT::REDLOG
    11 == DD::Image::LUT::VIPERLOG
    12 == DD::Image::LUT::ALEXAV3LOGC
    13 == DD::Image::LUT::PLOGLIN
    14 == DD::Image::LUT::SLOG
    15 == DD::Image::LUT::SLOG1
    16 == DD::Image::LUT::SLOG2
    17 == DD::Image::LUT::SLOG3
    18 == DD::Image::LUT::CLOG
    19 == DD::Image::LUT::PROTUNE

addDefaultColorspaceMapper(call, args=(), kwargs={}, nodeClass='*')

source code 

Add a function to modify default colorspaces before Nuke passes them to Readers or Writers.

Functions should have the same positional argument as in the definition of defaultLUTMapper()

All added functions are called in backwards order.

defaultColorspaceMapper(colorspace, dataTypeHint)

source code 

Called by libnuke.
Calls into Node-level callbacks first, then global callbacks

Arguments:
    colorspace   - the name string of the initial colorspace
    dataTypeHint - sometimes Readers/Writer request the default for a
                   particular data-type, i.e. int8, in16, float, etc.
Return:
    The return should be the transformed/modified colorspace name.
    None is the same as returning the string unchanged.

getColorspaceList(colorspaceKnob)

source code 

Get a list of all colorspaces listed in an enumeration knob. This will strip family names if the knob has the STRIP_CASCADE_PREFIX flag set.