diff options
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_workspace.h | 5 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/workspace.c | 16 |
2 files changed, 21 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_workspace.h b/source/blender/blenkernel/BKE_workspace.h index 9f989f7ae8f..1c1f15ec99a 100644 --- a/source/blender/blenkernel/BKE_workspace.h +++ b/source/blender/blenkernel/BKE_workspace.h @@ -149,6 +149,11 @@ void BKE_workspace_update_tagged(struct EvaluationContext *eval_ctx, struct WorkSpace *workspace, struct Scene *scene); +void BKE_workspace_update_object_mode( + struct EvaluationContext *eval_ctx, + struct WorkSpace *workspace, + struct Scene *scene); + #undef GETTER_ATTRS #undef SETTER_ATTRS diff --git a/source/blender/blenkernel/intern/workspace.c b/source/blender/blenkernel/intern/workspace.c index 8554cf0fb28..4b6bd3ac35b 100644 --- a/source/blender/blenkernel/intern/workspace.c +++ b/source/blender/blenkernel/intern/workspace.c @@ -45,6 +45,8 @@ #include "DNA_screen_types.h" #include "DNA_workspace_types.h" +#include "DEG_depsgraph.h" + #include "MEM_guardedalloc.h" @@ -521,3 +523,17 @@ void BKE_workspace_update_tagged(struct EvaluationContext *eval_ctx, true); BKE_scene_graph_update_tagged(eval_ctx, depsgraph, bmain, scene, view_layer); } + +void BKE_workspace_update_object_mode( + struct EvaluationContext *eval_ctx, + WorkSpace *workspace, Scene *scene) +{ + ViewLayer *view_layer = BKE_workspace_view_layer_get(workspace, scene); + + /* TODO(campbell): Investigate how this should work exactly, + * for now without this 'bmain->eval_ctx' is never set. */ + { + Object *ob = view_layer->basact ? view_layer->basact->object : NULL; + eval_ctx->object_mode = ob ? (eObjectMode)ob->mode : OB_MODE_OBJECT; + } +}
\ No newline at end of file |