[Bf-blender-cvs] [ce504cf] master: Freestyle: Fix for assertion failure in viewport preview.

Tamito Kajiyama noreply at git.blender.org
Mon May 11 19:23:26 CEST 2015


Commit: ce504cffad49da80aff5b18d0f59d42998e3a9f7
Author: Tamito Kajiyama
Date:   Mon May 11 16:53:11 2015 +0900
Branches: master
https://developer.blender.org/rBce504cffad49da80aff5b18d0f59d42998e3a9f7

Freestyle: Fix for assertion failure in viewport preview.

An assertion to check if `re->clipsta` < 0 (added as part of addressing
T36009 in rBrB795034c17d76bef2a15e576ac9c70ae2268a823b) was failing when
Freestyle viewport preview rendering takes place in the camera view with
an orthographic camera (in this case, the user-defined clipping range is
used without changes, so that `re->clipsta` is positive).  The
`re->clipsta` property has a negative value only when the 3D viewport is
in an orthographic view but not in the camera view.  It seems that this
viewport setting cannot be identified from rendering settings accessible
from Freestyle.  Now a negative `re->clipsta` value is directly checked
instead, without relying on other render flags.

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

M	source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp

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

diff --git a/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp b/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp
index f5f7651..bcb38bc 100644
--- a/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp
+++ b/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp
@@ -64,12 +64,11 @@ NodeGroup *BlenderFileLoader::Load()
 	_viewplane_bottom = _re->viewplane.ymin;
 	_viewplane_top =    _re->viewplane.ymax;
 
-	if ((_re->r.scemode & R_VIEWPORT_PREVIEW) && (_re->r.mode & R_ORTHO)) {
+	if (_re->clipsta < 0.f) {
 		// Adjust clipping start/end and set up a Z offset when the viewport preview
 		// is used with the orthographic view.  In this case, _re->clipsta is negative,
 		// while Freestyle assumes that imported mesh data are in the camera coordinate
 		// system with the view point located at origin [bug #36009].
-		BLI_assert(_re->clipsta < 0.f);
 		_z_near = -0.001f;
 		_z_offset = _re->clipsta + _z_near;
 		_z_far = -_re->clipend + _z_offset;




More information about the Bf-blender-cvs mailing list