diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2010-06-03 19:06:23 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2010-06-03 19:06:23 +0400 |
commit | 052cc71c4011adff7c748f283fe0d6b70ebfa0fa (patch) | |
tree | ba0a337257a41fbd00b1329631e7b06441db0cae /source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp | |
parent | c0d18491b6493c55c7239eaee0ae84eea1581667 (diff) |
Fix for a crash due to materials of the wire type. Now all faces
having wire materials are simply ignored and a warning message is
displayed.
Diffstat (limited to 'source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp')
-rw-r--r-- | source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp b/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp index a4d10483238..3bf6ceb70f8 100644 --- a/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp +++ b/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp @@ -216,9 +216,14 @@ void BlenderFileLoader::insertShapeNode(ObjectInstanceRen *obi, int id) unsigned numFaces = 0; float v1[3], v2[3], v3[3], v4[3]; int clip_1[3], clip_2[3]; + int wire_material = 0; for(int a=0; a < obr->totvlak; a++) { if((a & 255)==0) vlr= obr->vlaknodes[a>>8].vlak; else vlr++; + if (vlr->mat->material_type == MA_TYPE_WIRE) { + wire_material = 1; + continue; + } copy_v3_v3(v1, vlr->v1->co); copy_v3_v3(v2, vlr->v2->co); copy_v3_v3(v3, vlr->v3->co); @@ -237,6 +242,8 @@ void BlenderFileLoader::insertShapeNode(ObjectInstanceRen *obi, int id) if (vlr->v4) numFaces += countClippedFaces(v1, v3, v4, clip_2); } + if (wire_material) + cout << "Warning: some faces have wire materials (ignored)" << endl; // cout <<"numFaces " <<numFaces<<endl; if (numFaces == 0) return; |