diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2018-03-02 22:31:33 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2018-03-02 23:19:04 +0300 |
commit | 3fc2d122c45c9a1c2f85652b4930cf4aa6af6492 (patch) | |
tree | 23edd5a6daf4d0b2a91b67648d57be36d6c18b08 /source/blender/editors/space_buttons | |
parent | c43d51c1c2c7c811a30a26ebc1fcdf7af6c0c0c0 (diff) |
Fix texture panel for Cycles
I keep reading that texture painting is not working yet. However it is fully
working. We even have a "Full Shading" option in the viewport display panel.
Clay/EEVEE still need their UI figured out. But the context itself is doing
its part after this patch, and at least for Cycles it's working like 2.79.
Diffstat (limited to 'source/blender/editors/space_buttons')
-rw-r--r-- | source/blender/editors/space_buttons/buttons_texture.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/source/blender/editors/space_buttons/buttons_texture.c b/source/blender/editors/space_buttons/buttons_texture.c index d0e69a3dd7e..c6dda7f9f0d 100644 --- a/source/blender/editors/space_buttons/buttons_texture.c +++ b/source/blender/editors/space_buttons/buttons_texture.c @@ -351,18 +351,20 @@ static void buttons_texture_users_from_context(ListBase *users, const bContext * workspace = (WorkSpace *)workspace; } - if (!scene) + if (!scene) { scene = CTX_data_scene(C); + } - if (!pinid || GS(pinid->name) == ID_SCE) { - wrld = scene->world; + const ID_Type id_type = pinid != NULL ? GS(pinid->name) : -1; + if (!pinid || ELEM(id_type, ID_SCE, ID_WS)) { 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) { + + if (workspace == NULL) { + wrld = scene->world; + linestyle = BKE_linestyle_active_from_scene(scene); workspace = CTX_wm_workspace(C); } + ViewLayer *view_layer = BKE_view_layer_from_workspace_get(scene, workspace); ob = OBACT(view_layer); } |