diff options
author | Julian Eisel <julian@blender.org> | 2022-11-07 17:35:32 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2022-11-07 17:35:32 +0300 |
commit | 61eb425db8269a01aff47845735d0a8a9d991a60 (patch) | |
tree | 4e2a1b6f90f35ace1e8d388591f283a5084c7e35 /source/blender/makesrna/intern/rna_color.c | |
parent | efaeed1c1704b84187ff3d17a595c1df1f13c65c (diff) | |
parent | 8473b5a59291134b43fe055aad63daacaccb8f4f (diff) |
Merge branch 'master' into temp-asset-representation
Diffstat (limited to 'source/blender/makesrna/intern/rna_color.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_color.c | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/source/blender/makesrna/intern/rna_color.c b/source/blender/makesrna/intern/rna_color.c index b68d87587e7..fe4d51bafb9 100644 --- a/source/blender/makesrna/intern/rna_color.c +++ b/source/blender/makesrna/intern/rna_color.c @@ -15,11 +15,22 @@ #include "BKE_node_tree_update.h" #include "RNA_define.h" +#include "RNA_enum_types.h" #include "rna_internal.h" #include "WM_api.h" #include "WM_types.h" +const EnumPropertyItem rna_enum_color_space_convert_default_items[] = { + {0, + "NONE", + 0, + "None", + "Do not perform any color transform on load, treat colors as in scene linear space " + "already"}, + {0, NULL, 0, NULL, NULL}, +}; + #ifdef RNA_RUNTIME # include "RNA_access.h" @@ -566,8 +577,15 @@ static void rna_ColorManagedColorspaceSettings_colorspace_set(struct PointerRNA } static const EnumPropertyItem *rna_ColorManagedColorspaceSettings_colorspace_itemf( - bContext *UNUSED(C), PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), bool *r_free) + bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), bool *r_free) { +# if 0 /* FIXME: Causes blank drop-down, see T102316. */ + if (C == NULL) { + return rna_enum_color_space_convert_default_items; + } +# else + UNUSED_VARS(C); +# endif EnumPropertyItem *items = NULL; int totitem = 0; @@ -1190,16 +1208,6 @@ static void rna_def_colormanage(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}, }; - static const EnumPropertyItem color_space_items[] = { - {0, - "NONE", - 0, - "None", - "Do not perform any color transform on load, treat colors as in scene linear space " - "already"}, - {0, NULL, 0, NULL, NULL}, - }; - /* ** Display Settings ** */ srna = RNA_def_struct(brna, "ColorManagedDisplaySettings", NULL); RNA_def_struct_path_func(srna, "rna_ColorManagedDisplaySettings_path"); @@ -1279,7 +1287,7 @@ static void rna_def_colormanage(BlenderRNA *brna) prop = RNA_def_property(srna, "name", PROP_ENUM, PROP_NONE); RNA_def_property_flag(prop, PROP_ENUM_NO_CONTEXT); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - RNA_def_property_enum_items(prop, color_space_items); + RNA_def_property_enum_items(prop, rna_enum_color_space_convert_default_items); RNA_def_property_enum_funcs(prop, "rna_ColorManagedColorspaceSettings_colorspace_get", "rna_ColorManagedColorspaceSettings_colorspace_set", @@ -1309,7 +1317,7 @@ static void rna_def_colormanage(BlenderRNA *brna) prop = RNA_def_property(srna, "name", PROP_ENUM, PROP_NONE); RNA_def_property_flag(prop, PROP_ENUM_NO_CONTEXT); - RNA_def_property_enum_items(prop, color_space_items); + RNA_def_property_enum_items(prop, rna_enum_color_space_convert_default_items); RNA_def_property_enum_funcs(prop, "rna_ColorManagedColorspaceSettings_colorspace_get", "rna_ColorManagedColorspaceSettings_colorspace_set", |