Multi-View and Stereo 3D
[blender-staging.git] / source / blender / makesrna / intern / rna_color.c
index 640e91adabfc0e766627d115f3d5548a6536cc03..0c871317d04bb0fecea090a64364dd888042bb0f 100644 (file)
@@ -46,6 +46,8 @@
 #include "DNA_material_types.h"
 #include "DNA_movieclip_types.h"
 #include "DNA_node_types.h"
+#include "DNA_object_types.h"
+#include "DNA_particle_types.h"
 #include "DNA_sequence_types.h"
 
 #include "MEM_guardedalloc.h"
@@ -62,6 +64,7 @@
 #include "ED_node.h"
 
 #include "IMB_colormanagement.h"
+#include "IMB_imbuf.h"
 
 static int rna_CurveMapping_curves_length(PointerRNA *ptr)
 {
@@ -89,7 +92,7 @@ static void rna_CurveMapping_clip_set(PointerRNA *ptr, int value)
        if (value) cumap->flag |= CUMA_DO_CLIP;
        else cumap->flag &= ~CUMA_DO_CLIP;
 
-       curvemapping_changed(cumap, FALSE);
+       curvemapping_changed(cumap, false);
 }
 
 static void rna_CurveMapping_black_level_set(PointerRNA *ptr, const float *values)
@@ -110,7 +113,8 @@ static void rna_CurveMapping_white_level_set(PointerRNA *ptr, const float *value
        curvemapping_set_black_white(cumap, NULL, NULL);
 }
 
