bitplane wrote:Sounds like you've found a bug, removing the mesh should work. We only added removeUnusedMeshes for people who have a huge scene and wanted to clear down their cache (it removes all meshes with a reference count of 1, ie, those which belong only to the mesh cache).
If the size of the mesh cache doesn't change after doing
The problem is that it compares an IMesh* to the first frame of an SAnimatedMesh so it never removes the mesh, the address of the IMesh* and the pointer to the first frame of the SAnimatedMesh seems to be different. Does the mesh cache only contain SAnimatedMesh meshes?
No, the mesh cache can also contain other types of animated meshes.
I guess that this wrong usage anyway, trying to remove a mesh from the mesh cache but actually using the pointer to animMesh->getMesh(0) rather than the original animated mesh pointer. Perhaps not a bug after all, maybe a doc update is needed to prevent other people from making this mistake.
bitplane wrote:No, the mesh cache can also contain other types of animated meshes.
I guess that this wrong usage anyway, trying to remove a mesh from the mesh cache but actually using the pointer to animMesh->getMesh(0) rather than the original animated mesh pointer. Perhaps not a bug after all, maybe a doc update is needed to prevent other people from making this mistake.
So what would be proper way? If all I have is a pointer to an IMesh then I can't do ->removeMesh(imesh->getMesh(0)); because that function is only for SAnimatedMesh. Does CMeshCache not contain SMesh meshes?
I would have to recast based on mesh type, right?