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:
authorDalai Felinto <dfelinto@gmail.com>2017-11-09 18:11:20 +0300
committerDalai Felinto <dfelinto@gmail.com>2017-11-09 18:23:41 +0300
commitc35f1d05eaa13348d4f33cdb44f6fb62f68e1ba3 (patch)
tree698066b5eade15949b0453796c4d9fc466df42ac /source/blender/editors/space_buttons
parent09d26cab0bdde16529debd3e0271252012ba69eb (diff)
Farewell Scene->basact
Diffstat (limited to 'source/blender/editors/space_buttons')
-rw-r--r--source/blender/editors/space_buttons/buttons_texture.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/source/blender/editors/space_buttons/buttons_texture.c b/source/blender/editors/space_buttons/buttons_texture.c
index e3d72ba67d8..a7f18a4298c 100644
--- a/source/blender/editors/space_buttons/buttons_texture.c
+++ b/source/blender/editors/space_buttons/buttons_texture.c
@@ -54,6 +54,7 @@
#include "DNA_linestyle_types.h"
#include "BKE_context.h"
+#include "BKE_layer.h"
#include "BKE_linestyle.h"
#include "BKE_material.h"
#include "BKE_modifier.h"
@@ -324,6 +325,7 @@ static void buttons_texture_users_from_context(ListBase *users, const bContext *
Material *ma = NULL;
Lamp *la = NULL;
World *wrld = NULL;
+ WorkSpace *workspace = NULL;
FreestyleLineStyle *linestyle = NULL;
Brush *brush = NULL;
ID *pinid = sbuts->pinid;
@@ -345,17 +347,25 @@ static void buttons_texture_users_from_context(ListBase *users, const bContext *
brush = (Brush *)pinid;
else if (GS(pinid->name) == ID_LS)
linestyle = (FreestyleLineStyle *)pinid;
+ else if (GS(pinid->name) == ID_WS)
+ workspace = (WorkSpace *)workspace;
}
if (!scene)
scene = CTX_data_scene(C);
if (!pinid || GS(pinid->name) == ID_SCE) {
- ob = (scene->basact) ? scene->basact->object : NULL;
wrld = scene->world;
brush = BKE_paint_brush(BKE_paint_get_active_from_context(C));
linestyle = BKE_linestyle_active_from_scene(scene);
}
+ else if (!pinid || GS(pinid->name) == ID_WS) {
+ if (!workspace) {
+ workspace = CTX_wm_workspace(C);
+ }
+ SceneLayer *scene_layer = BKE_scene_layer_from_workspace_get(scene, workspace);
+ ob = OBACT_NEW(scene_layer);
+ }
if (ob && ob->type == OB_LAMP && !la)
la = ob->data;