diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-02-08 13:14:26 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-02-08 13:14:26 +0300 |
commit | 345c6298e995ea618c34282ba6d7ab5af032f191 (patch) | |
tree | f4fbc4798e17d0f19efc28b51a41425d0c552be8 /source/blender/editors/space_info | |
parent | 14a19fed788af0cf3695eb5def92510841056e08 (diff) |
Object Mode: move to workspace struct
- Read-only access can often use EvaluationContext.object_mode
- Write access to go to WorkSpace.object_mode.
- Some TODO's remain (marked as "TODO/OBMODE")
- Add-ons will need updating
(context.active_object.mode -> context.workspace.object_mode)
- There will be small/medium issues that still need resolving
this does work on a basic level though.
See D3037
Diffstat (limited to 'source/blender/editors/space_info')
-rw-r--r-- | source/blender/editors/space_info/info_stats.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/source/blender/editors/space_info/info_stats.c b/source/blender/editors/space_info/info_stats.c index 25d590550ce..118be88216e 100644 --- a/source/blender/editors/space_info/info_stats.c +++ b/source/blender/editors/space_info/info_stats.c @@ -36,6 +36,7 @@ #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" @@ -526,14 +527,12 @@ void ED_info_stats_clear(ViewLayer *view_layer) } } -const char *ED_info_stats_string(Scene *scene, ViewLayer *view_layer) +const char *ED_info_stats_string(Scene *scene, WorkSpace *workspace, ViewLayer *view_layer) { - const eObjectMode object_mode = (view_layer->basact) ? view_layer->basact->object->mode : OB_MODE_OBJECT; - if (!view_layer->stats) { - stats_update(scene, view_layer, object_mode); + stats_update(scene, view_layer, workspace->object_mode); } - stats_string(scene, view_layer, object_mode); + stats_string(scene, view_layer, workspace->object_mode); return view_layer->stats->infostr; } |