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-02-13 12:35:29 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-02-13 12:55:12 +0300
commitc8597a465f22e020b1c0ce6fcfbb7b7308efdad1 (patch)
treebdff87671b2f24ce7f393534e4325fb9e66eeda8 /source/blender/blenkernel/intern/workspace.c
parent754d3a2fe626fbe57bb6ef47581368e3859f6390 (diff)
Object Mode: remove Scene.obedit
Add ED_screen_window_find, BKE_workspace_edit_object
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;
+}
+