Browse Source

Fix null access on some models computing logicNormal buffer.

clementlandrin 2 years ago
parent
commit
58ee4b19c5
1 changed files with 5 additions and 1 deletions
  1. 5 1
      hxd/fmt/fbx/HMDOut.hx

+ 5 - 1
hxd/fmt/fbx/HMDOut.hx

@@ -157,9 +157,13 @@ class HMDOut extends BaseLibrary {
 			}
 			}
 		}
 		}
 		var realIdx = new hxd.IndexBuffer();
 		var realIdx = new hxd.IndexBuffer();
-		for( idx in idx )
+		for( idx in idx ) {
+			if ( idx == null )
+				trace("Empty list of vertex indexes");
 			for( i in idx )
 			for( i in idx )
 				realIdx.push(pmap[i]);
 				realIdx.push(pmap[i]);
+		}
+			
 
 
 		var poly = new h3d.prim.Polygon(points, realIdx);
 		var poly = new h3d.prim.Polygon(points, realIdx);
 		poly.addNormals();
 		poly.addNormals();