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:
authorTon Roosendaal <ton@blender.org>2013-01-24 20:11:07 +0400
committerTon Roosendaal <ton@blender.org>2013-01-24 20:11:07 +0400
commitb12a0199480f5d452828450fa257020635f7ad6d (patch)
treee2b4537fd96bc0d89264615ec42831c1aaa5aa8b /source/blender/editors
parent1da7d7d1a0a4297cf6b09758c01f98f50543993f (diff)
Usability
- Cycles materials now render in Blender Internal too, skipping the nodes. Not very useful, but at least things then show up on renders and in previews. - Node editor: if wrong shader nodes are in a tree, they draw with thene color RED ALERT headers now. (Switching render engine will show it).
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/space_node/node_draw.c16
-rw-r--r--source/blender/editors/space_node/node_edit.c6
2 files changed, 22 insertions, 0 deletions
diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c
index 5efb43be29c..6477d39e19b 100644
--- a/source/blender/editors/space_node/node_draw.c
+++ b/source/blender/editors/space_node/node_draw.c
@@ -701,6 +701,20 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
if (node->flag & NODE_MUTED)
UI_ThemeColorBlend(color_id, TH_REDALERT, 0.5f);
+
+ /* debug info: using wrong shaders in wrong context */
+ if (ntree->type == NTREE_SHADER) {
+ if (snode->flag & SNODE_NEW_SHADERS) {
+ if (node->typeinfo->compatibility == NODE_OLD_SHADING)
+ UI_ThemeColor(TH_REDALERT);
+ }
+ else {
+ if (node->typeinfo->compatibility == NODE_NEW_SHADING)
+ UI_ThemeColor(TH_REDALERT);
+ }
+ }
+
+
#ifdef WITH_COMPOSITOR
if (ntree->type == NTREE_COMPOSIT && (snode->flag & SNODE_SHOW_HIGHLIGHT)) {
@@ -795,6 +809,7 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
/* outline active and selected emphasis */
if (node->flag & SELECT) {
+
glEnable(GL_BLEND);
glEnable(GL_LINE_SMOOTH);
@@ -802,6 +817,7 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
UI_ThemeColorShadeAlpha(TH_ACTIVE, 0, -40);
else
UI_ThemeColorShadeAlpha(TH_SELECT, 0, -40);
+
uiSetRoundBox(UI_CNR_ALL);
uiDrawBox(GL_LINE_LOOP, rct->xmin, rct->ymin, rct->xmax, rct->ymax, BASIS_RAD);
diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c
index ae95d9ae074..2fae92d674c 100644
--- a/source/blender/editors/space_node/node_edit.c
+++ b/source/blender/editors/space_node/node_edit.c
@@ -550,6 +550,12 @@ void snode_set_context(SpaceNode *snode, Scene *scene)
snode->id = snode->from = NULL;
if (snode->treetype == NTREE_SHADER) {
+ /* we use this to signal warnings, when node shaders are drawn in wrong render engine */
+ if (BKE_scene_use_new_shading_nodes(scene))
+ snode->flag |= SNODE_NEW_SHADERS;
+ else
+ snode->flag &= ~SNODE_NEW_SHADERS;
+
/* need active object, or we allow pinning... */
if (snode->shaderfrom == SNODE_SHADER_OBJECT) {
if (ob) {