Question

How can I load a mesh in Assimp, edit the vertices, and then let assimp recalculate the vertices and do other postprocessing?

The importer can import scenes and supports some flags, amongst them a flag to generate normals. However, after I load the mesh, I edit the mesh a bit (add some wrinkles, nothing really special) and would like to recalculate the normals of the mesh, using Assimp. However, I can't put a mesh back into Assimp. As far as I can tell, only the importer can apply postprocessing and I can't add meshes to the importer, and there are no functions to postprocesses in-memory meshes.

How can I apply Assimp's postprocessing to vertex data I generated in my program?

Was it helpful?

Solution

I am not sure if this function was available at the time you asked the question, but at this time you can find the following references in the assimp documentation:

Assimp::Importer Class Reference

const aiScene * ApplyPostProcessing (unsigned int pFlags)
// Apply post-processing to an already-imported scene.

There is also a C-API style function in cimport.h

cimport.h File Reference

ASSIMP_API const aiScene * aiApplyPostProcessing (const aiScene *pScene, unsigned int pFlags)
//Apply post-processing to an already-imported scene. 
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top