diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2015-05-11 10:53:11 +0300 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2015-05-11 20:18:24 +0300 |
commit | ce504cffad49da80aff5b18d0f59d42998e3a9f7 (patch) | |
tree | 95fc266b84be39d6ef936fe2177950ec626a2e79 /source/blender/freestyle | |
parent | c7bccb30bf03a0ac4d6d135f94658c93be7b7b0f (diff) |
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.
Diffstat (limited to 'source/blender/freestyle')
-rw-r--r-- | source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp b/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp index f5f76516d38..bcb38bc5971 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; |