Skip to content

Instantly share code, notes, and snippets.

@AndrewHazelden
Last active December 9, 2015 11:40
Show Gist options
  • Save AndrewHazelden/fc2c60694aa21a1f044e to your computer and use it in GitHub Desktop.
Save AndrewHazelden/fc2c60694aa21a1f044e to your computer and use it in GitHub Desktop.
Use Maxwell Render's PyMaxwell tool to read the active color space
# Get the Color Space
# Example: scene = Cmaxwell(mwcallback); colorSpace = mxa_getColorSpace(scene)
def mxa_getColorSpace(scene):
colorSpace = ''
colorSpaceValue = scene.getColorSpace()
if colorSpaceValue == COLOR_SPACE_SRGB:
colorSpace = 'sRGB IEC61966-2.1'
elif colorSpaceValue == COLOR_SPACE_ADOBE98:
colorSpace = 'Adobe RGB'
elif colorSpaceValue == COLOR_SPACE_APPLE:
colorSpace = 'Apple RGB'
elif colorSpaceValue == COLOR_SPACE_PAL:
colorSpace = 'PAL'
elif colorSpaceValue == COLOR_SPACE_NTSC:
colorSpace = 'NTSC 1953'
elif colorSpaceValue == COLOR_SPACE_NTSC1979:
colorSpace = 'NSTC 1979'
elif colorSpaceValue == COLOR_SPACE_WIDEGAMUT:
colorSpace = 'Wide Gamut RGB'
elif colorSpaceValue == COLOR_SPACE_PROPHOTO:
colorSpace = 'Pro Photo RGB'
elif colorSpaceValue == COLOR_SPACE_ECIRRGB:
colorSpace = 'ECI RGB'
elif colorSpaceValue == COLOR_SPACE_CIE1931:
colorSpace = 'CIE 1931'
elif colorSpaceValue == COLOR_SPACE_BRUCERGB:
colorSpace = 'Bruce RGB'
elif colorSpaceValue == COLOR_SPACE_COLORMATCH:
colorSpace = 'ColorMatch RGB'
elif colorSpaceValue == COLOR_SPACE_BESTRGB:
colorSpace = 'Best RGB'
elif colorSpaceValue == COLOR_SPACE_DONRGB4:
colorSpace = 'Don RGB 4'
elif colorSpaceValue == COLOR_SPACE_REC709:
colorSpace = 'REC.709'
elif colorSpaceValue == COLOR_SPACE_ACES:
colorSpace = 'ACES'
elif colorSpaceValue == COLOR_SPACE_UNKNOWN:
colorSpace = 'unknown'
else:
colorSpace = 'unknown'
# print('[Color Space] ' + str(colorSpace))
return colorSpace
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment