|
@@ -56,14 +56,16 @@ extern "C" {
|
|
|
|
|
|
struct aiScene; // aiScene.h
|
|
|
|
|
|
-/** Describes an file format which Assimp can export to. Use aiGetExportFormatCount() to
|
|
|
-* learn how many export formats the current Assimp build supports and aiGetExportFormatDescription()
|
|
|
+
|
|
|
+// --------------------------------------------------------------------------------
|
|
|
+/** Describes an file format which Assimp can export to. Use #aiGetExportFormatCount() to
|
|
|
+* learn how many export formats the current Assimp build supports and #aiGetExportFormatDescription()
|
|
|
* to retrieve a description of an export format option.
|
|
|
*/
|
|
|
struct aiExportFormatDesc
|
|
|
{
|
|
|
/// a short string ID to uniquely identify the export format. Use this ID string to
|
|
|
- /// specify which file format you want to export to when calling aiExportScene().
|
|
|
+ /// specify which file format you want to export to when calling #aiExportScene().
|
|
|
/// Example: "dae" or "obj"
|
|
|
const char* id;
|
|
|
|
|
@@ -75,63 +77,33 @@ struct aiExportFormatDesc
|
|
|
const char* fileExtension;
|
|
|
};
|
|
|
|
|
|
+
|
|
|
+// --------------------------------------------------------------------------------
|
|
|
/** Returns the number of export file formats available in the current Assimp build.
|
|
|
-* Use aiGetExportFormatDescription() to retrieve infos of a specific export format.
|
|
|
-*/
|
|
|
+ * Use aiGetExportFormatDescription() to retrieve infos of a specific export format.
|
|
|
+ */
|
|
|
ASSIMP_API size_t aiGetExportFormatCount(void);
|
|
|
|
|
|
-/** Returns a description of the nth export file format. Use aiGetExportFormatCount()
|
|
|
-* to learn how many export formats are supported.
|
|
|
-* @param pIndex Index of the export format to retrieve information for. Valid range is 0 to aiGetExportFormatCount()
|
|
|
-* @return A description of that specific export format. NULL if pIndex is out of range.
|
|
|
-*/
|
|
|
-ASSIMP_API const C_STRUCT aiExportFormatDesc* aiGetExportFormatDescription( size_t pIndex);
|
|
|
-
|
|
|
-/** Describes a blob of exported scene data. Use aiExportScene() to create a blob containing an
|
|
|
-* exported scene. The memory referred by this structure is owned by Assimp. Use aiReleaseExportedFile()
|
|
|
-* to free its resources. Don't try to free the memory on your side - it will crash for most build configurations
|
|
|
-* due to conflicting heaps.
|
|
|
-*
|
|
|
-* Blobs can be nested - each blob may reference another blob, which may in turn reference another blob and so on.
|
|
|
-* This is used when exporters write more than one output file for a given #aiScene. See the remarks for
|
|
|
-* #aiExportDataBlob::name for more information.
|
|
|
-*/
|
|
|
-struct aiExportDataBlob
|
|
|
-#ifdef __cplusplus
|
|
|
- : public boost::noncopyable
|
|
|
-#endif // __cplusplus
|
|
|
-{
|
|
|
- /// Size of the data in bytes
|
|
|
- size_t size;
|
|
|
-
|
|
|
- /// The data.
|
|
|
- void* data;
|
|
|
|
|
|
- /** Name of the blob. An empty string always
|
|
|
- indicates the first (and primary) blob,
|
|
|
- which contains the actual file data.
|
|
|
- Any other blobs are auxiliary files produced
|
|
|
- by exporters (i.e. material files). Existence
|
|
|
- of such files depends on the file format. Most
|
|
|
- formats don't split assets across multiple files.
|
|
|
-
|
|
|
- If used, blob names usually contain the file
|
|
|
- extension that should be used when writing
|
|
|
- the data to disc.
|
|
|
- */
|
|
|
- aiString name;
|
|
|
-
|
|
|
- /** Pointer to the next blob in the chain or NULL if there is none. */
|
|
|
- aiExportDataBlob * next;
|
|
|
+// --------------------------------------------------------------------------------
|
|
|
+/** Returns a description of the nth export file format. Use #aiGetExportFormatCount()
|
|
|
+ * to learn how many export formats are supported.
|
|
|
+ * @param pIndex Index of the export format to retrieve information for. Valid range is
|
|
|
+ * 0 to #aiGetExportFormatCount()
|
|
|
+ * @return A description of that specific export format. NULL if pIndex is out of range.
|
|
|
+ */
|
|
|
+ASSIMP_API const C_STRUCT aiExportFormatDesc* aiGetExportFormatDescription( size_t pIndex);
|
|
|
|
|
|
-#ifdef __cplusplus
|
|
|
- /// Default constructor
|
|
|
- aiExportDataBlob() { size = 0; data = next = NULL; }
|
|
|
- /// Releases the data
|
|
|
- ~aiExportDataBlob() { delete static_cast<char*>( data ); delete next; }
|
|
|
-#endif // __cplusplus
|
|
|
-};
|
|
|
|
|
|
+// --------------------------------------------------------------------------------
|
|
|
+/** Create a modifyable 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 modifyable copy is needed.
|
|
|
+ * @param pIn Valid scene to be copied
|
|
|
+ * @param pOut User-allocated scene to be filled.
|
|
|
+ */
|
|
|
+ASSIMP_API void aiCopyScene(const C_STRUCT aiScene* pIn, C_STRUCT aiScene** pOut);
|
|
|
|
|
|
// --------------------------------------------------------------------------------
|
|
|
/** Exports the given scene to a chosen file format and writes the result file(s) to disk.
|
|
@@ -164,7 +136,7 @@ struct aiExportDataBlob
|
|
|
* 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.
|
|
|
+* triangulate data so they would run the step anyway.
|
|
|
* @return a status code indicating the result of the export
|
|
|
*/
|
|
|
ASSIMP_API aiReturn aiExportScene( const C_STRUCT aiScene* pScene, const char* pFormatId, const char* pFileName, unsigned int pPreprocessing);
|
|
@@ -184,26 +156,72 @@ ASSIMP_API aiReturn aiExportScene( const C_STRUCT aiScene* pScene, const char* p
|
|
|
*/
|
|
|
ASSIMP_API aiReturn aiExportSceneEx( const C_STRUCT aiScene* pScene, const char* pFormatId, const char* pFileName, C_STRUCT aiFileIO* pIO, unsigned int pPreprocessing );
|
|
|
|
|
|
+
|
|
|
+// --------------------------------------------------------------------------------
|
|
|
+/** Describes a blob of exported scene data. Use #aiExportSceneToBlob() to create a blob containing an
|
|
|
+* exported scene. The memory referred by this structure is owned by Assimp. Use #aiReleaseExportedFile()
|
|
|
+* to free its resources. Don't try to free the memory on your side - it will crash for most build configurations
|
|
|
+* due to conflicting heaps.
|
|
|
+*
|
|
|
+* Blobs can be nested - each blob may reference another blob, which may in turn reference another blob and so on.
|
|
|
+* This is used when exporters write more than one output file for a given #aiScene. See the remarks for
|
|
|
+* #aiExportDataBlob::name for more information.
|
|
|
+*/
|
|
|
+struct aiExportDataBlob
|
|
|
+#ifdef __cplusplus
|
|
|
+ : public boost::noncopyable
|
|
|
+#endif // __cplusplus
|
|
|
+{
|
|
|
+ /// Size of the data in bytes
|
|
|
+ size_t size;
|
|
|
+
|
|
|
+ /// The data.
|
|
|
+ void* data;
|
|
|
+
|
|
|
+ /** Name of the blob. An empty string always
|
|
|
+ indicates the first (and primary) blob,
|
|
|
+ which contains the actual file data.
|
|
|
+ Any other blobs are auxiliary files produced
|
|
|
+ by exporters (i.e. material files). Existence
|
|
|
+ of such files depends on the file format. Most
|
|
|
+ formats don't split assets across multiple files.
|
|
|
+
|
|
|
+ If used, blob names usually contain the file
|
|
|
+ extension that should be used when writing
|
|
|
+ the data to disc.
|
|
|
+ */
|
|
|
+ aiString name;
|
|
|
+
|
|
|
+ /** Pointer to the next blob in the chain or NULL if there is none. */
|
|
|
+ aiExportDataBlob * next;
|
|
|
+
|
|
|
+#ifdef __cplusplus
|
|
|
+ /// Default constructor
|
|
|
+ aiExportDataBlob() { size = 0; data = next = NULL; }
|
|
|
+ /// Releases the data
|
|
|
+ ~aiExportDataBlob() { delete static_cast<char*>( data ); delete next; }
|
|
|
+#endif // __cplusplus
|
|
|
+};
|
|
|
+
|
|
|
// --------------------------------------------------------------------------------
|
|
|
/** 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 aiReleaseExportedBlob()
|
|
|
+* 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.
|
|
|
* @param pScene The scene to export. Stays in possession of the caller, is not changed by the function.
|
|
|
* @param pFormatId ID string to specify to which format you want to export to. Use
|
|
|
-* aiGetExportFormatCount() / aiGetExportFormatDescription() to learn which export formats are available.
|
|
|
+* #aiGetExportFormatCount() / #aiGetExportFormatDescription() to learn which export formats are available.
|
|
|
* @param pPreprocessing Please see the documentation for #aiExportScene
|
|
|
* @return the exported data or NULL in case of error
|
|
|
*/
|
|
|
ASSIMP_API const C_STRUCT aiExportDataBlob* aiExportSceneToBlob( const C_STRUCT aiScene* pScene, const char* pFormatId, unsigned int pPreprocessing );
|
|
|
|
|
|
|
|
|
-
|
|
|
// --------------------------------------------------------------------------------
|
|
|
/** Releases the memory associated with the given exported data. Use this function to free a data blob
|
|
|
* returned by aiExportScene().
|
|
|
-* @param pData the data blob returned by aiExportScenetoBlob
|
|
|
+* @param pData the data blob returned by #aiExportSceneToBlob
|
|
|
*/
|
|
|
-ASSIMP_API C_STRUCT void aiReleaseExportData( const C_STRUCT aiExportDataBlob* pData );
|
|
|
+ASSIMP_API C_STRUCT void aiReleaseExportBlob( const C_STRUCT aiExportDataBlob* pData );
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
}
|