[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [29186] branches/soc-2008-mxcurioni/source /blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp: Fix for a crash due to materials of the wire type.

Tamito Kajiyama rd6t-kjym at asahi-net.or.jp
Thu Jun 3 17:06:23 CEST 2010


Revision: 29186
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=29186
Author:   kjym3
Date:     2010-06-03 17:06:23 +0200 (Thu, 03 Jun 2010)

Log Message:
-----------
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.

Modified Paths:
--------------
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp

Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp	2010-06-03 15:04:55 UTC (rev 29185)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp	2010-06-03 15:06:23 UTC (rev 29186)
@@ -216,9 +216,14 @@
 	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 @@
 		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;





More information about the Bf-blender-cvs mailing list