[Bf-blender-cvs] [c8e9832] master: Fix T48320: Freestyle renders wrong edges of objects which in the other RenderLayer.

Tamito Kajiyama noreply at git.blender.org
Thu May 5 16:16:15 CEST 2016


Commit: c8e9832be3ad2a86dc035a413a5be7469685636e
Author: Tamito Kajiyama
Date:   Thu May 5 23:09:22 2016 +0900
Branches: master
https://developer.blender.org/rBc8e9832be3ad2a86dc035a413a5be7469685636e

Fix T48320: Freestyle renders wrong edges of objects which in the other RenderLayer.

FSAA sample files in EXR format are no longer always updated (after some
changes between 2.73 and 2.74 releases), and the reported bug was caused
by old samples from a previous frame that were being merged by mistake.

The present revision addresses the documented issue by entirely skipping
the rendering of auto-generated scenes when there are no Freestyle strokes
to render, which suppresses sample merging of the render layers that were
not rendered.

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

M	source/blender/freestyle/intern/application/Controller.cpp
M	source/blender/freestyle/intern/application/Controller.h
M	source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp

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

diff --git a/source/blender/freestyle/intern/application/Controller.cpp b/source/blender/freestyle/intern/application/Controller.cpp
index 136fec3..beb8579 100644
--- a/source/blender/freestyle/intern/application/Controller.cpp
+++ b/source/blender/freestyle/intern/application/Controller.cpp
@@ -864,10 +864,10 @@ bool Controller::getComputeSteerableViewMapFlag() const
 	return _ComputeSteerableViewMap;
 }
 
-void Controller::DrawStrokes()
+int Controller::DrawStrokes()
 {
 	if (_ViewMap == 0)
-		return;
+		return 0;
 
 	if (G.debug & G_DEBUG_FREESTYLE) {
 		cout << "\n===  Stroke drawing  ===" << endl;
@@ -875,12 +875,14 @@ void Controller::DrawStrokes()
 	_Chrono.start();
 	_Canvas->Draw();
 	real d = _Chrono.stop();
+	int strokeCount = _Canvas->getStrokeCount();
 	if (G.debug & G_DEBUG_FREESTYLE) {
 		cout << "Strokes generation  : " << d << endl;
-		cout << "Stroke count  : " << _Canvas->getStrokeCount() << endl;
+		cout << "Stroke count  : " << strokeCount << endl;
 	}
 	resetModified();
 	DeleteViewMap();
+	return strokeCount;
 }
 
 void Controller::ResetRenderCount()
diff --git a/source/blender/freestyle/intern/application/Controller.h b/source/blender/freestyle/intern/application/Controller.h
index 6f3cb3b..154edaf 100644
--- a/source/blender/freestyle/intern/application/Controller.h
+++ b/source/blender/freestyle/intern/application/Controller.h
@@ -75,7 +75,7 @@ public:
 	void ComputeSteerableViewMap();
 	void saveSteerableViewMapImages();
 	void toggleEdgeTesselationNature(Nature::EdgeNature iNature);
-	void DrawStrokes();
+	int DrawStrokes();
 	void ResetRenderCount();
 	Render *RenderStrokes(Render *re, bool render);
 	void SwapStyleModules(unsigned i1, unsigned i2);
diff --git a/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp b/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp
index dc88f69..4d8c6a6 100644
--- a/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp
+++ b/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp
@@ -628,15 +628,19 @@ Render *FRS_do_stroke_rendering(Render *re, SceneRenderLayer *srl, int render)
 			re->stats_draw(re->sdh, &re->i);
 			re->i.infostr = NULL;
 			g_freestyle.scene = re->scene;
-			controller->DrawStrokes();
-			freestyle_render = controller->RenderStrokes(re, true);
+			int strokeCount = controller->DrawStrokes();
+			if (strokeCount > 0) {
+				freestyle_render = controller->RenderStrokes(re, true);
+			}
 			controller->CloseFile();
 			g_freestyle.scene = NULL;
 
 			// composite result
-			FRS_composite_result(re, srl, freestyle_render);
-			RE_FreeRenderResult(freestyle_render->result);
-			freestyle_render->result = NULL;
+			if (freestyle_render) {
+				FRS_composite_result(re, srl, freestyle_render);
+				RE_FreeRenderResult(freestyle_render->result);
+				freestyle_render->result = NULL;
+			}
 		}
 	}




More information about the Bf-blender-cvs mailing list