[Bf-blender-cvs] [3fc2d122c45] blender2.8: Fix texture panel for Cycles

Dalai Felinto noreply at git.blender.org
Fri Mar 2 21:20:02 CET 2018


Commit: 3fc2d122c45c9a1c2f85652b4930cf4aa6af6492
Author: Dalai Felinto
Date:   Fri Mar 2 16:31:33 2018 -0300
Branches: blender2.8
https://developer.blender.org/rB3fc2d122c45c9a1c2f85652b4930cf4aa6af6492

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.

===================================================================

M	source/blender/editors/space_buttons/buttons_texture.c

===================================================================

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);
 	}



More information about the Bf-blender-cvs mailing list