Assimp: cexport.h File Reference

assimp - Open Asset Import Library

cexport.h File Reference

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...
 

Functions

ASSIMP_API void aiCopyScene (const aiScene *pIn, aiScene **pOut)
 Create a modifiable copy of a scene. More...
 
ASSIMP_API aiReturn aiExportScene (const 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 aiScene *pScene, const char *pFormatId, const char *pFileName, 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 aiExportDataBlobaiExportSceneToBlob (const aiScene *pScene, const char *pFormatId, unsigned int pPreprocessing)
 Exports the given scene to a chosen file format. More...
 
ASSIMP_API void aiFreeScene (const 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 aiExportFormatDescaiGetExportFormatDescription (size_t pIndex)
 Returns a description of the nth export file format. More...
 
ASSIMP_API void aiReleaseExportBlob (const aiExportDataBlob *pData)
 Releases the memory associated with the given exported data. More...
 
ASSIMP_API void aiReleaseExportFormatDescription (const aiExportFormatDesc *desc)
 Release a description of the nth export file format. More...
 

Detailed Description

Defines the C-API for the Assimp export interface.

Function Documentation

ASSIMP_API void aiCopyScene ( const aiScene pIn,
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.

Parameters
pInValid scene to be copied
pOutReceives a modifyable copy of the scene. Use aiFreeScene() to delete it again.
ASSIMP_API aiReturn aiExportScene ( const 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.

Parameters
pSceneThe 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.
pFormatIdID string to specify to which format you want to export to. Use aiGetExportFormatCount() / aiGetExportFormatDescription() to learn which export formats are available.
pFileNameOutput file to write
pPreprocessingAccepts 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 potetially modified afterwards), any postprocessing steps already applied to the scene will not be applied again, unless they show non-idempotent behaviour (aiProcess_MakeLeftHanded, aiProcess_FlipUVs and aiProcess_FlipWindingOrder).

Returns
a status code indicating the result of the export
Note
Use aiCopyScene() to get a modifiable copy of a previously imported scene.
ASSIMP_API aiReturn aiExportSceneEx ( const aiScene pScene,
const char *  pFormatId,
const char *  pFileName,
aiFileIO pIO,
unsigned int  pPreprocessing 
)

Exports the given scene to a chosen file format using custom IO logic supplied by you.

Parameters
pSceneThe scene to export. Stays in possession of the caller, is not changed by the function.
pFormatIdID string to specify to which format you want to export to. Use aiGetExportFormatCount() / aiGetExportFormatDescription() to learn which export formats are available.
pFileNameOutput file to write
pIOcustom 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.
pPreprocessingPlease see the documentation for aiExportScene
Returns
a status code indicating the result of the export
Note
Include <aiFileIO.h> for the definition of aiFileIO.
Use aiCopyScene() to get a modifiable copy of a previously imported scene.
ASSIMP_API const aiExportDataBlob* aiExportSceneToBlob ( const 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.

Parameters
pSceneThe scene to export. Stays in possession of the caller, is not changed by the function.
pFormatIdID string to specify to which format you want to export to. Use aiGetExportFormatCount() / aiGetExportFormatDescription() to learn which export formats are available.
pPreprocessingPlease see the documentation for aiExportScene
Returns
the exported data or NULL in case of error
ASSIMP_API void aiFreeScene ( const 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 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.

Parameters
pIndexIndex of the export format to retrieve information for. Valid range is 0 to aiGetExportFormatCount()
Returns
A description of that specific export format. NULL if pIndex is out of range.
ASSIMP_API void aiReleaseExportBlob ( const aiExportDataBlob pData)

Releases the memory associated with the given exported data.

Use this function to free a data blob returned by aiExportScene().

Parameters
pDatathe data blob returned by aiExportSceneToBlob
ASSIMP_API void aiReleaseExportFormatDescription ( const aiExportFormatDesc desc)

Release a description of the nth export file format.

Must be returned by aiGetExportFormatDescription

Parameters
descPointer to the description
Generated on Sun Feb 21 2016 19:42:29 for Assimp by   doxygen 1.8.11