Reputation: 2682
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?
Upvotes: 2
Views: 1284
Reputation: 3466
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:
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
ASSIMP_API const aiScene * aiApplyPostProcessing (const aiScene *pScene, unsigned int pFlags)
//Apply post-processing to an already-imported scene.
Upvotes: 1