+ if aliases:
+ if colorspace.aliases:
+ # add_colorspace_alias(config, reference_data,
+ # colorspace, colorspace.aliases)
+ # defer adding alias colorspaces until end.
+ # Helps with some applications.
+ alias_colorspaces.append(
+ [reference_data, colorspace, colorspace.aliases])
+
+ print()
+
+ print()
+
+ #
+ # We add roles early so we can create alias colorspaces with the names
+ # of the roles before the rest of the colorspace aliases are added
+ # to the config.
+ print('Setting the roles')
+
+ if prefix:
+ set_config_default_roles(
+ config,
+ color_picking=prefixed_names[
+ config_data['roles']['color_picking']],
+ color_timing=prefixed_names[config_data['roles']['color_timing']],
+ compositing_log=prefixed_names[
+ config_data['roles']['compositing_log']],
+ data=prefixed_names[config_data['roles']['data']],
+ default=prefixed_names[config_data['roles']['default']],
+ 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']],
+ texture_paint=prefixed_names[
+ config_data['roles']['texture_paint']])
+
+ # Not allowed for the moment. 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 )
+ # Find the colorspace pointed to by the role
+ role_colorspaces = [colorspace
+ for colorspace in config_data['colorSpaces']
+ if colorspace.name == role_colorspace_prefixed_name]
+ role_colorspace = None
+ if len(role_colorspaces) > 0:
+ role_colorspace = role_colorspaces[0]
+ else:
+ if reference_data.name == role_colorspace_prefixed_name:
+ role_colorspace = reference_data
+
+ if role_colorspace:
+ print( 'Adding an alias colorspace named %s, pointing to %s' % (
+ role_name, role_colorspace.name))
+
+ add_colorspace_aliases(
+ config, reference_data, role_colorspace, [role_name], 'Roles')
+ """
+
+ else:
+ set_config_default_roles(
+ config,
+ color_picking=config_data['roles']['color_picking'],
+ color_timing=config_data['roles']['color_timing'],
+ compositing_log=config_data['roles']['compositing_log'],
+ data=config_data['roles']['data'],
+ default=config_data['roles']['default'],
+ matte_paint=config_data['roles']['matte_paint'],
+ reference=config_data['roles']['reference'],
+ scene_linear=config_data['roles']['scene_linear'],
+ texture_paint=config_data['roles']['texture_paint'])
+
+ # Not allowed for the moment. 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
+ role_colorspaces = [colorspace
+ for colorspace in config_data['colorSpaces']
+ if colorspace.name == role_colorspace_name]
+ role_colorspace = None
+ if len(role_colorspaces) > 0:
+ role_colorspace = role_colorspaces[0]
+ else:
+ if reference_data.name == role_colorspace_name:
+ role_colorspace = reference_data
+
+ if role_colorspace:
+ print( 'Adding an alias colorspace named %s, pointing to %s' % (
+ role_name, role_colorspace.name))
+
+ add_colorspace_aliases(
+ config, reference_data, role_colorspace, [role_name], 'Roles')
+ """
+
+ print()
+
+ # We add these at the end as some applications use the order of the
+ # colorspaces definitions in the config to order the colorspaces
+ # in their selection lists.
+ # Other go alphabetically. This should keep the alias colorspaces out
+ # of the way for the apps that use the order of definition in the config.
+ print('Adding the alias colorspaces')
+ for reference, colorspace, aliases in alias_colorspaces:
+ add_colorspace_aliases(config, reference, colorspace, aliases)