interpolation_options = {
'linear': OCIO.Constants.INTERP_LINEAR,
interpolation_options = {
'linear': OCIO.Constants.INTERP_LINEAR,
ocio_transform = generate_OCIO_transform(
colorspace.to_reference_transforms)
ocio_colorspace.setTransform(
ocio_transform = generate_OCIO_transform(
colorspace.to_reference_transforms)
ocio_colorspace.setTransform(
ocio_transform = generate_OCIO_transform(
colorspace.from_reference_transforms)
ocio_colorspace.setTransform(
ocio_transform = generate_OCIO_transform(
colorspace.from_reference_transforms)
ocio_colorspace.setTransform(
# The primaries switch is covered by the matrix below
'%s/ACEScg/ACEScsc.ACES_to_ACEScg.a1.0.0.ctl' % aces_CTL_directory
]
# The primaries switch is covered by the matrix below
'%s/ACEScg/ACEScsc.ACES_to_ACEScg.a1.0.0.ctl' % aces_CTL_directory
]
# Remove spaces and parentheses
lut = lut.replace(' ', '_').replace(')', '_').replace('(', '_')
generate_1d_LUT_from_CTL(
# Remove spaces and parentheses
lut = lut.replace(' ', '_').replace(')', '_').replace('(', '_')
generate_1d_LUT_from_CTL(
# The primaries switch is covered by the matrix below
'%s/ACEScg/ACEScsc.ACES_to_ACEScg.a1.0.0.ctl' % aces_CTL_directory
]
# The primaries switch is covered by the matrix below
'%s/ACEScg/ACEScsc.ACES_to_ACEScg.a1.0.0.ctl' % aces_CTL_directory
]
# Remove spaces and parentheses
lut = lut.replace(' ', '_').replace(')', '_').replace('(', '_')
generate_1d_LUT_from_CTL(
# Remove spaces and parentheses
lut = lut.replace(' ', '_').replace(')', '_').replace('(', '_')
generate_1d_LUT_from_CTL(
def fit(value, from_min, from_max, to_min, to_max):
if from_min == from_max:
def fit(value, from_min, from_max, to_min, to_max):
if from_min == from_max:
- write_SPI_1d(lut_directory + "/" + lut, RANGE[0], RANGE[1],
+ write_SPI_1d(lut_directory + '/' + lut, RANGE[0], RANGE[1],
# Remove spaces and parentheses
lut = lut.replace(' ', '_').replace(')', '_').replace('(', '_')
generate_1d_LUT_from_CTL(
# Remove spaces and parentheses
lut = lut.replace(' ', '_').replace(')', '_').replace('(', '_')
generate_1d_LUT_from_CTL(
- shaper_lut = "%s_to_aces.spi1d" % shaper_name
- if (not os.path.exists(lut_directory + "/" + shaper_lut)):
+ shaper_lut = '%s_to_aces.spi1d' % shaper_name
+ if (not os.path.exists(lut_directory + '/' + shaper_lut)):
' ', '_').replace(')', '_').replace('(', '_')
generate_1d_LUT_from_CTL(
' ', '_').replace(')', '_').replace('(', '_')
generate_1d_LUT_from_CTL(
shaper_to_ACES_CTL % aces_CTL_directory,
'%s/%s' % (aces_CTL_directory, lmt_values['transformCTL'])
]
shaper_to_ACES_CTL % aces_CTL_directory,
'%s/%s' % (aces_CTL_directory, lmt_values['transformCTL'])
]
# Remove spaces and parentheses
lut = lut.replace(' ', '_').replace(')', '_').replace('(', '_')
generate_3d_LUT_from_CTL(
# Remove spaces and parentheses
lut = lut.replace(' ', '_').replace(')', '_').replace('(', '_')
generate_3d_LUT_from_CTL(
aces_CTL_directory, odt_values['transformCTLInverse']),
shaper_from_ACES_CTL % aces_CTL_directory
]
aces_CTL_directory, odt_values['transformCTLInverse']),
shaper_from_ACES_CTL % aces_CTL_directory
]
# Remove spaces and parentheses
lut = lut.replace(' ', '_').replace(')', '_').replace('(', '_')
generate_3d_LUT_from_CTL(
# Remove spaces and parentheses
lut = lut.replace(' ', '_').replace(')', '_').replace('(', '_')
generate_3d_LUT_from_CTL(
- shaper_lut = "%s_to_aces.spi1d" % shaper_name
- if (not os.path.exists(lut_directory + "/" + shaper_lut)):
+ shaper_lut = '%s_to_aces.spi1d' % shaper_name
+ if (not os.path.exists(lut_directory + '/' + shaper_lut)):
' ', '_').replace(')', '_').replace('(', '_')
generate_1d_LUT_from_CTL(
' ', '_').replace(')', '_').replace('(', '_')
generate_1d_LUT_from_CTL(
shutil.copy(odt_values['transformLUT'], lut)
cs.from_reference_transforms.append(shaper_OCIO_transform)
shutil.copy(odt_values['transformLUT'], lut)
cs.from_reference_transforms.append(shaper_OCIO_transform)
'%s/rrt/RRT.a1.0.0.ctl' % aces_CTL_directory,
'%s/odt/%s' % (aces_CTL_directory, odt_values['transformCTL'])
]
'%s/rrt/RRT.a1.0.0.ctl' % aces_CTL_directory,
'%s/odt/%s' % (aces_CTL_directory, odt_values['transformCTL'])
]
# Remove spaces and parentheses
lut = lut.replace(' ', '_').replace(')', '_').replace('(', '_')
# Remove spaces and parentheses
lut = lut.replace(' ', '_').replace(')', '_').replace('(', '_')
shutil.copy(odt_values['transformLUTInverse'], lut)
cs.to_reference_transforms.append({
shutil.copy(odt_values['transformLUTInverse'], lut)
cs.to_reference_transforms.append({
'%s/rrt/InvRRT.a1.0.0.ctl' % aces_CTL_directory,
shaper_from_ACES_CTL % aces_CTL_directory
]
'%s/rrt/InvRRT.a1.0.0.ctl' % aces_CTL_directory,
shaper_from_ACES_CTL % aces_CTL_directory
]
# Remove spaces and parentheses
lut = lut.replace(' ', '_').replace(')', '_').replace('(', '_')
generate_3d_LUT_from_CTL(
# Remove spaces and parentheses
lut = lut.replace(' ', '_').replace(')', '_').replace('(', '_')
generate_3d_LUT_from_CTL(
middle_grey=log2_params['middleGrey'],
min_exposure=log2_params['minExposure'],
max_exposure=log2_params['maxExposure'])
middle_grey=log2_params['middleGrey'],
min_exposure=log2_params['minExposure'],
max_exposure=log2_params['maxExposure'])
if odt_name in ['Academy.Rec2020_100nits_dim.a1.0.0',
'Academy.Rec709_100nits_dim.a1.0.0',
'Academy.Rec709_D60sim_100nits_dim.a1.0.0']:
if odt_name in ['Academy.Rec2020_100nits_dim.a1.0.0',
'Academy.Rec709_100nits_dim.a1.0.0',
'Academy.Rec709_D60sim_100nits_dim.a1.0.0']:
from_reference_values=[ACES_AP0_to_XYZ, XYZ_to_Rec2020])
config_data['colorSpaces'].append(cs)
from_reference_values=[ACES_AP0_to_XYZ, XYZ_to_Rec2020])
config_data['colorSpaces'].append(cs)
if odt_CTL_name in ['Academy.Rec2020_100nits_dim.a1.0.0',
'Academy.Rec709_100nits_dim.a1.0.0',
'Academy.Rec709_D60sim_100nits_dim.a1.0.0']:
if odt_CTL_name in ['Academy.Rec2020_100nits_dim.a1.0.0',
'Academy.Rec709_100nits_dim.a1.0.0',
'Academy.Rec709_D60sim_100nits_dim.a1.0.0']:
- odt_values_legal["transformUserName"] = "%s - Legal" % odt_name
- odt_info_C["%s - Legal" % odt_CTL_name] = odt_values_legal
+ odt_values_legal['transformUserName'] = '%s - Legal' % odt_name
+ odt_info_C['%s - Legal' % odt_CTL_name] = odt_values_legal
- odt_values_full["transformUserName"] = "%s - Full" % odt_name
- odt_info_C["%s - Full" % odt_CTL_name] = odt_values_full
+ odt_values_full['transformUserName'] = '%s - Full' % odt_name
+ odt_info_C['%s - Full' % odt_CTL_name] = odt_values_full
del (odt_info_C[odt_CTL_name])
for odt_CTL_name, odt_values in odt_info_C.iteritems():
del (odt_info_C[odt_CTL_name])
for odt_CTL_name, odt_values in odt_info_C.iteritems():
- for input_space in ["ACEScc", "ACESproxy"]:
- args = ["--iconfig", config_path,
- "-v",
- "--inputspace", input_space]
- args += ["--outputspace", "%s" % odt_name]
- args += ["--description",
- "%s - %s for %s data" % (odt_prefix,
+ for input_space in ['ACEScc', 'ACESproxy']:
+ args = ['--iconfig', config_path,
+ '-v',
+ '--inputspace', input_space]
+ args += ['--outputspace', '%s' % odt_name]
+ args += ['--description',
+ '%s - %s for %s data' % (odt_prefix,
- args += ["--shaperspace", shaper_name,
- "--shapersize", str(lut_resolution_shaper)]
- args += ["--cubesize", str(lut_resolution_3d)]
- args += ["--format",
- "icc",
- "%s/photoshop/%s for %s.icc" % (baked_directory,
+ args += ['--shaperspace', shaper_name,
+ '--shapersize', str(lut_resolution_shaper)]
+ args += ['--cubesize', str(lut_resolution_3d)]
+ args += ['--format',
+ 'icc',
+ '%s/photoshop/%s for %s.icc' % (baked_directory,
- for input_space in ["ACEScc", "ACESproxy"]:
- args = ["--iconfig", config_path,
- "-v",
- "--inputspace", input_space]
- args += ["--outputspace", "%s" % odt_name]
- args += ["--description",
- "%s - %s for %s data" % (
+ for input_space in ['ACEScc', 'ACESproxy']:
+ args = ['--iconfig', config_path,
+ '-v',
+ '--inputspace', input_space]
+ args += ['--outputspace', '%s' % odt_name]
+ args += ['--description',
+ '%s - %s for %s data' % (
- args += ["--shaperspace", shaper_name,
- "--shapersize", str(lut_resolution_shaper)]
- args += ["--cubesize", str(lut_resolution_3d)]
+ args += ['--shaperspace', shaper_name,
+ '--shapersize', str(lut_resolution_shaper)]
+ args += ['--cubesize', str(lut_resolution_3d)]
- for input_space in ["ACEScg", "ACES2065-1"]:
- args = ["--iconfig", config_path,
- "-v",
- "--inputspace", input_space]
- args += ["--outputspace", "%s" % odt_name]
- args += ["--description",
- "%s - %s for %s data" % (
+ for input_space in ['ACEScg', 'ACES2065-1']:
+ args = ['--iconfig', config_path,
+ '-v',
+ '--inputspace', input_space]
+ args += ['--outputspace', '%s' % odt_name]
+ args += ['--description',
+ '%s - %s for %s data' % (
odt_prefix, odt_name, input_space)]
if input_space == 'ACEScg':
odt_prefix, odt_name, input_space)]
if input_space == 'ACEScg':
- args += ["--shaperspace", lin_shaper_name,
- "--shapersize", str(lut_resolution_shaper)]
+ args += ['--shaperspace', lin_shaper_name,
+ '--shapersize', str(lut_resolution_shaper)]
- hargs = ["--format", "houdini",
- "%s/houdini/%s for %s Houdini.lut" % (
+ hargs = ['--format', 'houdini',
+ '%s/houdini/%s for %s Houdini.lut' % (
- dirs.extend(["%s/baked" % config_directory,
- "%s/baked/flame" % config_directory,
- "%s/baked/photoshop" % config_directory,
- "%s/baked/houdini" % config_directory,
- "%s/baked/lustre" % config_directory,
- "%s/baked/maya" % config_directory])
+ dirs.extend(['%s/baked' % config_directory,
+ '%s/baked/flame' % config_directory,
+ '%s/baked/photoshop' % config_directory,
+ '%s/baked/houdini' % config_directory,
+ '%s/baked/lustre' % config_directory,
+ '%s/baked/maya' % config_directory])
# TODO: Investigate usage of *files_walker* definition here.
# Credit to Alex Fry for the original approach here
# TODO: Investigate usage of *files_walker* definition here.
# Credit to Alex Fry for the original approach here
all_odt = []
for dir_name, subdir_list, file_list in os.walk(odt_dir):
for fname in file_list:
all_odt.append((os.path.join(dir_name, fname)))
odt_CTLs = [x for x in all_odt if
all_odt = []
for dir_name, subdir_list, file_list in os.walk(odt_dir):
for fname in file_list:
all_odt.append((os.path.join(dir_name, fname)))
odt_CTLs = [x for x in all_odt if
transform_CTL = odt_tokens[-1]
# print(transformCTL)
odt_name = string.join(transform_CTL.split('.')[1:-1], '.')
transform_CTL = odt_tokens[-1]
# print(transformCTL)
odt_name = string.join(transform_CTL.split('.')[1:-1], '.')
if not os.path.exists(
os.path.join(odt_tokens[-2], transform_CTL_inverse)):
transform_CTL_inverse = None
if not os.path.exists(
os.path.join(odt_tokens[-2], transform_CTL_inverse)):
transform_CTL_inverse = None
odts[odt_name]['transformUserNamePrefix'] = transform_user_name_prefix
odts[odt_name]['transformUserName'] = transform_user_name
odts[odt_name]['transformUserNamePrefix'] = transform_user_name_prefix
odts[odt_name]['transformUserName'] = transform_user_name
- print("ODT : %s" % odt_name)
- print("\tTransform ID : %s" % transform_ID)
- print("\tTransform User Name Prefix : %s" % transform_user_name_prefix)
- print("\tTransform User Name : %s" % transform_user_name)
- print("\tForward ctl : %s" % (
+ print('ODT : %s' % odt_name)
+ print('\tTransform ID : %s' % transform_ID)
+ print('\tTransform User Name Prefix : %s' % transform_user_name_prefix)
+ print('\tTransform User Name : %s' % transform_user_name)
+ print('\tForward ctl : %s' % (
# TODO: Investigate refactoring with previous definition.
# Credit to Alex Fry for the original approach here
# TODO: Investigate refactoring with previous definition.
# Credit to Alex Fry for the original approach here
all_lmt = []
for dir_name, subdir_list, file_list in os.walk(lmt_dir):
for fname in file_list:
all_lmt.append((os.path.join(dir_name, fname)))
lmt_CTLs = [x for x in all_lmt if
all_lmt = []
for dir_name, subdir_list, file_list in os.walk(lmt_dir):
for fname in file_list:
all_lmt.append((os.path.join(dir_name, fname)))
lmt_CTLs = [x for x in all_lmt if
transform_CTL = lmt_tokens[-1]
# print(transformCTL)
lmt_name = string.join(transform_CTL.split('.')[1:-1], '.')
transform_CTL = lmt_tokens[-1]
# print(transformCTL)
lmt_name = string.join(transform_CTL.split('.')[1:-1], '.')
if not os.path.exists(
os.path.join(lmt_tokens[-2], transform_CTL_inverse)):
transform_CTL_inverse = None
if not os.path.exists(
os.path.join(lmt_tokens[-2], transform_CTL_inverse)):
transform_CTL_inverse = None
lmts[lmt_name]['transformUserNamePrefix'] = transform_user_name_prefix
lmts[lmt_name]['transformUserName'] = transform_user_name
lmts[lmt_name]['transformUserNamePrefix'] = transform_user_name_prefix
lmts[lmt_name]['transformUserName'] = transform_user_name
- print("LMT : %s" % lmt_name)
- print("\tTransform ID : %s" % transform_ID)
- print("\tTransform User Name Prefix : %s" % transform_user_name_prefix)
- print("\tTransform User Name : %s" % transform_user_name)
- print("\t Forward ctl : %s" % lmts[lmt_name]['transformCTL'])
+ print('LMT : %s' % lmt_name)
+ print('\tTransform ID : %s' % transform_ID)
+ print('\tTransform User Name Prefix : %s' % transform_user_name_prefix)
+ print('\tTransform User Name : %s' % transform_user_name)
+ print('\t Forward ctl : %s' % lmts[lmt_name]['transformCTL'])
create_config_dir(config_directory, bake_secondary_LUTs)
# Generate config data and LUTs for different transforms
create_config_dir(config_directory, bake_secondary_LUTs)
# Generate config data and LUTs for different transforms
shaper_name = 'Output Shaper'
config_data = generate_LUTs(odt_info,
lmt_info,
shaper_name = 'Output Shaper'
config_data = generate_LUTs(odt_info,
lmt_info,
# Bake secondary LUTs using the config
if bake_secondary_LUTs:
generate_baked_LUTs(odt_info,
shaper_name,
# Bake secondary LUTs using the config
if bake_secondary_LUTs:
generate_baked_LUTs(odt_info,
shaper_name,
- "%s/baked" % config_directory,
- "%s/config.ocio" % config_directory,
+ '%s/baked' % config_directory,
+ '%s/config.ocio' % config_directory,
'ACES_OCIO_CONFIGURATION_DIRECTORY', None))
p.add_option('--lutResolution1d', default=4096)
p.add_option('--lutResolution3d', default=64)
'ACES_OCIO_CONFIGURATION_DIRECTORY', None))
p.add_option('--lutResolution1d', default=4096)
p.add_option('--lutResolution3d', default=64)
- p.add_option('--dontBakeSecondaryLUTs', action="store_true")
- p.add_option('--keepTempImages', action="store_true")
+ p.add_option('--dontBakeSecondaryLUTs', action='store_true')
+ p.add_option('--keepTempImages', action='store_true')