Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/RNA_access.h1
-rw-r--r--source/blender/makesrna/intern/rna_space.c6
-rw-r--r--source/blender/makesrna/intern/rna_ui_api.c6
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c43
4 files changed, 10 insertions, 46 deletions
diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h
index 1c752d45228..f6ef3e9efcd 100644
--- a/source/blender/makesrna/RNA_access.h
+++ b/source/blender/makesrna/RNA_access.h
@@ -594,6 +594,7 @@ extern StructRNA RNA_StretchToConstraint;
extern StructRNA RNA_StringProperty;
extern StructRNA RNA_Struct;
extern StructRNA RNA_StucciTexture;
+extern StructRNA RNA_StudioLight;
extern StructRNA RNA_SubsurfModifier;
extern StructRNA RNA_SunLamp;
extern StructRNA RNA_SurfaceCurve;
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index ab1409192c2..14a3b9cbe5a 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -763,7 +763,7 @@ static const EnumPropertyItem *rna_View3DShading_studio_light_itemf(
const int flags = (STUDIOLIGHT_EXTERNAL_FILE | STUDIOLIGHT_ORIENTATION_VIEWNORMAL);
LISTBASE_FOREACH(StudioLight *, sl, BKE_studiolight_listbase()) {
- int icon_id = sl->irradiance_icon_id;
+ int icon_id = (v3d->shading.flag & V3D_SHADING_MATCAP_FLIP_X) ? sl->icon_id_matcap_flipped: sl->icon_id_matcap;
if ((sl->flag & flags) == flags) {
EnumPropertyItem tmp = {sl->index, sl->name, icon_id, sl->name, ""};
RNA_enum_item_add(&item, &totitem, &tmp);
@@ -772,7 +772,7 @@ static const EnumPropertyItem *rna_View3DShading_studio_light_itemf(
}
else {
LISTBASE_FOREACH(StudioLight *, sl, BKE_studiolight_listbase()) {
- int icon_id = sl->irradiance_icon_id;
+ int icon_id = sl->icon_id_irradiance;
bool show_studiolight = false;
if ((sl->flag & STUDIOLIGHT_INTERNAL)) {
@@ -788,7 +788,7 @@ static const EnumPropertyItem *rna_View3DShading_studio_light_itemf(
case OB_MATERIAL:
show_studiolight = (sl->flag & STUDIOLIGHT_ORIENTATION_WORLD) > 0;
- icon_id = sl->radiance_icon_id;
+ icon_id = sl->icon_id_radiance;
break;
}
}
diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c
index 3940f13c64a..9377ef8a925 100644
--- a/source/blender/makesrna/intern/rna_ui_api.c
+++ b/source/blender/makesrna/intern/rna_ui_api.c
@@ -869,6 +869,12 @@ void RNA_api_ui_layout(StructRNA *srna)
api_ui_item_rna_common(func);
RNA_def_boolean(func, "expand", false, "", "Expand button to show more detail");
+ func = RNA_def_function(srna, "template_icon", "uiTemplateIcon");
+ RNA_def_function_ui_description(func, "Display a large icon");
+ parm = RNA_def_int(func, "icon_value", 0, 0, INT_MAX, "Icon to display", "", 0, INT_MAX);
+ RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
+ RNA_def_float(func, "scale", 1.0f, 1.0f, 100.0f, "Scale", "Scale the icon size (by the button size)", 1.0f, 100.0f);
+
func = RNA_def_function(srna, "template_icon_view", "uiTemplateIconView");
RNA_def_function_ui_description(func, "Enum. Large widget showing Icon previews");
api_ui_item_rna_common(func);
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 844ab3301fa..3b9aa5bbaa4 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -78,11 +78,6 @@ const EnumPropertyItem rna_enum_navigation_mode_items[] = {
{0, NULL, 0, NULL, NULL}
};
-static const EnumPropertyItem rna_enum_studio_light_icons_id_items[] = {
- {0, "DEFAULT", 0, "Default", ""},
- {0, NULL, 0, NULL, NULL}
-};
-
#if defined(WITH_INTERNATIONAL) || !defined(RNA_RUNTIME)
static const EnumPropertyItem rna_enum_language_default_items[] = {
@@ -704,38 +699,6 @@ static int rna_UserDef_studiolight_index_get(PointerRNA *ptr)
return sl->index;
}
-/* StudioLight.icon_id */
-static int rna_UserDef_studiolight_icon_id_get(PointerRNA *ptr)
-{
- StudioLight *sl = (StudioLight *)ptr->data;
- if (sl->flag & (STUDIOLIGHT_ORIENTATION_VIEWNORMAL | STUDIOLIGHT_ORIENTATION_CAMERA)) {
- return 1;
- }
- return 0;
-}
-
-static const EnumPropertyItem *rna_UserDef_studiolight_icon_id_itemf(
- bContext *UNUSED(C), PointerRNA *ptr,
- PropertyRNA *UNUSED(prop), bool *r_free)
-{
- EnumPropertyItem *item = NULL;
- int totitem = 0;
- StudioLight *sl = (StudioLight *)ptr->data;
-
- if ((sl->flag & (STUDIOLIGHT_ORIENTATION_VIEWNORMAL | STUDIOLIGHT_ORIENTATION_CAMERA)) == 0) {
- EnumPropertyItem tmp = {0, sl->name, sl->radiance_icon_id, sl->name, ""};
- RNA_enum_item_add(&item, &totitem, &tmp);
- }
-
- {
- EnumPropertyItem tmp = {1, sl->name, sl->irradiance_icon_id, sl->name, ""};
- RNA_enum_item_add(&item, &totitem, &tmp);
- }
- RNA_enum_item_end(&item, &totitem);
- *r_free = true;
- return item;
-}
-
/* StudioLight.is_user_defined */
static int rna_UserDef_studiolight_is_user_defined_get(PointerRNA *ptr)
{
@@ -3320,12 +3283,6 @@ static void rna_def_userdef_studiolight(BlenderRNA *brna)
RNA_def_property_enum_funcs(prop, "rna_UserDef_studiolight_orientation_get", "rna_UserDef_studiolight_orientation_set", NULL);
RNA_def_property_ui_text(prop, "Orientation", "");
- prop = RNA_def_property(srna, "icon_id", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_funcs(prop, "rna_UserDef_studiolight_icon_id_get", NULL, "rna_UserDef_studiolight_icon_id_itemf");
- RNA_def_property_enum_items(prop, rna_enum_studio_light_icons_id_items);
- RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- RNA_def_property_ui_text(prop, "Preview", "Preview of the studiolight");
-
prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, "rna_UserDef_studiolight_name_get", "rna_UserDef_studiolight_name_length", NULL);
RNA_def_property_ui_text(prop, "Name", "");