-static void rna_CurveMapping_clipminx_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax)
+static void rna_CurveMapping_clipminx_range(PointerRNA *ptr, float *min, float *max,
+                                            float *UNUSED(softmin), float *UNUSED(softmax))
 {
        CurveMapping *cumap = (CurveMapping *)ptr->data;
 
@@ -118,7 +122,8 @@ static void rna_CurveMapping_clipminx_range(PointerRNA *ptr, float *min, float *
        *max = cumap->clipr.xmax;
 }
 
-static void rna_CurveMapping_clipminy_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax)
+static void rna_CurveMapping_clipminy_range(PointerRNA *ptr, float *min, float *max,
+                                            float *UNUSED(softmin), float *UNUSED(softmax))
 {
        CurveMapping *cumap = (CurveMapping *)ptr->data;
 
@@ -126,7 +131,8 @@ static void rna_CurveMapping_clipminy_range(PointerRNA *ptr, float *min, float *
        *max = cumap->clipr.ymax;
 }
 
-static void rna_CurveMapping_clipmaxx_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax)
+static void rna_CurveMapping_clipmaxx_range(PointerRNA *ptr, float *min, float *max,
+                                            float *UNUSED(softmin), float *UNUSED(softmax))
 {
        CurveMapping *cumap = (CurveMapping *)ptr->data;
 
@@ -134,7 +140,8 @@ static void rna_CurveMapping_clipmaxx_range(PointerRNA *ptr, float *min, float *
        *max = 100.0f;
 }
 
-static void rna_CurveMapping_clipmaxy_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax)
+static void rna_CurveMapping_clipmaxy_range(PointerRNA *ptr, float *min, float *max,
+                                            float *UNUSED(softmin), float *UNUSED(softmax))
 {
        CurveMapping *cumap = (CurveMapping *)ptr->data;
 
@@ -171,7 +178,7 @@ static char *rna_ColorRamp_path(PointerRNA *ptr)
                                char *node_path;
                                
                                for (node = ntree->nodes.first; node; node = node->next) {
-                                       if (ELEM3(node->type, SH_NODE_VALTORGB, CMP_NODE_VALTORGB, TEX_NODE_VALTORGB)) {
+                                       if (ELEM(node->type, SH_NODE_VALTORGB, CMP_NODE_VALTORGB, TEX_NODE_VALTORGB)) {
                                                if (node->storage == ptr->data) {
                                                        /* all node color ramp properties called 'color_ramp'
                                                         * prepend path from ID to the node
@@ -188,7 +195,7 @@ static char *rna_ColorRamp_path(PointerRNA *ptr)
                        
                        case ID_LS:
                        {
-                               char *path = BKE_path_from_ID_to_color_ramp((FreestyleLineStyle *)id, (ColorBand *)ptr->data);
+                               char *path = BKE_linestyle_path_to_color_ramp((FreestyleLineStyle *)id, (ColorBand *)ptr->data);
                                if (path)
                                        return path;
                                break;
@@ -224,7 +231,7 @@ static char *rna_ColorRampElement_path(PointerRNA *ptr)
        prop = RNA_struct_find_property(&ramp_ptr, "elements");                   \
        if (prop) {                                                               \
                index = RNA_property_collection_lookup_index(&ramp_ptr, prop, ptr);   \
-               if (index >= 0) {                                                     \
+               if (index != -1) {                                                    \
                        char *texture_path = rna_ColorRamp_path(&ramp_ptr);               \
                        path = BLI_sprintfN("%s.elements[%d]", texture_path, index);      \
                        MEM_freeN(texture_path);                                          \
@@ -252,29 +259,27 @@ static char *rna_ColorRampElement_path(PointerRNA *ptr)
                                        RNA_pointer_create(id, &RNA_ColorRamp, ma->ramp_spec, &ramp_ptr);
                                        COLRAMP_GETPATH;
                                }
+                               break;
                        }
-                       break;
-                               
                        case ID_NT:
                        {
                                bNodeTree *ntree = (bNodeTree *)id;
                                bNode *node;
                                
                                for (node = ntree->nodes.first; node; node = node->next) {
-                                       if (ELEM3(node->type, SH_NODE_VALTORGB, CMP_NODE_VALTORGB, TEX_NODE_VALTORGB)) {
+                                       if (ELEM(node->type, SH_NODE_VALTORGB, CMP_NODE_VALTORGB, TEX_NODE_VALTORGB)) {
                                                RNA_pointer_create(id, &RNA_ColorRamp, node->storage, &ramp_ptr);
                                                COLRAMP_GETPATH;
                                        }
                                }
+                               break;
                        }
-                       break;
-                               
                        case ID_LS:
                        {
                                ListBase listbase;
                                LinkData *link;
 
-                               BKE_list_modifier_color_ramps((FreestyleLineStyle *)id, &listbase);
+                               BKE_linestyle_modifier_list_color_ramps((FreestyleLineStyle *)id, &listbase);
                                for (link = (LinkData *)listbase.first; link; link = link->next) {
                                        RNA_pointer_create(id, &RNA_ColorRamp, link->data, &ramp_ptr);
                                        COLRAMP_GETPATH;
@@ -290,6 +295,7 @@ static char *rna_ColorRampElement_path(PointerRNA *ptr)
                                if (RNA_path_resolve(&ramp_ptr, "color_ramp", &ramp_ptr, &prop)) {
                                        COLRAMP_GETPATH;
                                }
+                               break;
                        }
                }
        }
@@ -312,35 +318,42 @@ static void rna_ColorRamp_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *
                                
                                DAG_id_tag_update(&ma->id, 0);
                                WM_main_add_notifier(NC_MATERIAL | ND_SHADING_DRAW, ma);
+                               break;
                        }
-                       break;
                        case ID_NT:
                        {
                                bNodeTree *ntree = (bNodeTree *)id;
                                bNode *node;
 
                                for (node = ntree->nodes.first; node; node = node->next) {
-                                       if (ELEM3(node->type, SH_NODE_VALTORGB, CMP_NODE_VALTORGB, TEX_NODE_VALTORGB)) {
+                                       if (ELEM(node->type, SH_NODE_VALTORGB, CMP_NODE_VALTORGB, TEX_NODE_VALTORGB)) {
                                                ED_node_tag_update_nodetree(bmain, ntree);
                                        }
                                }
+                               break;
                        }
-                       break;
                        case ID_TE:
                        {
                                Tex *tex = ptr->id.data;
 
                                DAG_id_tag_update(&tex->id, 0);
                                WM_main_add_notifier(NC_TEXTURE, tex);
+                               break;
                        }
-                       break;
                        case ID_LS:
                        {
-                               FreestyleLineStyle *linestyle= ptr->id.data;
+                               FreestyleLineStyle *linestyle = ptr->id.data;
 
                                WM_main_add_notifier(NC_LINESTYLE, linestyle);
                                break;
                        }
+                       case ID_PA:
+                       {
+                               ParticleSettings *part = ptr->id.data;
+                               
+                               DAG_id_tag_update(&part->id, OB_RECALC_DATA | PSYS_RECALC_REDO);
+                               WM_main_add_notifier(NC_OBJECT | ND_PARTICLE | NA_EDITED, part);
+                       }
                        default:
                                break;
                }
@@ -366,7 +379,7 @@ static void rna_ColorRampElement_remove(struct ColorBand *coba, ReportList *repo
 {
        CBData *element = element_ptr->data;
        int index = (int)(element - coba->data);
-       if (colorband_element_remove(coba, index) == FALSE) {
+       if (colorband_element_remove(coba, index) == false) {
                BKE_report(reports, RPT_ERROR, "Element not found in element collection or last element");
                return;
        }
@@ -374,10 +387,10 @@ static void rna_ColorRampElement_remove(struct ColorBand *coba, ReportList *repo
        RNA_POINTER_INVALIDATE(element_ptr);
 }
 
-void rna_CurveMap_remove_point(CurveMap *cuma, ReportList *reports, PointerRNA *point_ptr)
+static void rna_CurveMap_remove_point(CurveMap *cuma, ReportList *reports, PointerRNA *point_ptr)
 {
        CurveMapPoint *point = point_ptr->data;
-       if (curvemap_remove_point(cuma, point) == FALSE) {
+       if (curvemap_remove_point(cuma, point) == false) {
                BKE_report(reports, RPT_ERROR, "Unable to remove curve point");
                return;
        }
@@ -408,8 +421,8 @@ static void rna_ColorManagedDisplaySettings_display_device_set(struct PointerRNA
        }
 }
 
-static EnumPropertyItem *rna_ColorManagedDisplaySettings_display_device_itemf(bContext *UNUSED(C), PointerRNA *ptr,
-                                                                              PropertyRNA *UNUSED(prop), int *free)
+static EnumPropertyItem *rna_ColorManagedDisplaySettings_display_device_itemf(
+        bContext *UNUSED(C), PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), bool *r_free)
 {
        EnumPropertyItem *items = NULL;
        int totitem = 0;
@@ -417,7 +430,7 @@ static EnumPropertyItem *rna_ColorManagedDisplaySettings_display_device_itemf(bC
        IMB_colormanagement_display_items_add(&items, &totitem);
        RNA_enum_item_end(&items, &totitem);
 
-       *free = TRUE;
+       *r_free = true;
 
        return items;
 }
@@ -434,10 +447,16 @@ static void rna_ColorManagedDisplaySettings_display_device_update(Main *UNUSED(b
 
                IMB_colormanagement_validate_settings(&scene->display_settings, &scene->view_settings);
 
+               DAG_id_tag_update(id, 0);
                WM_main_add_notifier(NC_SCENE | ND_SEQUENCER, NULL);
        }
 }
 
+static char *rna_ColorManagedDisplaySettings_path(PointerRNA *UNUSED(ptr))
+{
+       return BLI_sprintfN("display_settings");
+}
+
 static int rna_ColorManagedViewSettings_view_transform_get(PointerRNA *ptr)
 {
        ColorManagedViewSettings *view = (ColorManagedViewSettings *) ptr->data;
@@ -456,8 +475,8 @@ static void rna_ColorManagedViewSettings_view_transform_set(PointerRNA *ptr, int
        }
 }
 
-static EnumPropertyItem *rna_ColorManagedViewSettings_view_transform_itemf(bContext *C, PointerRNA *ptr,
-                                                                           PropertyRNA *UNUSED(prop), int *free)
+static EnumPropertyItem *rna_ColorManagedViewSettings_view_transform_itemf(
+        bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), bool *r_free)
 {
        Scene *scene = CTX_data_scene(C);
        EnumPropertyItem *items = NULL;
@@ -467,7 +486,38 @@ static EnumPropertyItem *rna_ColorManagedViewSettings_view_transform_itemf(bCont
        IMB_colormanagement_view_items_add(&items, &totitem, display_settings->display_device);
        RNA_enum_item_end(&items, &totitem);
 
-       *free = TRUE;
+       *r_free = true;
+       return items;
+}
+
+static int rna_ColorManagedViewSettings_look_get(PointerRNA *ptr)
+{
+       ColorManagedViewSettings *view = (ColorManagedViewSettings *) ptr->data;
+
+       return IMB_colormanagement_look_get_named_index(view->look);
+}
+
+static void rna_ColorManagedViewSettings_look_set(PointerRNA *ptr, int value)
+{
+       ColorManagedViewSettings *view = (ColorManagedViewSettings *) ptr->data;
+
+       const char *name = IMB_colormanagement_look_get_indexed_name(value);
+
+       if (name) {
+               BLI_strncpy(view->look, name, sizeof(view->look));
+       }
+}
+
+static EnumPropertyItem *rna_ColorManagedViewSettings_look_itemf(
+        bContext *UNUSED(C), PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), bool *r_free)
+{
+       EnumPropertyItem *items = NULL;
+       int totitem = 0;
+
+       IMB_colormanagement_look_items_add(&items, &totitem);
+       RNA_enum_item_end(&items, &totitem);
+
+       *r_free = true;
        return items;
 }
 
@@ -487,6 +537,12 @@ static void rna_ColorManagedViewSettings_use_curves_set(PointerRNA *ptr, int val
        }
 }
 
+static char *rna_ColorManagedViewSettings_path(PointerRNA *UNUSED(ptr))
+{
+       return BLI_sprintfN("view_settings");
+}
+
+
 static int rna_ColorManagedColorspaceSettings_colorspace_get(struct PointerRNA *ptr)
 {
        ColorManagedColorspaceSettings *colorspace = (ColorManagedColorspaceSettings *) ptr->data;
@@ -499,13 +555,13 @@ static void rna_ColorManagedColorspaceSettings_colorspace_set(struct PointerRNA
        ColorManagedColorspaceSettings *colorspace = (ColorManagedColorspaceSettings *) ptr->data;
        const char *name = IMB_colormanagement_colorspace_get_indexed_name(value);
 
-       if (name) {
+       if (name && name[0]) {
                BLI_strncpy(colorspace->name, name, sizeof(colorspace->name));
        }
 }
 
-static EnumPropertyItem *rna_ColorManagedColorspaceSettings_colorspace_itemf(bContext *UNUSED(C), PointerRNA *ptr,
-                                                                             PropertyRNA *UNUSED(prop), int *free)
+static EnumPropertyItem *rna_ColorManagedColorspaceSettings_colorspace_itemf(
+        bContext *UNUSED(C), PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), bool *r_free)
 {
        EnumPropertyItem *items = NULL;
        int totitem = 0;
@@ -513,7 +569,7 @@ static EnumPropertyItem *rna_ColorManagedColorspaceSettings_colorspace_itemf(bCo
        IMB_colormanagement_colorspace_items_add(&items, &totitem);
        RNA_enum_item_end(&items, &totitem);
 
-       *free = TRUE;
+       *r_free = true;
 
        return items;
 }
@@ -550,13 +606,13 @@ static void rna_ColorManagedColorspaceSettings_reload_update(Main *UNUSED(bmain)
                if (scene->ed) {
                        ColorManagedColorspaceSettings *colorspace_settings = (ColorManagedColorspaceSettings *) ptr->data;
                        Sequence *seq;
-                       int seq_found = FALSE;
+                       bool seq_found = false;
 
                        if (&scene->sequencer_colorspace_settings != colorspace_settings) {
                                SEQ_BEGIN(scene->ed, seq);
                                {
                                        if (seq->strip && &seq->strip->colorspace_settings == colorspace_settings) {
-                                               seq_found = TRUE;
+                                               seq_found = true;
                                                break;
                                        }
                                }
@@ -564,10 +620,23 @@ static void rna_ColorManagedColorspaceSettings_reload_update(Main *UNUSED(bmain)
                        }
 
                        if (seq_found) {
+                               BKE_sequence_free_anim(seq);
+
+                               if (seq->strip->proxy && seq->strip->proxy->anim) {
+                                       IMB_free_anim(seq->strip->proxy->anim);
+                                       seq->strip->proxy->anim = NULL;
+                               }
+
                                BKE_sequence_invalidate_cache(scene, seq);
                                BKE_sequencer_preprocessed_cache_cleanup_sequence(seq);
                        }
                        else {
+                               SEQ_BEGIN(scene->ed, seq);
+                               {
+                                       BKE_sequence_free_anim(seq);
+                               }
+                               SEQ_END;
+
                                BKE_sequencer_cache_cleanup();
                                BKE_sequencer_preprocessed_cache_cleanup();
                        }
@@ -577,6 +646,16 @@ static void rna_ColorManagedColorspaceSettings_reload_update(Main *UNUSED(bmain)
        }
 }
 
+static char *rna_ColorManagedSequencerColorspaceSettings_path(PointerRNA *UNUSED(ptr))
+{
+       return BLI_sprintfN("sequencer_colorspace_settings");
+}
+
+static char *rna_ColorManagedInputColorspaceSettings_path(PointerRNA *UNUSED(ptr))
+{
+       return BLI_sprintfN("colorspace_settings");
+}
+
 static void rna_ColorManagement_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
 {
        ID *id = ptr->id.data;
@@ -585,16 +664,25 @@ static void rna_ColorManagement_update(Main *UNUSED(bmain), Scene *UNUSED(scene)
                return;
 
        if (GS(id->name) == ID_SCE) {
+               DAG_id_tag_update(id, 0);
                WM_main_add_notifier(NC_SCENE | ND_SEQUENCER, NULL);
        }
 }
 
 /* this function only exists because #curvemap_evaluateF uses a 'const' qualifier */
-static float rna_CurveMap_evaluateF(struct CurveMap *cuma, float value)
+static float rna_CurveMap_evaluateF(struct CurveMap *cuma, ReportList *reports, float value)
 {
+       if (!cuma->table) {
+               BKE_reportf(reports, RPT_ERROR, "CurveMap table not initialized, call initialize() on CurveMapping owner of the CurveMap");
+               return 0.0f;
+       }
        return curvemap_evaluateF(cuma, value);
 }
 
+static void rna_CurveMap_initialize(struct CurveMapping *cumap)
+{
+       curvemapping_initialize(cumap);
+}
 #else
 
 static void rna_def_curvemappoint(BlenderRNA *brna)
@@ -680,6 +768,7 @@ static void rna_def_curvemap(BlenderRNA *brna)
        rna_def_curvemap_points_api(brna, prop);
 
        func = RNA_def_function(srna, "evaluate", "rna_CurveMap_evaluateF");
+       RNA_def_function_flag(func, FUNC_USE_REPORTS);
        RNA_def_function_ui_description(func, "Evaluate curve at given location");
        parm = RNA_def_float(func, "position", 0.0f, -FLT_MAX, FLT_MAX, "Position", "Position to evaluate curve at", -FLT_MAX, FLT_MAX);
        RNA_def_property_flag(parm, PROP_REQUIRED);
@@ -736,18 +825,23 @@ static void rna_def_curvemapping(BlenderRNA *brna)
 
        prop = RNA_def_property(srna, "black_level", PROP_FLOAT, PROP_COLOR);
        RNA_def_property_float_sdna(prop, NULL, "black");
-       RNA_def_property_range(prop, -1000.0f, 1000.0f);
+       RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
+       RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 1, 3);
        RNA_def_property_ui_text(prop, "Black Level", "For RGB curves, the color that black is mapped to");
        RNA_def_property_float_funcs(prop, NULL, "rna_CurveMapping_black_level_set", NULL);
 
        prop = RNA_def_property(srna, "white_level", PROP_FLOAT, PROP_COLOR);
        RNA_def_property_float_sdna(prop, NULL, "white");
-       RNA_def_property_range(prop, -1000.0f, 1000.0f);
+       RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
+       RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 1, 3);
        RNA_def_property_ui_text(prop, "White Level", "For RGB curves, the color that white is mapped to");
        RNA_def_property_float_funcs(prop, NULL, "rna_CurveMapping_white_level_set", NULL);
 
        func = RNA_def_function(srna, "update", "curvemapping_changed_all");
        RNA_def_function_ui_description(func, "Update curve mapping after making changes");
+
+       func = RNA_def_function(srna, "initialize", "rna_CurveMap_initialize");
+       RNA_def_function_ui_description(func, "Initialize curve");
 }
 
 static void rna_def_color_ramp_element(BlenderRNA *brna)
@@ -765,7 +859,12 @@ static void rna_def_color_ramp_element(BlenderRNA *brna)
        RNA_def_property_array(prop, 4);
        RNA_def_property_ui_text(prop, "Color", "Set color of selected color stop");
        RNA_def_property_update(prop, 0, "rna_ColorRamp_update");
-       
+
+       prop = RNA_def_property(srna, "alpha", PROP_FLOAT, PROP_COLOR);
+       RNA_def_property_float_sdna(prop, NULL, "a");
+       RNA_def_property_ui_text(prop, "Alpha", "Set alpha of selected color stop");
+       RNA_def_property_update(prop, 0, "rna_ColorRamp_update");
+
        prop = RNA_def_property(srna, "position", PROP_FLOAT, PROP_NONE);
        RNA_def_property_float_sdna(prop, NULL, "pos");
        RNA_def_property_range(prop, 0, 1);
@@ -810,14 +909,29 @@ static void rna_def_color_ramp(BlenderRNA *brna)
        FunctionRNA *func;
 
        static EnumPropertyItem prop_interpolation_items[] = {
-               {1, "EASE", 0, "Ease", ""},
-               {3, "CARDINAL", 0, "Cardinal", ""},
-               {0, "LINEAR", 0, "Linear", ""},
-               {2, "B_SPLINE", 0, "B-Spline", ""},
-               {4, "CONSTANT", 0, "Constant", ""},
+               {COLBAND_INTERP_EASE, "EASE", 0, "Ease", ""},
+               {COLBAND_INTERP_CARDINAL, "CARDINAL", 0, "Cardinal", ""},
+               {COLBAND_INTERP_LINEAR, "LINEAR", 0, "Linear", ""},
+               {COLBAND_INTERP_B_SPLINE, "B_SPLINE", 0, "B-Spline", ""},
+               {COLBAND_INTERP_CONSTANT, "CONSTANT", 0, "Constant", ""},
                {0, NULL, 0, NULL, NULL}
        };
        
+       static EnumPropertyItem prop_mode_items[] = {
+               {COLBAND_BLEND_RGB, "RGB", 0, "RGB", ""},
+               {COLBAND_BLEND_HSV, "HSV", 0, "HSV", ""},
+               {COLBAND_BLEND_HSL, "HSL", 0, "HSL", ""},
+               {0, NULL, 0, NULL, NULL}
+       };
+
+       static EnumPropertyItem prop_hsv_items[] = {
+               {COLBAND_HUE_NEAR, "NEAR", 0, "Near", ""},
+               {COLBAND_HUE_FAR, "FAR", 0, "Far", ""},
+               {COLBAND_HUE_CW, "CW", 0, "Clockwise", ""},
+               {COLBAND_HUE_CCW, "CCW", 0, "Counter-Clockwise", ""},
+               {0, NULL, 0, NULL, NULL}
+       };
+
        srna = RNA_def_struct(brna, "ColorRamp", NULL);
        RNA_def_struct_sdna(srna, "ColorBand");
        RNA_def_struct_path_func(srna, "rna_ColorRamp_path");
@@ -833,7 +947,19 @@ static void rna_def_color_ramp(BlenderRNA *brna)
        prop = RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE);
        RNA_def_property_enum_sdna(prop, NULL, "ipotype");
        RNA_def_property_enum_items(prop, prop_interpolation_items);
-       RNA_def_property_ui_text(prop, "Interpolation", "");
+       RNA_def_property_ui_text(prop, "Interpolation", "Set interpolation between color stops");
+       RNA_def_property_update(prop, 0, "rna_ColorRamp_update");
+
+       prop = RNA_def_property(srna, "hue_interpolation", PROP_ENUM, PROP_NONE);
+       RNA_def_property_enum_sdna(prop, NULL, "ipotype_hue");
+       RNA_def_property_enum_items(prop, prop_hsv_items);
+       RNA_def_property_ui_text(prop, "Color Interpolation", "Set color interpolation");
+       RNA_def_property_update(prop, 0, "rna_ColorRamp_update");
+
+       prop = RNA_def_property(srna, "color_mode", PROP_ENUM, PROP_NONE);
+       RNA_def_property_enum_sdna(prop, NULL, "color_mode");
+       RNA_def_property_enum_items(prop, prop_mode_items);
+       RNA_def_property_ui_text(prop, "Color Mode", "Set color mode to use for interpolation");
        RNA_def_property_update(prop, 0, "rna_ColorRamp_update");
 
 #if 0 /* use len(elements) */
@@ -947,6 +1073,11 @@ static void rna_def_colormanage(BlenderRNA *brna)
                {0, NULL, 0, NULL, NULL}
        };
 
