assimp icon indicating copy to clipboard operation
assimp copied to clipboard

Bug: Collada models which previously loaded in v5.0 now failed to load on v5.2, with error message

Open miker-constructive opened this issue 2 years ago • 9 comments

Describe the bug

I have several collada (.dae) models which used to load using assimp v5.0 (these are direct output from: https://www.mixamo.com/ ), without animation - just rigged models.

These models used to load fine in version 5.0 and before. However, now, in v5.2, loading fails with the error message:

Expected different index count in

element.

To Reproduce

load the model in the attachment using boilerplate code like the below:

const aiScene * scene = importer->ReadFileFromMemory(stream.data(), static_cast(stream.size()), aiProcess_TransformUVCoords | aiProcess_CalcTangentSpace | aiProcess_Triangulate | aiProcess_JoinIdenticalVertices | aiProcess_SortByPType | aiProcess_GenNormals, ext.c_str());

if (scene == nullptr) {
	LOG(info) << "Assert Importer failed to load resource " << resourceLocator << " at the in-memory stage, reporting: " <<  importer->GetErrorString();
}

where stream.data() contains the file read into memory.

observe that import->GetError() contains the string: : Expected different index count in <p> element. and that scene is NULL, indicating import failed.

Expected behavior

The scene loads normally, scene is not NULL, and no error is reported. It may well be that mixamo is producing non-compliant collada, but since this is a major source for basic animated models out there, it would be nice if this worked - I am wondering if there is a flag to turn on to do less aggressive error checking in this case?

Platform (please complete the following information): OS: Windows 10 Assimp v5.2, 64 bit, visual studio 2017

this URL provides one such non-loading model https://drive.google.com/file/d/1ocGjKIWfCLNHz6bDPugUnxjCz1phziUd/view?usp=sharing

I would have attached it, but github does not like .dae attachments

thanks! Hopefully this is a decent helpful report :)

miker-constructive avatar Jan 28 '22 23:01 miker-constructive

Pulled master, as of https://github.com/assimp/assimp/commit/6c4addf158df692642b637cb060f251f7b859764 - still there. will have a hunt for it if you guys do not get to it.

miker-constructive avatar Feb 01 '22 00:02 miker-constructive

I am pretty sure this was caused by our migration to the pugixml-lib. I need to have a look onto this issue.

kimkulling avatar Feb 04 '22 13:02 kimkulling

Thanks. I had a look in there but it had changed a lot - Deathly exceptions etc, since the last time I looked and was not sure what had really changed (there was a lot) when I used diff. Pretty much any model from mixamo will fail to load reliably, but here is a zip of a larger one which also fails: https://drive.google.com/file/d/10dM27fOF_28oHydqnbSE-14OiaLfl0PZ/view?usp=sharing

miker-constructive avatar Feb 04 '22 21:02 miker-constructive

Looked at this again today, as of https://github.com/assimp/assimp/commit/40d896ccc1b0b0ba4585ccb965c9d473b3300e6e - with latest code.

still occurs. so, I removed the failing asserts. To see what would happen. The model loaded and I could see the scene graph. However, for all meshes, this code:

aiFace * faces = inputMesh->mFaces; unsigned int numIndices = faces->mNumIndices;

reveals that numIndices is set to 0 (polygons of order 0).

The same model exported to GLTF comes in fine, with a sensible number of indices.

Clearly still an issue or issues with the collada parser.

senselevel avatar Mar 08 '22 23:03 senselevel

I had issues too with this two models, the first is twisted https://github.com/openframeworks/openFrameworks/blob/master/examples/3d/assimpExample/bin/data/astroBoy_walk.dae

and the second has zero meshes https://github.com/openframeworks/openFrameworks/blob/master/examples/3d/assimpExample/bin/data/TurbochiFromXSI.dae

I've built 5.0.1 and it works great, and from 5.1.0 I already noticed the issues

dimitre avatar May 04 '22 20:05 dimitre

so what is the progress now. i met the same problem. Maybe i can change some other version of assimp?

dandingol03 avatar May 24 '22 15:05 dandingol03

Older versions prior to the rewrite of the move to pugixml-lib seem to load collada animations just fine. Newer versions onwards from the point at which that was done still appear to have this issue. We are mainly using FBX and GLTF for assets at this point. But it would be nice if collada worked again.

miker-constructive avatar May 24 '22 16:05 miker-constructive

I am noticing this issue with both FBX and MD5Mesh/MD5Anim after my package manager upgraded Assimp. I don't believe it's specific to Collada though. I had previously been testing with the "Bob" model from the OGLDev skeletal animation tutorial here and, like @miker-constructive mentioned, anything from Mixamo seems to load incorrectly. Rolling back to version v5.0.1 appears to be the only workaround for now since all v5.1.x and v5.2.x releases appear to load animations incorrectly.

hamsham avatar Sep 05 '22 20:09 hamsham

5.0.1 isn't a panacea for this. It has it's own set of FBX/Collada related animation issues. For example this file : https://drive.google.com/file/d/1iVR_ur-fIOffLCNE7l0aoOEsgsD6zdIR/view?usp=sharing has corruption issues further down the skeleton, at least for us. Whereas it loads with other viewers. With one version of another, there are still issues (but different issues) loading FBX or Collada.

senselevel avatar Sep 06 '22 19:09 senselevel