diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2014-05-17 05:36:39 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2014-05-17 05:36:39 +0400 |
commit | 4958aff780a3ef63c9372b6111655b49ffb4a0d3 (patch) | |
tree | 022973bf2aa47ba19d62162b442c8894896ab13b /source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp | |
parent | f8554ed61a427e0407c7e6ad951ef6985a19df95 (diff) |
Freestyle: Added a piece of debug code for checking the consistency of face normals.
The code was found helpful while addressing T39669 and might help solving similar
issues related to face normals in the future.
Diffstat (limited to 'source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp')
-rw-r--r-- | source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp b/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp index a26bb0fa81e..c6041e65653 100644 --- a/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp +++ b/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp @@ -521,6 +521,14 @@ void BlenderFileLoader::insertShapeNode(ObjectInstanceRen *obi, int id) } else { RE_vlakren_get_normal(_re, obi, vlr, facenormal); + if (G.debug & G_DEBUG_FREESTYLE) { + float dist, tmpNor[3]; + normal_tri_v3(tmpNor, v3, v2, v1); /* normals are inverted in rendering */ + dist = len_v3v3(facenormal, tmpNor); + if (dist > 1.0f) { + printf("Warning: vlak %d has an incorrect normal (dist. %.3g)\n", p, dist); + } + } copy_v3_v3(n1, facenormal); copy_v3_v3(n2, facenormal); copy_v3_v3(n3, facenormal); |