Hi, I'm having trouble loading blend files and whilst stepping through the BlenderImporter code I found out why. Meshes saved from Blender 2.64 don't seem to use the "totface" field* of the Mesh DNA structure, which causes the Assimp importer to abort early (BlenderLoader.cpp:622 in BlenderImporter::ConvertMesh). Blender itself can load the mesh, so there must be a way to reconstruct it using just the vertices and edges.
This happens whether the mesh has been triangulated in Blender or not and seems to happen regardless of what import flags I pass into Assimp. It also happens in all Assimp builds including the viewer. Has the format changed recently, invalidating the Assimp loader, or am I missing something?
Example .blend file
I'm using Assimp 3.0.1270
*I've not tested this with many different meshes, just simple meshes created via the "Add->Mesh" menu and saved.
I've just seen this thread describing the same problem.
Sorry for the duplicate.
If anyone's interested, I've written a git patch for this, which converts the new Blender n-sided polygons into a format readable by the existing Assimp BlenderImporter.
You can get it here.
I've currently only tested it with vertices and normals. It may need additional work for colour and tex coord support - if they've changed in the Blender DNA. Triangulations of many sided polygons should work fine however.
You can toggle between two triangulation methods (at the top of BlenderTessellator.h): GLU Tessellate and poly2tri. By default in the patch, it's going to prefer GLU Tessellate, but you can try switching to poly2tri if you don't want to link against GLU.
Note however that the poly2tri library is 2D only and I did a filthy hack to smush the 3D polygon into 2D space in order to get at the triangulation information.
Log in to post a comment.