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:
authorCampbell Barton <ideasman42@gmail.com>2018-04-05 19:20:27 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-04-05 19:21:14 +0300
commit1c24c04e6023f2d2a328dfcdc9f86cd381d029a3 (patch)
tree7a5af59ce078cb66fb17ec33cf111ffc8d5fb328 /source/blender/editors/space_info
parent57329304b061efe756e3a4ce1b828e9a7c7f7030 (diff)
Remove workspace object mode, reverts changes w/ 2.8
This caused too many problems syncing object modes with multiple objects/windows/workspaces, see: D3130 for details.
Diffstat (limited to 'source/blender/editors/space_info')
-rw-r--r--source/blender/editors/space_info/info_stats.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/source/blender/editors/space_info/info_stats.c b/source/blender/editors/space_info/info_stats.c
index 800560c380c..157171481bc 100644
--- a/source/blender/editors/space_info/info_stats.c
+++ b/source/blender/editors/space_info/info_stats.c
@@ -36,7 +36,6 @@
#include "DNA_lattice_types.h"
#include "DNA_meta_types.h"
#include "DNA_scene_types.h"
-#include "DNA_workspace_types.h"
#include "BLI_math.h"
#include "BLI_string.h"
@@ -375,21 +374,22 @@ static bool stats_is_object_dynamic_topology_sculpt(Object *ob, const eObjectMod
}
/* Statistics displayed in info header. Called regularly on scene changes. */
-static void stats_update(ViewLayer *view_layer, Object *obedit, const eObjectMode object_mode)
+static void stats_update(ViewLayer *view_layer)
{
SceneStats stats = {0};
- Object *ob = (view_layer->basact) ? view_layer->basact->object : NULL;
+ Object *ob = OBACT(view_layer);
+ Object *obedit = OBEDIT_FROM_VIEW_LAYER(view_layer);
Base *base;
if (obedit) {
/* Edit Mode */
stats_object_edit(ob, &stats);
}
- else if (ob && (object_mode & OB_MODE_POSE)) {
+ else if (ob && (ob->mode & OB_MODE_POSE)) {
/* Pose Mode */
stats_object_pose(ob, &stats);
}
- else if (stats_is_object_dynamic_topology_sculpt(ob, object_mode)) {
+ else if (stats_is_object_dynamic_topology_sculpt(ob, ob->mode)) {
/* Dynamic-topology sculpt mode */
stats_object_sculpt_dynamic_topology(ob, &stats);
}
@@ -408,12 +408,14 @@ static void stats_update(ViewLayer *view_layer, Object *obedit, const eObjectMod
*(view_layer->stats) = stats;
}
-static void stats_string(ViewLayer *view_layer, Object *obedit, const eObjectMode object_mode)
+static void stats_string(ViewLayer *view_layer)
{
#define MAX_INFO_MEM_LEN 64
SceneStats *stats = view_layer->stats;
SceneStatsFmt stats_fmt;
- Object *ob = (view_layer->basact) ? view_layer->basact->object : NULL;
+ Object *ob = OBACT(view_layer);
+ Object *obedit = OBEDIT_FROM_OBACT(ob);
+ eObjectMode object_mode = ob ? ob->mode : OB_MODE_OBJECT;
uintptr_t mem_in_use, mmap_in_use;
char memstr[MAX_INFO_MEM_LEN];
char gpumemstr[MAX_INFO_MEM_LEN] = "";
@@ -528,16 +530,11 @@ void ED_info_stats_clear(ViewLayer *view_layer)
}
}
-const char *ED_info_stats_string(Scene *UNUSED(scene), WorkSpace *workspace, ViewLayer *view_layer)
+const char *ED_info_stats_string(Scene *UNUSED(scene), ViewLayer *view_layer)
{
- Object *obact = (view_layer->basact) ? view_layer->basact->object : NULL;
- Object *obedit = (obact && (workspace->object_mode & OB_MODE_EDIT) &&
- BKE_object_is_in_editmode(obact)) ? obact : NULL;
-
if (!view_layer->stats) {
- stats_update(view_layer, obedit, workspace->object_mode);
+ stats_update(view_layer);
}
- stats_string(view_layer, obedit, workspace->object_mode);
-
+ stats_string(view_layer);
return view_layer->stats->infostr;
}