[Bf-blender-cvs] [c75261c] master: Fix T40331: Incorrect display of path of editted data.

Bastien Montagne noreply at git.blender.org
Sat May 24 16:04:03 CEST 2014


Commit: c75261c8cba75ac3f4313834e9aae91378cbfc33
Author: Bastien Montagne
Date:   Sat May 24 16:02:10 2014 +0200
https://developer.blender.org/rBc75261c8cba75ac3f4313834e9aae91378cbfc33

Fix T40331: Incorrect display of path of editted data.

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

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

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

diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c
index a00aac1..5fcceb2 100644
--- a/source/blender/editors/space_buttons/buttons_context.c
+++ b/source/blender/editors/space_buttons/buttons_context.c
@@ -236,7 +236,7 @@ static int buttons_context_path_modifier(ButsContextPath *path)
 	return 0;
 }
 
-static int buttons_context_path_material(ButsContextPath *path, int for_texture)
+static int buttons_context_path_material(ButsContextPath *path, bool for_texture, bool new_shading)
 {
 	Object *ob;
 	PointerRNA *ptr = &path->ptr[path->len - 1];
@@ -257,11 +257,14 @@ static int buttons_context_path_material(ButsContextPath *path, int for_texture)
 
 			if (for_texture && give_current_material_texture_node(ma))
 				return 1;
-			
-			ma = give_node_material(ma);
-			if (ma) {
-				RNA_id_pointer_create(&ma->id, &path->ptr[path->len]);
-				path->len++;
+
+			if (!new_shading) {
+				/* Only try to get mat from node in case of old shading system (see T40331). */
+				ma = give_node_material(ma);
+				if (ma) {
+					RNA_id_pointer_create(&ma->id, &path->ptr[path->len]);
+					path->len++;
+				}
 			}
 			return 1;
 		}
@@ -411,7 +414,7 @@ static int buttons_context_path_texture(ButsContextPath *path, ButsContextTextur
 			if (GS(id->name) == ID_BR)
 				buttons_context_path_brush(path);
 			else if (GS(id->name) == ID_MA)
-				buttons_context_path_material(path, 0);
+				buttons_context_path_material(path, false, true);
 			else if (GS(id->name) == ID_WO)
 				buttons_context_path_world(path);
 			else if (GS(id->name) == ID_LA)
@@ -480,7 +483,7 @@ static int buttons_context_path_texture(ButsContextPath *path, ButsContextTextur
 			}
 		}
 		/* try material */
-		else if ((path->tex_ctx == SB_TEXC_MATERIAL) && buttons_context_path_material(path, 1)) {
+		else if ((path->tex_ctx == SB_TEXC_MATERIAL) && buttons_context_path_material(path, true, false)) {
 			ma = path->ptr[path->len - 1].data;
 
 			if (ma) {
@@ -609,7 +612,7 @@ static int buttons_context_path(const bContext *C, ButsContextPath *path, int ma
 			found = buttons_context_path_particle(path);
 			break;
 		case BCONTEXT_MATERIAL:
-			found = buttons_context_path_material(path, 0);
+			found = buttons_context_path_material(path, false, (sbuts->texuser != NULL));
 			break;
 		case BCONTEXT_TEXTURE:
 			found = buttons_context_path_texture(path, sbuts->texuser);




More information about the Bf-blender-cvs mailing list