+       static EnumPropertyItem look_items[] = {
+               {0, "NONE", 0, "None", "Do not modify image in an artistic manner"},
+               {0, NULL, 0, NULL, NULL}
+       };
+
        static EnumPropertyItem view_transform_items[] = {
                {0, "NONE", 0, "None", "Do not perform any color transform on display, use old non-color managed technique for display"},
                {0, NULL, 0, NULL, NULL}
@@ -959,6 +1090,7 @@ static void rna_def_colormanage(BlenderRNA *brna)
 
        /* ** Display Settings  **  */
        srna = RNA_def_struct(brna, "ColorManagedDisplaySettings", NULL);
+       RNA_def_struct_path_func(srna, "rna_ColorManagedDisplaySettings_path");
        RNA_def_struct_ui_text(srna, "ColorManagedDisplaySettings", "Color management specific to display device");
 
        prop = RNA_def_property(srna, "display_device", PROP_ENUM, PROP_NONE);
@@ -971,14 +1103,23 @@ static void rna_def_colormanage(BlenderRNA *brna)
 
        /* ** View Settings  **  */
        srna = RNA_def_struct(brna, "ColorManagedViewSettings", NULL);
+       RNA_def_struct_path_func(srna, "rna_ColorManagedViewSettings_path");
        RNA_def_struct_ui_text(srna, "ColorManagedViewSettings", "Color management settings used for displaying images on the display");
 
+       prop = RNA_def_property(srna, "look", PROP_ENUM, PROP_NONE);
+       RNA_def_property_enum_items(prop, look_items);
+       RNA_def_property_enum_funcs(prop, "rna_ColorManagedViewSettings_look_get",
+                                         "rna_ColorManagedViewSettings_look_set",
+                                         "rna_ColorManagedViewSettings_look_itemf");
+       RNA_def_property_ui_text(prop, "Look", "Additional transform applied before view transform for an artistic needs");
+       RNA_def_property_update(prop, NC_WINDOW, "rna_ColorManagement_update");
+
        prop = RNA_def_property(srna, "view_transform", PROP_ENUM, PROP_NONE);
        RNA_def_property_enum_items(prop, view_transform_items);
        RNA_def_property_enum_funcs(prop, "rna_ColorManagedViewSettings_view_transform_get",
                                          "rna_ColorManagedViewSettings_view_transform_set",
                                          "rna_ColorManagedViewSettings_view_transform_itemf");
-       RNA_def_property_ui_text(prop, "View Transform", "View used ");
+       RNA_def_property_ui_text(prop, "View Transform", "View used when converting image to a display space");
        RNA_def_property_update(prop, NC_WINDOW, "rna_ColorManagement_update");
 
        prop = RNA_def_property(srna, "exposure", PROP_FLOAT, PROP_FACTOR);
@@ -1008,6 +1149,7 @@ static void rna_def_colormanage(BlenderRNA *brna)
 
        /* ** Colorspace **  */
        srna = RNA_def_struct(brna, "ColorManagedInputColorspaceSettings", NULL);
+       RNA_def_struct_path_func(srna, "rna_ColorManagedInputColorspaceSettings_path");
        RNA_def_struct_ui_text(srna, "ColorManagedInputColorspaceSettings", "Input color space settings");
 
        prop = RNA_def_property(srna, "name", PROP_ENUM, PROP_NONE);
@@ -1019,7 +1161,9 @@ static void rna_def_colormanage(BlenderRNA *brna)
        RNA_def_property_ui_text(prop, "Input Color Space", "Color space of the image or movie on disk");
        RNA_def_property_update(prop, NC_WINDOW, "rna_ColorManagedColorspaceSettings_reload_update");
 
+       //
        srna = RNA_def_struct(brna, "ColorManagedSequencerColorspaceSettings", NULL);
+       RNA_def_struct_path_func(srna, "rna_ColorManagedSequencerColorspaceSettings_path");
        RNA_def_struct_ui_text(srna, "ColorManagedSequencerColorspaceSettings", "Input color space settings");
 
        prop = RNA_def_property(srna, "name", PROP_ENUM, PROP_NONE);