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:
authorHarley Acheson <harley.acheson@gmail.com>2020-07-18 17:49:25 +0300
committerHarley Acheson <harley.acheson@gmail.com>2020-07-18 17:49:25 +0300
commitc08d847488048e9d5233bfd14e363de574332846 (patch)
tree59cd059ab1d146db2cebd8051319009adfcd5ea4 /source/blender/makesrna/intern/rna_userdef.c
parentfe49e4139cd3f78f126b60ea4240a0294eac9483 (diff)
UI: Status Bar Statistics and Other Options
Status Bar can show scene statistics, memory usage, version, etc set by context menu. Part two of T75672. Differential Revision: https://developer.blender.org/D7557 Reviewed by Julian Eisel
Diffstat (limited to 'source/blender/makesrna/intern/rna_userdef.c')
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 956fb65054b..e609bdacb02 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -188,6 +188,7 @@ static const EnumPropertyItem rna_enum_userdef_viewport_aa_items[] = {
# include "DEG_depsgraph.h"
# include "GPU_draw.h"
+# include "GPU_extensions.h"
# include "GPU_select.h"
# include "BLF_api.h"
@@ -1066,6 +1067,11 @@ static void rna_UserDef_studiolight_light_ambient_get(PointerRNA *ptr, float *va
copy_v3_v3(values, sl->light_ambient);
}
+int rna_show_statusbar_vram_editable(struct PointerRNA *UNUSED(ptr), const char **UNUSED(r_info))
+{
+ return GPU_mem_stats_supported() ? PROP_EDITABLE : 0;
+}
+
#else
# define USERDEF_TAG_DIRTY_PROPERTY_UPDATE_ENABLE \
@@ -4771,6 +4777,29 @@ static void rna_def_userdef_view(BlenderRNA *brna)
"Translate New Names",
"Translate the names of new data-blocks (objects, materials...)");
RNA_def_property_update(prop, 0, "rna_userdef_update");
+
+ /* Statusbar. */
+
+ prop = RNA_def_property(srna, "show_statusbar_memory", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "statusbar_flag", STATUSBAR_SHOW_MEMORY);
+ RNA_def_property_ui_text(prop, "Show Memory", "Show Blender memory usage");
+ RNA_def_property_update(prop, NC_SPACE | ND_SPACE_INFO, "rna_userdef_update");
+
+ prop = RNA_def_property(srna, "show_statusbar_vram", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "statusbar_flag", STATUSBAR_SHOW_VRAM);
+ RNA_def_property_ui_text(prop, "Show VRAM", "Show GPU video memory usage");
+ RNA_def_property_editable_func(prop, "rna_show_statusbar_vram_editable");
+ RNA_def_property_update(prop, NC_SPACE | ND_SPACE_INFO, "rna_userdef_update");
+
+ prop = RNA_def_property(srna, "show_statusbar_version", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "statusbar_flag", STATUSBAR_SHOW_VERSION);
+ RNA_def_property_ui_text(prop, "Show Version", "Show Blender version string");
+ RNA_def_property_update(prop, NC_SPACE | ND_SPACE_INFO, "rna_userdef_update");
+
+ prop = RNA_def_property(srna, "show_statusbar_stats", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "statusbar_flag", STATUSBAR_SHOW_STATS);
+ RNA_def_property_ui_text(prop, "Show Statistics", "Show scene statistics");
+ RNA_def_property_update(prop, NC_SPACE | ND_SPACE_INFO, "rna_userdef_update");
}
static void rna_def_userdef_edit(BlenderRNA *brna)