ofxAssimpModelLoader: preserve quads

I’m trying to load a mesh from Cinema4d using ofxAssimpModelLoader. It works great, except for that in this particular case I need access to the quad-faces from the original model. It seems that the loader converts it to a triangle mesh. I thought maybe that the ordering would stay consistent so that I could just merge two and two triangles but the ordering of the triangles seem pretty arbitrary. Is there a way to know which 4 and 4 vertices made up the original quads?

Trangles coloured in pairs of two (some triangles stick together in quads, others are scattered around):

Original model in C4D

inside ofxAssimpModelLoader.cpp in the load methods, line 49, try changing the flags used for loading, i guess one of the optimizations is messing up the triangles:

  
  
	unsigned int flags = aiProcessPreset_TargetRealtime_MaxQuality | aiProcess_Triangulate | aiProcess_FlipUVs;  
	if(optimize) flags |=  aiProcess_ImproveCacheLocality | aiProcess_OptimizeGraph |  
			aiProcess_OptimizeMeshes | aiProcess_JoinIdenticalVertices |  
			aiProcess_RemoveRedundantMaterials;  
  

post if you find it, it would be a good idea to add an option to disable whatever is disorganizing the vertices

Thanks for the tip! I’t seems that the flags aiProcessPreset_TargetRealtime_MaxQuality & aiProcess_JoinIdenticalVertices reorders the vertices. When I comment out the first one it works for me (the other one kicks in when optimize == true).

Add a third argument to the method called preserveVertexOrdering or similar?

i guess we can move aiProcessPreset_TargetRealtime_MaxQuality to the flags that are activated with the optimize parameter