Assimp v5.2.2 (January 2022)
The Asset-Importer-Lib API documentation.
|
Defines the C-API for the Assimp export interface. More...
Classes | |
struct | aiExportDataBlob |
Describes a blob of exported scene data. More... | |
struct | aiExportFormatDesc |
Describes an file format which Assimp can export to. More... | |
Macros | |
#define | AI_EXPORT_H_INC |
Functions | |
ASSIMP_API void | aiCopyScene (const C_STRUCT aiScene *pIn, C_STRUCT aiScene **pOut) |
Create a modifiable copy of a scene. More... | |
ASSIMP_API aiReturn | aiExportScene (const C_STRUCT aiScene *pScene, const char *pFormatId, const char *pFileName, unsigned int pPreprocessing) |
Exports the given scene to a chosen file format and writes the result file(s) to disk. More... | |
ASSIMP_API aiReturn | aiExportSceneEx (const C_STRUCT aiScene *pScene, const char *pFormatId, const char *pFileName, C_STRUCT aiFileIO *pIO, unsigned int pPreprocessing) |
Exports the given scene to a chosen file format using custom IO logic supplied by you. More... | |
ASSIMP_API const C_STRUCT aiExportDataBlob * | aiExportSceneToBlob (const C_STRUCT aiScene *pScene, const char *pFormatId, unsigned int pPreprocessing) |
Exports the given scene to a chosen file format. More... | |
ASSIMP_API void | aiFreeScene (const C_STRUCT aiScene *pIn) |
Frees a scene copy created using aiCopyScene() More... | |
ASSIMP_API size_t | aiGetExportFormatCount (void) |
Returns the number of export file formats available in the current Assimp build. More... | |
ASSIMP_API const C_STRUCT aiExportFormatDesc * | aiGetExportFormatDescription (size_t pIndex) |
Returns a description of the nth export file format. More... | |
ASSIMP_API void | aiReleaseExportBlob (const C_STRUCT aiExportDataBlob *pData) |
Releases the memory associated with the given exported data. More... | |
ASSIMP_API void | aiReleaseExportFormatDescription (const C_STRUCT aiExportFormatDesc *desc) |
Release a description of the nth export file format. More... | |
Defines the C-API for the Assimp export interface.
#define AI_EXPORT_H_INC |
ASSIMP_API void aiCopyScene | ( | const C_STRUCT aiScene * | pIn, |
C_STRUCT aiScene ** | pOut | ||
) |
Create a modifiable copy of a scene.
This is useful to import files via Assimp, change their topology and export them again. Since the scene returned by the various importer functions is const, a modifiable copy is needed.
pIn | Valid scene to be copied |
pOut | Receives a modifiable copy of the scene. Use aiFreeScene() to delete it again. |
ASSIMP_API aiReturn aiExportScene | ( | const C_STRUCT aiScene * | pScene, |
const char * | pFormatId, | ||
const char * | pFileName, | ||
unsigned int | pPreprocessing | ||
) |
Exports the given scene to a chosen file format and writes the result file(s) to disk.
pScene | The scene to export. Stays in possession of the caller, is not changed by the function. The scene is expected to conform to Assimp's Importer output format as specified in the Data Structures Page . In short, this means the model data should use a right-handed coordinate systems, face winding should be counter-clockwise and the UV coordinate origin is assumed to be in the upper left. If your input data uses different conventions, have a look at the last parameter. |
pFormatId | ID string to specify to which format you want to export to. Use aiGetExportFormatCount() / aiGetExportFormatDescription() to learn which export formats are available. |
pFileName | Output file to write |
pPreprocessing | Accepts any choice of the aiPostProcessSteps enumerated flags, but in reality only a subset of them makes sense here. Specifying 'preprocessing' flags is useful if the input scene does not conform to Assimp's default conventions as specified in the Data Structures Page . In short, this means the geometry data should use a right-handed coordinate systems, face winding should be counter-clockwise and the UV coordinate origin is assumed to be in the upper left. The aiProcess_MakeLeftHanded, aiProcess_FlipUVs and aiProcess_FlipWindingOrder flags are used in the import side to allow users to have those defaults automatically adapted to their conventions. Specifying those flags for exporting has the opposite effect, respectively. Some other of the aiPostProcessSteps enumerated values may be useful as well, but you'll need to try out what their effect on the exported file is. Many formats impose their own restrictions on the structure of the geometry stored therein, so some preprocessing may have little or no effect at all, or may be redundant as exporters would apply them anyhow. A good example is triangulation - whilst you can enforce it by specifying the aiProcess_Triangulate flag, most export formats support only triangulate data so they would run the step anyway. |
If assimp detects that the input scene was directly taken from the importer side of the library (i.e. not copied using aiCopyScene and potentially modified afterwards), any post-processing steps already applied to the scene will not be applied again, unless they show non-idempotent behavior (aiProcess_MakeLeftHanded, aiProcess_FlipUVs and aiProcess_FlipWindingOrder).
ASSIMP_API aiReturn aiExportSceneEx | ( | const C_STRUCT aiScene * | pScene, |
const char * | pFormatId, | ||
const char * | pFileName, | ||
C_STRUCT aiFileIO * | pIO, | ||
unsigned int | pPreprocessing | ||
) |
Exports the given scene to a chosen file format using custom IO logic supplied by you.
pScene | The scene to export. Stays in possession of the caller, is not changed by the function. |
pFormatId | ID string to specify to which format you want to export to. Use aiGetExportFormatCount() / aiGetExportFormatDescription() to learn which export formats are available. |
pFileName | Output file to write |
pIO | custom IO implementation to be used. Use this if you use your own storage methods. If none is supplied, a default implementation using standard file IO is used. Note that aiExportSceneToBlob is provided as convenience function to export to memory buffers. |
pPreprocessing | Please see the documentation for aiExportScene |
ASSIMP_API const C_STRUCT aiExportDataBlob * aiExportSceneToBlob | ( | const C_STRUCT aiScene * | pScene, |
const char * | pFormatId, | ||
unsigned int | pPreprocessing | ||
) |
Exports the given scene to a chosen file format.
Returns the exported data as a binary blob which you can write into a file or something. When you're done with the data, use aiReleaseExportBlob() to free the resources associated with the export.
pScene | The scene to export. Stays in possession of the caller, is not changed by the function. |
pFormatId | ID string to specify to which format you want to export to. Use aiGetExportFormatCount() / aiGetExportFormatDescription() to learn which export formats are available. |
pPreprocessing | Please see the documentation for aiExportScene |
ASSIMP_API void aiFreeScene | ( | const C_STRUCT aiScene * | pIn | ) |
Frees a scene copy created using aiCopyScene()
ASSIMP_API size_t aiGetExportFormatCount | ( | void | ) |
Returns the number of export file formats available in the current Assimp build.
Use aiGetExportFormatDescription() to retrieve infos of a specific export format.
ASSIMP_API const C_STRUCT aiExportFormatDesc * aiGetExportFormatDescription | ( | size_t | pIndex | ) |
Returns a description of the nth export file format.
Use aiGetExportFormatCount() to learn how many export formats are supported. The description must be released by calling aiReleaseExportFormatDescription afterwards.
pIndex | Index of the export format to retrieve information for. Valid range is 0 to aiGetExportFormatCount() |
ASSIMP_API void aiReleaseExportBlob | ( | const C_STRUCT aiExportDataBlob * | pData | ) |
Releases the memory associated with the given exported data.
Use this function to free a data blob returned by aiExportScene().
pData | the data blob returned by aiExportSceneToBlob |
ASSIMP_API void aiReleaseExportFormatDescription | ( | const C_STRUCT aiExportFormatDesc * | desc | ) |
Release a description of the nth export file format.
Must be returned by aiGetExportFormatDescription
desc | Pointer to the description |