X-Git-Url: http://users.mur.at/ms/git/gitweb/?a=blobdiff_plain;f=aces_1.0.0%2Fpython%2Faces_ocio%2Fgenerate_config.py;h=13022c076365ff12a5785cd074cc89640d4c519f;hb=0cc52e33a3822b22e7cc30bf44e80e83c6de678f;hp=94c681171b7d92e386dab3850b9c4865b687713a;hpb=465abef462555baa505ed88b9e6e3f22b4a9c090;p=OpenColorIO-Configs.git diff --git a/aces_1.0.0/python/aces_ocio/generate_config.py b/aces_1.0.0/python/aces_ocio/generate_config.py index 94c6811..13022c0 100755 --- a/aces_1.0.0/python/aces_ocio/generate_config.py +++ b/aces_1.0.0/python/aces_ocio/generate_config.py @@ -611,7 +611,8 @@ def create_config(config_data, print('Adding regular colorspaces') - for colorspace in sorted(config_data['colorSpaces']): + for colorspace in sorted(config_data['colorSpaces'], + cmp=lambda x,y: cmp(x.family.lower(), y.family.lower())): # Adding the colorspace *Family* into the name which helps with # applications that presenting colorspaces as one a flat list. if prefix: @@ -684,18 +685,16 @@ def create_config(config_data, matte_paint=prefixed_names[config_data['roles']['matte_paint']], reference=prefixed_names[config_data['roles']['reference']], scene_linear=prefixed_names[config_data['roles']['scene_linear']], + compositing_linear=prefixed_names[config_data['roles']['scene_linear']], + rendering=prefixed_names[config_data['roles']['scene_linear']], texture_paint=prefixed_names[ config_data['roles']['texture_paint']]) - # TODO: Pending code path reactivation. - # Not allowed at the moment as role names can not overlap - # with colorspace names. - """ # Add the aliased colorspaces for each role for role_name, role_colorspace_name in config_data['roles'].iteritems(): role_colorspace_prefixed_name = prefixed_names[role_colorspace_name] - print( 'Finding colorspace : %s' % role_colorspace_prefixed_name ) + #print( 'Finding colorspace : %s' % role_colorspace_prefixed_name ) # Find the colorspace pointed to by the role role_colorspaces = [colorspace for colorspace in config_data['colorSpaces'] @@ -708,12 +707,18 @@ def create_config(config_data, role_colorspace = reference_data if role_colorspace: - print( 'Adding an alias colorspace named %s, pointing to %s' % ( - role_name, role_colorspace.name)) + # The alias colorspace shouldn't match the role name exactly + role_name_alias1 = "role_%s" % role_name + role_name_alias2 = "Role - %s" % role_name + + print( 'Adding a role colorspace named %s, pointing to %s' % ( + role_name_alias2, role_colorspace.name)) + + alias_colorspaces.append( + (reference_data, role_colorspace, [role_name_alias1])) add_colorspace_aliases( - config, reference_data, role_colorspace, [role_name], 'Roles') - """ + config, reference_data, role_colorspace, [role_name_alias2], 'Roles') else: set_config_roles( @@ -726,12 +731,10 @@ def create_config(config_data, matte_paint=config_data['roles']['matte_paint'], reference=config_data['roles']['reference'], scene_linear=config_data['roles']['scene_linear'], + compositing_linear=config_data['roles']['scene_linear'], + rendering=config_data['roles']['scene_linear'], texture_paint=config_data['roles']['texture_paint']) - # TODO: Pending code path reactivation. - # Not allowed at the moment as role names can not overlap - # with colorspace names. - """ # Add the aliased colorspaces for each role for role_name, role_colorspace_name in config_data['roles'].iteritems(): # Find the colorspace pointed to by the role @@ -746,12 +749,18 @@ def create_config(config_data, role_colorspace = reference_data if role_colorspace: - print('Adding an alias colorspace named %s, pointing to %s' % ( - role_name, role_colorspace.name)) + # The alias colorspace shouldn't match the role name exactly + role_name_alias1 = "role_%s" % role_name + role_name_alias2 = "Role - %s" % role_name + + print('Adding a role colorspace named %s, pointing to %s' % ( + role_name_alias2, role_colorspace.name)) + + alias_colorspaces.append( + (reference_data, role_colorspace, [role_name_alias1])) add_colorspace_aliases( - config, reference_data, role_colorspace, [role_name], 'Roles') - """ + config, reference_data, role_colorspace, [role_name_alias2], 'Roles') print('') @@ -775,10 +784,6 @@ def create_config(config_data, default_display_views = config_data['displays'][default_display_name] default_display_colorspace = default_display_views['Output Transform'] - set_config_roles( - config, - color_picking=default_display_colorspace.name) - # Defining *Displays* and *Views*. displays, views = [], [] @@ -1128,6 +1133,15 @@ def generate_baked_LUTs(odt_info, odt_prefix = odt_values['transformUserNamePrefix'] odt_name = odt_values['transformUserName'] + if odt_name in ['P3-D60 PQ (1000 nits)']: + odt_shaper = shaper_name.replace("48 nits", "1000 nits") + elif odt_name in ['P3-D60 PQ (2000 nits)']: + odt_shaper = shaper_name.replace("48 nits", "2000 nits") + elif odt_name in ['P3-D60 PQ (4000 nits)']: + odt_shaper = shaper_name.replace("48 nits", "4000 nits") + else: + odt_shaper = shaper_name + # *Photoshop* for input_space in ['ACEScc', 'ACESproxy']: args = ['--iconfig', config_path, @@ -1144,10 +1158,10 @@ def generate_baked_LUTs(odt_info, odt_name, input_space)] if prefix: - args += ['--shaperspace', 'Utility - %s' % shaper_name, + args += ['--shaperspace', 'Utility - %s' % odt_shaper, '--shapersize', str(lut_resolution_shaper)] else: - args += ['--shaperspace', shaper_name, + args += ['--shaperspace', odt_shaper, '--shapersize', str(lut_resolution_shaper)] args += ['--cubesize', str(lut_resolution_3d)] args += ['--format', @@ -1175,10 +1189,10 @@ def generate_baked_LUTs(odt_info, '%s - %s for %s data' % ( odt_prefix, odt_name, input_space)] if prefix: - args += ['--shaperspace', 'Utility - %s' % shaper_name, + args += ['--shaperspace', 'Utility - %s' % odt_shaper, '--shapersize', str(lut_resolution_shaper)] else: - args += ['--shaperspace', shaper_name, + args += ['--shaperspace', odt_shaper, '--shapersize', str(lut_resolution_shaper)] args += ['--cubesize', str(lut_resolution_3d)] @@ -1218,9 +1232,9 @@ def generate_baked_LUTs(odt_info, '%s - %s for %s data' % ( odt_prefix, odt_name, input_space)] if input_space == 'ACEScg': - lin_shaper_name = '%s - AP1' % shaper_name + lin_shaper_name = '%s - AP1' % odt_shaper else: - lin_shaper_name = shaper_name + lin_shaper_name = odt_shaper if prefix: lin_shaper_name = 'Utility - %s' % lin_shaper_name args += ['--shaperspace', lin_shaper_name, @@ -1297,7 +1311,8 @@ def generate_config(aces_ctl_directory, look_info=None, copy_custom_luts=True, cleanup=True, - prefix_colorspaces_with_family_names=True): + prefix_colorspaces_with_family_names=True, + shaper_base_name='Log2'): """ Creates the ACES configuration. @@ -1326,7 +1341,11 @@ def generate_config(aces_ctl_directory, odt_info = aces.get_ODTs_info(aces_ctl_directory) lmt_info = aces.get_LMTs_info(aces_ctl_directory) - shaper_name = 'Output Shaper' + if shaper_base_name == 'DolbyPQ': + shaper_name = 'Dolby PQ 48 nits Shaper' + else: + shaper_name = 'Log2 48 nits Shaper' + config_data = create_config_data(odt_info, lmt_info, shaper_name, @@ -1431,7 +1450,13 @@ def main(): 'ACEScc colorspace, but the user could choose other spaces ' 'by changing the argument after the name of the look. \n') usage += '\n' - + usage += ('Create a GUI-friendly ACES 1.0 config using the Dolby PQ ' + 'transfer function as the shaper: \n') + usage += ('\tcreate_aces_config -a /path/to/aces-dev/transforms/ctl ' + '--lutResolution1d 1024 --lutResolution3d 33 -c aces_1.0.0 ' + '--shaper DolbyPQ') + usage += '\n' + look_info = [] def look_info_callback(option, opt_str, value, parser): @@ -1472,6 +1497,8 @@ def main(): action='callback', callback=look_info_callback) p.add_option('--copyCustomLUTs', action='store_true', default=False) + p.add_option('--shaper', '-s', default='Log2') + options, arguments = p.parse_args() aces_ctl_directory = options.acesCTLDir @@ -1482,6 +1509,8 @@ def main(): cleanup_temp_images = not options.keepTempImages multiple_displays = options.createMultipleDisplays copy_custom_luts = options.copyCustomLUTs + shaper_base_name = options.shaper + prefix = True print(look_info) @@ -1505,7 +1534,9 @@ def main(): multiple_displays, look_info, copy_custom_luts, - cleanup_temp_images) + cleanup_temp_images, + prefix, + shaper_base_name) if __name__ == '__main__':