diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-02-06 09:28:00 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-02-06 10:03:28 +0300 |
commit | 5ec016169b80cc8205740a5b3beb12f91be3182b (patch) | |
tree | cf3423e34d0a0d51b72b40d8efd3abe2cf5a5370 /source/blender/editors/interface/interface_icons.c | |
parent | 269ed0a770bf3627ba1e21d87d3d748c0765a531 (diff) |
Object Mode: use eval_ctx for context/screen code
Diffstat (limited to 'source/blender/editors/interface/interface_icons.c')
-rw-r--r-- | source/blender/editors/interface/interface_icons.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index d048324d35e..2941b08b7ad 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -61,6 +61,8 @@ #include "BIF_glutil.h" +#include "DEG_depsgraph.h" + #include "ED_datafiles.h" #include "ED_keyframes_draw.h" #include "ED_render.h" @@ -1193,6 +1195,8 @@ static int ui_id_brush_get_icon(const bContext *C, ID *id) ui_id_icon_render(C, id, true); } else { + EvaluationContext eval_ctx; + CTX_data_eval_ctx(C, &eval_ctx); Object *ob = CTX_data_active_object(C); SpaceImage *sima; const EnumPropertyItem *items = NULL; @@ -1203,11 +1207,11 @@ static int ui_id_brush_get_icon(const bContext *C, ID *id) * checking various context stuff here */ if (CTX_wm_view3d(C) && ob) { - if (ob->mode & OB_MODE_SCULPT) + if (eval_ctx.object_mode & OB_MODE_SCULPT) mode = OB_MODE_SCULPT; - else if (ob->mode & (OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT)) + else if (eval_ctx.object_mode & (OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT)) mode = OB_MODE_VERTEX_PAINT; - else if (ob->mode & OB_MODE_TEXTURE_PAINT) + else if (eval_ctx.object_mode & OB_MODE_TEXTURE_PAINT) mode = OB_MODE_TEXTURE_PAINT; } else if ((sima = CTX_wm_space_image(C)) && |