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:
Diffstat (limited to 'source/blender/blenkernel/intern/workspace.c')
-rw-r--r--source/blender/blenkernel/intern/workspace.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/workspace.c b/source/blender/blenkernel/intern/workspace.c
index dcd4183210d..bc5731b9574 100644
--- a/source/blender/blenkernel/intern/workspace.c
+++ b/source/blender/blenkernel/intern/workspace.c
@@ -38,6 +38,7 @@
#include "BKE_main.h"
#include "BKE_scene.h"
#include "BKE_screen.h"
+#include "BKE_object.h"
#include "BKE_workspace.h"
#include "DNA_object_types.h"
@@ -517,4 +518,20 @@ void BKE_workspace_update_object_mode(
* for now without this 'bmain->eval_ctx' is never set. */
eval_ctx->object_mode = workspace->object_mode;
-} \ No newline at end of file
+}
+
+Object *BKE_workspace_edit_object(WorkSpace *workspace, Scene *scene)
+{
+ if (workspace->object_mode & OB_MODE_EDIT) {
+ ViewLayer *view_layer = BKE_workspace_view_layer_get(workspace, scene);
+ if (view_layer) {
+ Object *obedit = OBACT(view_layer);
+ if (obedit) {
+ BLI_assert(BKE_object_is_in_editmode(obedit));
+ return obedit;
+ }
+ }
+ }
+ return NULL;
+}
+