[Bf-blender-cvs] [b0df196] master: Fix T45317: Cycles material preview unnecessarily re-rendering

Sergey Sharybin noreply at git.blender.org
Tue Jul 21 11:29:39 CEST 2015


Commit: b0df19667fa30ad80631da86198710981ca03824
Author: Sergey Sharybin
Date:   Tue Jul 21 11:24:29 2015 +0200
Branches: master
https://developer.blender.org/rBb0df19667fa30ad80631da86198710981ca03824

Fix T45317: Cycles material preview unnecessarily re-rendering

The issue was caused by wrong fix for T22741 which forced redraws on any window
event, like Expose. Use proper NV_WM | ND_UNDO listener instead,

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

M	intern/cycles/render/nodes.cpp
M	source/blender/editors/space_buttons/space_buttons.c

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

diff --git a/intern/cycles/render/nodes.cpp b/intern/cycles/render/nodes.cpp
index f129654..46d5b3c 100644
--- a/intern/cycles/render/nodes.cpp
+++ b/intern/cycles/render/nodes.cpp
@@ -1406,7 +1406,6 @@ void PointDensityTextureNode::compile(SVMCompiler& compiler)
 
 void PointDensityTextureNode::compile(OSLCompiler& compiler)
 {
-	ShaderInput *vector_in = input("Vector");
 	ShaderOutput *density_out = output("Density");
 	ShaderOutput *color_out = output("Color");
 
diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c
index 6704431..e28ad68 100644
--- a/source/blender/editors/space_buttons/space_buttons.c
+++ b/source/blender/editors/space_buttons/space_buttons.c
@@ -371,9 +371,11 @@ static void buttons_area_listener(bScreen *UNUSED(sc), ScrArea *sa, wmNotifier *
 			}
 			break;
 		/* Listener for preview render, when doing an global undo. */
-		case NC_WINDOW:
-			ED_area_tag_redraw(sa);
-			sbuts->preview = 1;
+		case NC_WM:
+			if (wmn->data == ND_UNDO) {
+				ED_area_tag_redraw(sa);
+				sbuts->preview = 1;
+			}
 			break;
 #ifdef WITH_FREESTYLE
 		case NC_LINESTYLE:




More information about the Bf-blender-cvs mailing list