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:
authorBastien Montagne <montagne29@wanadoo.fr>2014-05-24 18:02:10 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2014-05-24 18:02:44 +0400
commitc75261c8cba75ac3f4313834e9aae91378cbfc33 (patch)
tree0d43316c59bca6ddfcca1971c7c59b38f6a82aa4 /source/blender/editors/space_buttons
parent99075382398c449d937bc82b6de48071c333e647 (diff)
Fix T40331: Incorrect display of path of editted data.
Diffstat (limited to 'source/blender/editors/space_buttons')
-rw-r--r--source/blender/editors/space_buttons/buttons_context.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c
index a00aac12fba..5fcceb25e4e 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);