From 7ed859e03c3b3dfb0732af17fb81524f9a5a1ea7 Mon Sep 17 00:00:00 2001 From: Haarm-Pieter Duiker Date: Tue, 30 Jun 2015 13:30:57 -0700 Subject: [PATCH] The default display now drives the value of the 'color_picking' role --- aces_1.0.0/python/aces_ocio/aces_config.py | 30 ++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/aces_1.0.0/python/aces_ocio/aces_config.py b/aces_1.0.0/python/aces_ocio/aces_config.py index b7ceed1..3cc5727 100755 --- a/aces_1.0.0/python/aces_ocio/aces_config.py +++ b/aces_1.0.0/python/aces_ocio/aces_config.py @@ -782,11 +782,19 @@ def create_config(config_data, print('Adding the diplays and views') + # Set the color_picking role to be the first Display's Output Transform View + default_display_name = config_data['defaultDisplay'] + default_display_views = config_data['displays'][default_display_name] + default_display_colorspace = default_display_views['Output Transform'] + + set_config_default_roles( + config, + color_picking=default_display_colorspace.name) + # Defining the *views* and *displays*. displays = [] views = [] - # Defining a *generic* *display* and *view* setup. if multiple_displays: # Built list of looks to add to Displays @@ -794,6 +802,9 @@ def create_config(config_data, looks = ", ".join(looks) print( "Creating multiple displays, with looks : %s" % looks) + # Note: We don't reorder the Displays to put the 'defaultDisplay' first + # because OCIO will order them alphabetically when the config is written to disk. + # Create Displays, Views for display, view_list in config_data['displays'].iteritems(): for view_name, colorspace in view_list.iteritems(): @@ -817,11 +828,9 @@ def create_config(config_data, #single_display_name = config_data['roles']['scene_linear'] displays.append(single_display_name) - display_names = sorted(config_data['displays']) - # Make sure the default display is first - default_display = config_data['defaultDisplay'] - display_names.insert(0, display_names.pop(display_names.index(default_display))) + display_names = sorted(config_data['displays']) + display_names.insert(0, display_names.pop(display_names.index(default_display_name))) # Built list of looks to add to Displays looks = config_data['looks'] if ('looks' in config_data) else [] @@ -834,15 +843,15 @@ def create_config(config_data, view_list = config_data['displays'][display] for view_name, colorspace in view_list.iteritems(): if 'Output Transform' in view_name: - #print( "Adding view for %s" % view_name ) - - # Maya 2016 doesn't like parentheses in View names - display_cleaned = replace(display, {')': '', '(': ''}) + #print( "Adding view for %s" % colorspace.name ) # We use the Display names as the View names in this case # as there is a single Display that contains all views. # This works for more applications than not, as of the time of this implementation. + # Maya 2016 doesn't like parentheses in View names + display_cleaned = replace(display, {')': '', '(': ''}) + # If View includes looks if 'with' in view_name: # Integrate looks into view name @@ -871,6 +880,7 @@ def create_config(config_data, views.append(display_cleaned) # Add to config any display, view combinations that were saved for later + # This list will be empty unless viewsWithLooksAtEnd is set to True above for display_view_colorspace in displays_views_colorspaces: single_display_name, display_cleaned, colorspace_name = display_view_colorspace @@ -930,7 +940,7 @@ def create_config(config_data, print( "\n") - print( "Inverse Lookup") + print( "Inverse Lookup of Prefixed names") for prefixed, original in prefixed_names_inverse.iteritems(): print( "%s, %s" % (prefixed, original) ) raise -- 1.7.10.4