[Bf-blender-cvs] [c93a88413d1] master: Merge branch 'blender-v2.83-release'
Brecht Van Lommel
noreply at git.blender.org
Fri May 29 18:05:29 CEST 2020
Commit: c93a88413d1499d43265af9580e993bf8963726d
Author: Brecht Van Lommel
Date: Fri May 29 18:05:04 2020 +0200
Branches: master
https://developer.blender.org/rBc93a88413d1499d43265af9580e993bf8963726d
Merge branch 'blender-v2.83-release'
===================================================================
===================================================================
diff --cc source/blender/blenkernel/BKE_blender_version.h
index 981799ec1dd,3a07e9133d3..9d948dfd57b
--- a/source/blender/blenkernel/BKE_blender_version.h
+++ b/source/blender/blenkernel/BKE_blender_version.h
@@@ -30,25 -26,25 +30,29 @@@ extern "C"
*
* \note Use #STRINGIFY() rather than defining with quotes.
*/
+
+ /* Blender major and minor version. */
-#define BLENDER_VERSION 283
+#define BLENDER_VERSION 290
- #define BLENDER_SUBVERSION 4
- /** Several breakages with 280, e.g. collections vs layers. */
- #define BLENDER_MINVERSION 280
- #define BLENDER_MINSUBVERSION 0
-
- /** Used by packaging tools. */
- /** Can be left blank, otherwise a,b,c... etc with no quotes. */
- #define BLENDER_VERSION_CHAR
- /** alpha/beta/rc/release, docs use this. */
+ /* Blender patch version for bugfix releases. */
+ #define BLENDER_VERSION_PATCH 0
+ /** Blender release cycle stage: alpha/beta/rc/release. */
-#define BLENDER_VERSION_CYCLE beta
+#define BLENDER_VERSION_CYCLE alpha
- /** Optionally set to 1,2,... for example to get alpha1 or rc2. */
- #define BLENDER_VERSION_CYCLE_NUMBER
- /** Defined in from blender.c */
- extern char versionstr[];
+ /* Blender file format version. */
+ #define BLENDER_FILE_VERSION BLENDER_VERSION
-#define BLENDER_FILE_SUBVERSION 17
++#define BLENDER_FILE_SUBVERSION 4
+
+ /* Minimum Blender version that supports reading file written with the current
+ * version. Older Blender versions will test this and show a warning if the file
+ * was written with too new a version. */
+ #define BLENDER_FILE_MIN_VERSION 280
+ #define BLENDER_FILE_MIN_SUBVERSION 0
+
+ /** User readable version string. */
+ const char *BKE_blender_version_string(void);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* __BKE_BLENDER_VERSION_H__ */
diff --cc source/blender/editors/space_info/info_stats.c
index dbd3b65857a,350e788e377..e1937dffb37
--- a/source/blender/editors/space_info/info_stats.c
+++ b/source/blender/editors/space_info/info_stats.c
@@@ -411,86 -404,20 +411,86 @@@ static const char *footer_string(ViewLa
char memstr[MAX_INFO_MEM_LEN];
char gpumemstr[MAX_INFO_MEM_LEN] = "";
char formatted_mem[15];
- char *s;
size_t ofs = 0;
- mem_in_use = MEM_get_memory_in_use();
- mmap_in_use = MEM_get_mapped_memory_in_use();
+ uintptr_t mem_in_use = MEM_get_memory_in_use();
+
+ /* get memory statistics */
+ BLI_str_format_byte_unit(formatted_mem, mem_in_use, false);
+ ofs = BLI_snprintf(memstr, MAX_INFO_MEM_LEN, TIP_("Mem: %s"), formatted_mem);
+
+ if (GPU_mem_stats_supported()) {
+ int gpu_free_mem, gpu_tot_memory;
+
+ GPU_mem_stats_get(&gpu_tot_memory, &gpu_free_mem);
+
+ BLI_str_format_byte_unit(formatted_mem, gpu_free_mem, false);
+ ofs = BLI_snprintf(gpumemstr, MAX_INFO_MEM_LEN, TIP_(" | Free GPU Mem: %s"), formatted_mem);
+
+ if (gpu_tot_memory) {
+ BLI_str_format_byte_unit(formatted_mem, gpu_tot_memory, false);
+ BLI_snprintf(gpumemstr + ofs, MAX_INFO_MEM_LEN - ofs, TIP_("/%s"), formatted_mem);
+ }
+ }
+
+ BLI_snprintf(view_layer->footer_str,
+ sizeof(view_layer->footer_str),
+ "%s%s | %s",
+ memstr,
+ gpumemstr,
- versionstr);
++ BKE_blender_version_string());
+
+ return view_layer->footer_str;
+
+#undef MAX_INFO_MEM_LEN
+}
+
+void ED_info_stats_clear(ViewLayer *view_layer)
+{
+ if (view_layer->stats) {
+ MEM_freeN(view_layer->stats);
+ view_layer->stats = NULL;
+ }
+}
+
+const char *ED_info_footer_string(ViewLayer *view_layer)
+{
+ return footer_string(view_layer);
+}
+
+static void stats_row(int col1,
+ const char *key,
+ int col2,
+ const char *value1,
+ const char *value2,
+ int *y,
+ int height)
+{
+ *y -= height;
+ BLF_draw_default(col1, *y, 0.0f, key, 128);
+ char values[128];
+ BLI_snprintf(values, sizeof(values), (value2) ? "%s / %s" : "%s", value1, value2);
+ BLF_draw_default(col2, *y, 0.0f, values, sizeof(values));
+}
+
+void ED_info_draw_stats(
+ Main *bmain, Scene *scene, ViewLayer *view_layer, int x, int *y, int height)
+{
+ /* Create stats if they don't already exist. */
+ if (!view_layer->stats) {
+ /* Do not not access dependency graph if interface is marked as locked. */
+ wmWindowManager *wm = bmain->wm.first;
+ if (wm->is_interface_locked) {
+ return;
+ }
+ Depsgraph *depsgraph = BKE_scene_get_depsgraph(bmain, scene, view_layer, true);
+ stats_update(depsgraph, view_layer);
+ }
+
+ SceneStats *stats = view_layer->stats;
+ SceneStatsFmt stats_fmt;
- /* Generate formatted numbers */
+ /* Generate formatted numbers. */
#define SCENE_STATS_FMT_INT(_id) BLI_str_format_uint64_grouped(stats_fmt._id, stats->_id)
SCENE_STATS_FMT_INT(totvert);
diff --cc source/blender/windowmanager/intern/wm_splash_screen.c
index c821f5bfe89,1fcde9685b9..b75609fd28f
--- a/source/blender/windowmanager/intern/wm_splash_screen.c
+++ b/source/blender/windowmanager/intern/wm_splash_screen.c
@@@ -94,41 -93,46 +94,8 @@@ static void wm_block_splash_add_label(u
/* 1 = UI_SELECT, internal flag to draw in white. */
UI_but_flag_enable(but, 1);
UI_block_emboss_set(block, UI_EMBOSS);
- *y -= 12 * U.dpi_fac;
-}
-
-static void wm_block_splash_add_labels(uiBlock *block, int x, int y)
-{
- /* Version number. */
- char version_buf[256] = "\0";
- BLI_snprintf(version_buf, sizeof(version_buf), "v%s", BKE_blender_version_string());
-
- wm_block_splash_add_label(block, version_buf, x, &y);
-
-#ifdef WITH_BUILDINFO
- if (!STREQ(STRINGIFY(BLENDER_VERSION_CYCLE), "release")) {
- extern unsigned long build_commit_timestamp;
- extern char build_hash[], build_commit_date[], build_commit_time[], build_branch[];
-
- /* Date, hidden for builds made from tag. */
- if (build_commit_timestamp != 0) {
- char date_buf[256] = "\0";
- BLI_snprintf(
- date_buf, sizeof(date_buf), "Date: %s %s", build_commit_date, build_commit_time);
- wm_block_splash_add_label(block, date_buf, x, &y);
- }
-
- /* Hash. */
- char hash_buf[256] = "\0";
- BLI_snprintf(hash_buf, sizeof(hash_buf), "Hash: %s", build_hash);
- wm_block_splash_add_label(block, hash_buf, x, &y);
-
- /* Branch. */
- if (!STREQ(build_branch, "master")) {
- char branch_buf[256] = "\0";
- BLI_snprintf(branch_buf, sizeof(branch_buf), "Branch: %s", build_branch);
-
- wm_block_splash_add_label(block, branch_buf, x, &y);
- }
- }
-#endif /* WITH_BUILDINFO */
}
- static void get_version_string(char *ver, const int max_length)
- {
- /* Version number. */
- const char *version_cycle = NULL;
-
- if (STREQ(STRINGIFY(BLENDER_VERSION_CYCLE), "alpha")) {
- version_cycle = " Alpha";
- }
- else if (STREQ(STRINGIFY(BLENDER_VERSION_CYCLE), "beta")) {
- version_cycle = " Beta";
- }
- else if (STREQ(STRINGIFY(BLENDER_VERSION_CYCLE), "rc")) {
- version_cycle = " Release Candidate";
- }
- else if (STREQ(STRINGIFY(BLENDER_VERSION_CYCLE), "release")) {
- version_cycle = STRINGIFY(BLENDER_VERSION_CHAR);
- }
-
- const char *version_cycle_number = "";
- if (strlen(STRINGIFY(BLENDER_VERSION_CYCLE_NUMBER))) {
- version_cycle_number = " " STRINGIFY(BLENDER_VERSION_CYCLE_NUMBER);
- }
-
- BLI_snprintf(ver,
- max_length,
- "%d.%d.%d%s%s",
- BLENDER_VERSION / 100,
- BLENDER_VERSION % 100,
- BLENDER_SUBVERSION,
- version_cycle,
- version_cycle_number);
- }
-
#ifndef WITH_HEADLESS
static void wm_block_splash_image_roundcorners_add(ImBuf *ibuf)
{
@@@ -249,12 -253,10 +216,11 @@@ static uiBlock *wm_block_create_splash(
but = uiDefButImage(block, ibuf, 0, 0.5f * U.widget_unit, splash_width, splash_height, NULL);
- UI_but_func_set(but, wm_block_splash_close, block, NULL);
+ UI_but_func_set(but, wm_block_close, block, NULL);
UI_block_func_set(block, wm_block_splash_refreshmenu, block, NULL);
- char version_buf[256] = "\0";
- get_version_string(version_buf, sizeof(version_buf));
- wm_block_splash_add_label(block, version_buf, splash_width, splash_height - 13.0 * U.dpi_fac);
- wm_block_splash_add_labels(block, splash_width, splash_height - 13 * U.dpi_fac);
++ wm_block_splash_add_label(
++ block, BKE_blender_version_string(), splash_width, splash_height - 13.0 * U.dpi_fac);
const int layout_margin_x = U.dpi_fac * 26;
uiLayout *layout = UI_block_layout(block,
@@@ -293,93 -295,3 +259,92 @@@ void WM_OT_splash(wmOperatorType *ot
ot->invoke = wm_splash_invoke;
ot->poll = WM_operator_winactive;
}
+
+static uiBlock *wm_block_create_about(bContext *C, ARegion *region, void *UNUSED(arg))
+{
+ uiBlock *block;
+ const uiStyle *style = UI_style_get_dpi();
+ const int dialog_width = U.widget_unit * 24;
+ const short logo_size = 128 * U.dpi_fac;
+
+ /* Calculate icon column factor. */
+ const float split_factor = (float)logo_size / (float)(dialog_width - style->columnspace);
+
+ block = UI_block_begin(C, region, "about", UI_EMBOSS);
+
+ UI_block_flag_enable(
+ block, UI_BLOCK_KEEP_OPEN | UI_BLOCK_LOOP | UI_BLOCK_NO_WIN_CLIP | UI_BLOCK_NUMSELECT);
+ UI_block_theme_style_set(block, UI_BLOCK_THEME_STYLE_POPUP);
+ UI_block_emboss_set(block, UI_EMBOSS);
+
+ uiLayout *block_layout = UI_block_layout(
+ block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, dialog_width, 0, 0, style);
+
+ /* Split layout to put Blender logo on left side. */
+ uiLayout *split_block = uiLayoutSplit(block_layout, split_factor, false);
+
+ /* Blender Logo. */
+ uiLayout *layout = uiLayoutColumn(split_block, false);
+ uiDefButAlert(block, ALERT_ICON_BLENDER, 0, 0, 0, logo_size);
+
+ /* The rest of the content on the right. */
+ layout = uiLayoutColumn(split_block, false);
+
+ uiLayoutSetScaleY(layout, 0.7f);
+
+ uiItemS_ex(layout, 1.0f);
+
+ /* Title. */
+ uiItemL_ex(layout, "Blender", ICON_NONE, tr
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list