|
aiReturn | Export (const aiScene *pScene, const char *pFormatId, const char *pPath, unsigned int pPreprocessing=0u, const ExportProperties *pProperties=NULL) |
| Convenience function to export directly to a file. More...
|
|
aiReturn | Export (const aiScene *pScene, const std::string &pFormatId, const std::string &pPath, unsigned int pPreprocessing=0u, const ExportProperties *pProperties=NULL) |
|
| Exporter () |
|
const aiExportDataBlob * | ExportToBlob (const aiScene *pScene, const char *pFormatId, unsigned int pPreprocessing=0u, const ExportProperties *pProperties=NULL) |
| Exports the given scene to a chosen file format. More...
|
|
const aiExportDataBlob * | ExportToBlob (const aiScene *pScene, const std::string &pFormatId, unsigned int pPreprocessing=0u, const ExportProperties *pProperties=NULL) |
|
void | FreeBlob () |
| Frees the current blob. More...
|
|
const aiExportDataBlob * | GetBlob () const |
| Return the blob obtained from the last call to ExportToBlob. More...
|
|
const char * | GetErrorString () const |
| Returns an error description of an error that occurred in Export or ExportToBlob. More...
|
|
size_t | GetExportFormatCount () const |
| Returns the number of export file formats available in the current Assimp build. More...
|
|
const aiExportFormatDesc * | GetExportFormatDescription (size_t pIndex) const |
| Returns a description of the nth export file format. More...
|
|
IOSystem * | GetIOHandler () const |
| Retrieves the IO handler that is currently set. More...
|
|
const aiExportDataBlob * | GetOrphanedBlob () const |
| Orphan the blob from the last call to ExportToBlob. More...
|
|
bool | IsDefaultIOHandler () const |
| Checks whether a default IO handler is active A default handler is active as long the application doesn't supply its own custom IO handler via SetIOHandler(). More...
|
|
aiReturn | RegisterExporter (const ExportFormatEntry &desc) |
| Register a custom exporter. More...
|
|
void | SetIOHandler (IOSystem *pIOHandler) |
| Supplies a custom IO handler to the exporter to use to open and access files. More...
|
|
void | UnregisterExporter (const char *id) |
| Remove an export format previously registered with RegisterExporter from the Exporter instance (this can also be used to drop builtin exporters because those are implicitly registered using RegisterExporter). More...
|
|
| ~Exporter () |
|
aiReturn Assimp::Exporter::Export |
( |
const aiScene * |
pScene, |
|
|
const char * |
pFormatId, |
|
|
const char * |
pPath, |
|
|
unsigned int |
pPreprocessing = 0u , |
|
|
const ExportProperties * |
pProperties = NULL |
|
) |
| |
Convenience function to export directly to a file.
Use #SetIOSystem to supply a custom IOSystem to gain fine-grained control about the output data flow of the export process.
- Parameters
-
pBlob | A data blob obtained from a previous call to aiExportScene. Must not be NULL. |
pPath | Full target file name. Target must be accessible. |
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 even if it wasn't requested. |
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
- AI_SUCCESS if everything was fine.
- Note
- Use aiCopyScene() to get a modifiable copy of a previously imported scene.
void Assimp::Exporter::SetIOHandler |
( |
IOSystem * |
pIOHandler | ) |
|
Supplies a custom IO handler to the exporter to use to open and access files.
If you need Export to use custom IO logic to access the files, you need to supply a custom implementation of IOSystem and IOFile to the exporter.
Exporter takes ownership of the object and will destroy it afterwards. The previously assigned handler will be deleted. Pass NULL to take again ownership of your IOSystem and reset Assimp to use its default implementation, which uses plain file IO.
- Parameters
-
pIOHandler | The IO handler to be used in all file accesses of the Importer. |