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:
authorLukas Tönne <lukas.toenne@gmail.com>2014-02-24 16:21:43 +0400
committerLukas Tönne <lukas.toenne@gmail.com>2014-02-24 16:21:43 +0400
commitb5aef37c27f5fb2a4bb4227253f81d886ddd796c (patch)
tree3d85fb50364dfc6d556070f7018dc290c46f4fca /source/blender/editors/space_node/space_node.c
parent8d023c1ad0a1ac27ecfb20c65a61394363bbbb34 (diff)
Fix T38798: Can get stuck in world nodes when switching from Cycles to
BI. The shaderfrom setting in the node editor only makes sense for "new" shading nodes (cycles), otherwise it should be ignored and default to SNODE_SHADER_OBJECT.
Diffstat (limited to 'source/blender/editors/space_node/space_node.c')
-rw-r--r--source/blender/editors/space_node/space_node.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c
index ae6e09def57..f7520d12bf6 100644
--- a/source/blender/editors/space_node/space_node.c
+++ b/source/blender/editors/space_node/space_node.c
@@ -42,6 +42,7 @@
#include "BKE_context.h"
#include "BKE_library.h"
+#include "BKE_scene.h"
#include "BKE_screen.h"
#include "BKE_node.h"
@@ -383,11 +384,12 @@ static void node_init(struct wmWindowManager *UNUSED(wm), ScrArea *UNUSED(sa))
}
-static void node_area_listener(bScreen *UNUSED(sc), ScrArea *sa, wmNotifier *wmn)
+static void node_area_listener(bScreen *sc, ScrArea *sa, wmNotifier *wmn)
{
/* note, ED_area_tag_refresh will re-execute compositor */
SpaceNode *snode = sa->spacedata.first;
- short shader_type = snode->shaderfrom;
+ /* shaderfrom is only used for new shading nodes, otherwise all shaders are from objects */
+ short shader_type = BKE_scene_use_new_shading_nodes(sc->scene) ? snode->shaderfrom : SNODE_SHADER_OBJECT;
/* preview renders */
switch (wmn->category) {