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
path: root/source
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
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')
-rw-r--r--source/blender/editors/space_node/space_node.c6
-rw-r--r--source/blender/nodes/shader/node_shader_tree.c2
2 files changed, 5 insertions, 3 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) {
diff --git a/source/blender/nodes/shader/node_shader_tree.c b/source/blender/nodes/shader/node_shader_tree.c
index 2186eb7c226..53f97e0d36c 100644
--- a/source/blender/nodes/shader/node_shader_tree.c
+++ b/source/blender/nodes/shader/node_shader_tree.c
@@ -79,7 +79,7 @@ static void shader_get_from_context(const bContext *C, bNodeTreeType *UNUSED(tre
Scene *scene = CTX_data_scene(C);
Object *ob = OBACT;
- if (snode->shaderfrom == SNODE_SHADER_OBJECT) {
+ if (!BKE_scene_use_new_shading_nodes(scene) || snode->shaderfrom == SNODE_SHADER_OBJECT) {
if (ob) {
*r_from = &ob->id;
if (ob->type == OB_LAMP) {