Assimp
v3.1.1 (June 2014)
|
The C-style interface to the Open Asset import library. More...
Functions | |
aiScene * | function (char *pFile, uint pFlags, aiFileIO *pFS) aiImportFileEx |
Reads the given file using user-defined I/O functions and returns its content. More... | |
aiScene * | function (char *pBuffer, uint pLength, uint pFlags, char *pHint) aiImportFileFromMemory |
Reads the scene from the given memory buffer. More... | |
aiScene * | function (aiScene *pScene, uint pFlags) aiApplyPostProcessing |
Apply post-processing to an already-imported scene. More... | |
aiLogStream | function (aiDefaultLogStream pStreams, char *file) aiGetPredefinedLogStream |
Get one of the predefined log streams. More... | |
void | function (aiLogStream *stream) aiAttachLogStream |
Attach a custom log stream to the libraries' logging system. More... | |
void | function (aiBool d) aiEnableVerboseLogging |
Enable verbose logging. More... | |
void | function () aiDetachAllLogStreams |
Detach all active log streams from the libraries' logging system. More... | |
void | function (aiScene *pScene) aiReleaseImport |
Releases all resources associated with the given import process. More... | |
aiBool | function (char *szExtension) aiIsExtensionSupported |
Returns whether a given file extension is supported by this Assimp build. More... | |
void | function (aiString *szOut) aiGetExtensionList |
Gets a list of all file extensions supported by ASSIMP. More... | |
void | function (aiScene *pIn, aiMemoryInfo *info) aiGetMemoryRequirements |
Gets the storage required by an imported asset. More... | |
void | function (char *szName, int value) aiSetImportPropertyInteger |
Sets an integer property. More... | |
void | function (char *szName, float value) aiSetImportPropertyFloat |
Sets a floating-point property. More... | |
void | function (char *szName, aiString *st) aiSetImportPropertyString |
Sets a string property. More... | |
void | function (aiQuaternion *quat, aiMatrix3x3 *mat) aiCreateQuaternionFromMatrix |
Constructs a quaternion from a 3x3 rotation matrix. More... | |
void | function (aiMatrix4x4 *mat, aiVector3D *scaling, aiQuaternion *rotation, aiVector3D *position) aiDecomposeMatrix |
Decomposes a transformation matrix into its rotational, translational and scaling components. More... | |
void | function (aiMatrix4x4 *mat) aiTransposeMatrix4 |
Transposes a 4x4 matrix (in-place). More... | |
void | function (aiMatrix3x3 *mat) aiTransposeMatrix3 |
Transposes a 3x3 matrix (in-place). More... | |
void | function (aiVector3D *vec, aiMatrix3x3 *mat) aiTransformVecByMatrix3 |
Transforms a vector by a 3x3 matrix (in-place). More... | |
void | function (aiVector3D *vec, aiMatrix4x4 *mat) aiTransformVecByMatrix4 |
Transforms a vector by a 4x4 matrix (in-place). More... | |
void | function (aiMatrix4x4 *dst, aiMatrix4x4 *src) aiMultiplyMatrix4 |
Multiplies two 4x4 matrices. More... | |
void | function (aiMatrix3x3 *dst, aiMatrix3x3 *src) aiMultiplyMatrix3 |
Multiplies two 3x3 matrices. More... | |
aiReturn | function (aiMaterial *pMat, char *pKey, uint type, uint index, aiMaterialProperty **pPropOut) aiGetMaterialProperty |
Retrieves a material property with a specific key from the material. More... | |
aiReturn | function (aiMaterial *pMat, char *pKey, uint type, uint index, float *pOut, uint *pMax=null) aiGetMaterialFloatArray |
Retrieves a single float value or an array of float values from the material. More... | |
aiReturn | function (aiMaterial *pMat, char *pKey, uint type, uint index, int *pOut, uint *pMax=null) aiGetMaterialIntegerArray |
Retrieves a single integer value or an array of integer values from the material. More... | |
aiReturn | function (aiMaterial *pMat, char *pKey, uint type, uint index, aiColor4D *pOut) aiGetMaterialColor |
Retrieves a color value from the material. More... | |
aiReturn | function (aiMaterial *pMat, char *pKey, uint type, uint index, aiString *pOut) aiGetMaterialString |
Retrieves a string value from the material. More... | |
uint | function (aiMaterial *pMat, aiTextureType type) aiGetMaterialTextureCount |
Get the number of textures for a particular texture type. More... | |
aiReturn | function (aiMaterial *mat, aiTextureType type, uint index, aiString *path, aiTextureMapping *mapping=null, uint *uvindex=null, float *blend=null, aiTextureOp *op=null, aiTextureMapMode *mapmode=null) aiGetMaterialTexture |
Helper function to get all values pertaining to a particular texture slot from a material structure. More... | |
Variables | |
alias aiGetMaterialFloatArray | aiGetMaterialFloat |
Convenience alias for aiGetMaterialFloatArray() . More... | |
alias aiGetMaterialIntegerArray | aiGetMaterialInteger |
Convenience alias for aiGetMaterialIntegerArray() . More... | |
C | |
The C-style interface to the Open Asset import library.
All functions of the C API have been collected in this module as function pointers, which are set by the dynamic library loader (assimp.loader
).
Reads the given file using user-defined I/O functions and returns its content.
If the call succeeds, the imported data is returned in an aiScene
structure. The data is intended to be read-only, it stays property of the Assimp library and will be stable until aiReleaseImport()
is called. After you're done with it, call aiReleaseImport()
to free the resources associated with this file.
If an error is encountered, null is returned instead. Call aiGetErrorString()
to retrieve a human-readable error description.
Params: pFile = Path and filename of the file to be imported, expected to be a null-terminated C-string. null is not a valid value. pFlags = Optional post processing steps to be executed after a successful import. Provide a bitwise combination of the aiPostProcessSteps
flags. If you wish to inspect the imported scene first in order to fine-tune your post-processing setup, consider to use aiApplyPostProcessing()
. pFS = An aiFileIO which will be used to open the model file itself and any other files the loader needs to open.
Returns: A pointer to the imported data, null if the import failed.
aiScene* assimp::api::function | ( | char * | pBuffer, |
uint | pLength, | ||
uint | pFlags, | ||
char * | pHint | ||
) |
Reads the scene from the given memory buffer.
Reads the given file using user-defined I/O functions and returns its content.
If the call succeeds, the imported data is returned in an aiScene
structure. The data is intended to be read-only, it stays property of the Assimp library and will be stable until aiReleaseImport()
is called. After you're done with it, call aiReleaseImport()
to free the resources associated with this file.
If an error is encountered, null is returned instead. Call aiGetErrorString()
to retrieve a human-readable error description.
Params: pBuffer = Pointer to the scene data. pLength = Size of pBuffer in bytes. pFlags = Optional post processing steps to be executed after a successful import. Provide a bitwise combination of the aiPostProcessSteps
flags. If you wish to inspect the imported scene first in order to fine-tune your post-processing setup, consider to use aiApplyPostProcessing()
. pHint = An additional hint to the library. If this is a non empty string, the library looks for a loader to support the file extension specified and passes the file to the first matching loader. If this loader is unable to complete the request, the library continues and tries to determine the file format on its own, a task that may or may not be successful.
Returns: A pointer to the imported data, null if the import failed.
Note: This is a straightforward way to decode models from memory buffers, but it doesn't handle model formats spreading their data across multiple files or even directories. Examples include OBJ or MD3, which outsource parts of their material stuff into external scripts. If you need the full functionality, provide a custom IOSystem to make Assimp find these files.
Apply post-processing to an already-imported scene.
This is strictly equivalent to calling aiImportFile()
or aiImportFileEx()
with the same flags. However, you can use this separate function to inspect the imported scene first to fine-tune your post-processing setup.
Params: pScene = Scene to work on. pFlags = Provide a bitwise combination of the aiPostProcessSteps
flags.
Returns: A pointer to the post-processed data. Post processing is done in-place, meaning this is still the same aiScene
which you passed for pScene. However, if post-processing failed, the scene could now be null. That's quite a rare case, post processing steps are not really designed to fail. To be exact, aiProcess.ValidateDS
is currently the only post processing step which can actually cause the scene to be reset to null.
aiLogStream assimp::api::function | ( | aiDefaultLogStream | pStreams, |
char * | file | ||
) |
Get one of the predefined log streams.
This is the quick'n'easy solution to access Assimp's log system. Attaching a log stream can slightly reduce Assimp's overall import performance.
aiLogStream stream = aiGetPredefinedLogStream( aiDefaultLogStream.FILE, "assimp.log.txt" ); if ( stream.callback !is null ) { aiAttachLogStream( &stream );
Params: pStreams = The log stream destination. file = Solely for the aiDefaultLogStream.FILE
flag: specifies the file to write to. Pass null for all other flags.
Returns: The log stream, null if something went wrong.
aiReturn assimp::api::function | ( | aiLogStream * | stream | ) |
Attach a custom log stream to the libraries' logging system.
Detach a custom log stream from the libraries' logging system.
Attaching a log stream can slightly reduce Assimp's overall import performance. Multiple log-streams can be attached.
Params: stream = Describes the new log stream.
Note: To ensure proper destruction of the logging system, you need to manually call aiDetachLogStream()
on every single log stream you attach. Alternatively, aiDetachAllLogStreams()
is provided.
This is the counterpart of #aiAttachPredefinedLogStream. If you attached a stream, don't forget to detach it again.
Params: stream = The log stream to be detached.
Returns: aiReturn.SUCCESS
if the log stream has been detached successfully.
See: aiDetachAllLogStreams
void assimp::api::function | ( | aiBool | d | ) |
Enable verbose logging.
Verbose logging includes debug-related stuff and detailed import statistics. This can have severe impact on import performance and memory consumption. However, it might be useful to find out why a file is not read correctly.
Param: d = Whether verbose logging should be enabled.
uint assimp::api::function | ( | ) |
Detach all active log streams from the libraries' logging system.
Returns the flags Assimp was compiled with.
Returns the repository revision of the Assimp library.
Returns the current major version number of the Assimp library.
Returns the current minor version number of the Assimp library.
Returns a string with legal copyright and licensing information about Assimp.
Returns the error text of the last failed import process.
This ensures that the logging system is terminated properly and all resources allocated by it are actually freed. If you attached a stream, don't forget to detach it again.
See: aiAttachLogStream
, aiDetachLogStream
Returns: A textual description of the error that occurred at the last importing process. null if there was no error. There can't be an error if you got a non-null aiScene
from aiImportFile()/aiImportFileEx()/aiApplyPostProcessing()
.
The string may include multiple lines.
Returns: Pointer to static string.
Returns: Minor version of the Assimp library.
Returns: Major version of the Assimp library.
Returns: SVN Repository revision number of the Assimp library.
Returns: Any bitwise combination of the ASSIMP_CFLAGS_xxx constants.
void assimp::api::function | ( | aiScene * | pScene | ) |
Releases all resources associated with the given import process.
Call this function after you're done with the imported data.
Params: pScene = The imported data to release. null is a valid value.
aiBool assimp::api::function | ( | char * | szExtension | ) |
Returns whether a given file extension is supported by this Assimp build.
Params: szExtension = Extension for which to query support. Must include a leading dot '.'. Example: ".3ds", ".md3"
Returns: TRUE
if the file extension is supported.
void assimp::api::function | ( | aiString * | szOut | ) |
Gets a list of all file extensions supported by ASSIMP.
Format of the list: "*.3ds;*.obj;*.dae".
If a file extension is contained in the list this does, of course, not mean that Assimp is able to load all files with this extension.
Params: szOut = String to receive the extension list. null is not a valid parameter.
void assimp::api::function | ( | aiScene * | pIn, |
aiMemoryInfo * | info | ||
) |
Gets the storage required by an imported asset.
Params: pIn = Asset to query storage size for. info = Data structure to be filled.
void assimp::api::function | ( | char * | szName, |
int | value | ||
) |
Sets an integer property.
Properties are always shared by all imports. It is not possible to specify them per import.
Params: szName = Name of the configuration property to be set. All supported public properties are defined in the config
module. value = New value for the property.
void assimp::api::function | ( | char * | szName, |
float | value | ||
) |
Sets a floating-point property.
Properties are always shared by all imports. It is not possible to specify them per import.
Params: szName = Name of the configuration property to be set. All supported public properties are defined in the config
module. value = New value for the property.
void assimp::api::function | ( | char * | szName, |
aiString * | st | ||
) |
Sets a string property.
Properties are always shared by all imports. It is not possible to specify them per import.
Params: szName = Name of the configuration property to be set. All supported public properties are defined in the config
module. st = New value for the property.
void assimp::api::function | ( | aiQuaternion * | quat, |
aiMatrix3x3 * | mat | ||
) |
Constructs a quaternion from a 3x3 rotation matrix.
Params: quat = Receives the output quaternion. mat = Matrix to 'quaternionize'.
void assimp::api::function | ( | aiMatrix4x4 * | mat, |
aiVector3D * | scaling, | ||
aiQuaternion * | rotation, | ||
aiVector3D * | position | ||
) |
Decomposes a transformation matrix into its rotational, translational and scaling components.
Params: mat = Matrix to decompose. scaling = Receives the scaling component. rotation = Receives the rotational component. position = Receives the translational component.
void assimp::api::function | ( | aiMatrix4x4 * | mat | ) |
Transposes a 4x4 matrix (in-place).
Constructs a 4x4 identity matrix.
Params: mat = The matrix to be transposed.
Params: mat = Matrix to receive its personal identity.
void assimp::api::function | ( | aiMatrix3x3 * | mat | ) |
Transposes a 3x3 matrix (in-place).
Constructs a 3x3 identity matrix.
Params: mat = The matrix to be transposed.
Params: mat = Matrix to receive its personal identity.
void assimp::api::function | ( | aiVector3D * | vec, |
aiMatrix3x3 * | mat | ||
) |
Transforms a vector by a 3x3 matrix (in-place).
Params: vec = Vector to be transformed. mat = Matrix to transform the vector with.
void assimp::api::function | ( | aiVector3D * | vec, |
aiMatrix4x4 * | mat | ||
) |
Transforms a vector by a 4x4 matrix (in-place).
Params: vec = Vector to be transformed. mat = Matrix to transform the vector with.
void assimp::api::function | ( | aiMatrix4x4 * | dst, |
aiMatrix4x4 * | src | ||
) |
Multiplies two 4x4 matrices.
Params: dst = First factor, receives result. src = Matrix to be multiplied with 'dst'.
void assimp::api::function | ( | aiMatrix3x3 * | dst, |
aiMatrix3x3 * | src | ||
) |
Multiplies two 3x3 matrices.
Params: dst = First factor, receives result. src = Matrix to be multiplied with 'dst'.
aiReturn assimp::api::function | ( | aiMaterial * | pMat, |
char * | pKey, | ||
uint | type, | ||
uint | index, | ||
aiMaterialProperty ** | pPropOut | ||
) |
Retrieves a material property with a specific key from the material.
Params: pMat = Pointer to the input material. May not be null. pKey = Key to search for. One of the AI_MATKEY_XXX
constants. type = Specifies the aiTextureType
of the texture to be retrieved, 0 for non-texture properties. index = Index of the texture to be retrieved, 0 for non-texture properties. pPropOut = Pointer to receive a pointer to a valid aiMaterialProperty
structure or null if the key has not been found.
aiReturn assimp::api::function | ( | aiMaterial * | pMat, |
char * | pKey, | ||
uint | type, | ||
uint | index, | ||
float * | pOut, | ||
uint * | pMax = null |
||
) |
Retrieves a single float value or an array of float values from the material.
const FLOATS_IN_UV_TRANSFORM = ( aiUVTransform.sizeof / float.sizeof ); uint valuesRead = FLOATS_IN_UV_TRANSFORM; bool success = ( aiGetMaterialFloatArray( &material, AI_MATKEY_UVTRANSFORM, aiTextureType.DIFFUSE, 0, cast( float* ) &trafo, &valuesRead ) == aiReturn.SUCCESS ) &&
Params: pMat = Pointer to the input material. May not be null. pKey = Key to search for. One of the AI_MATKEY_XXX constants. type = Specifies the aiTextureType
of the texture to be retrieved, 0 for non-texture properties. index = Index of the texture to be retrieved, 0 for non-texture properties. pOut = Pointer to a buffer to receive the result. pMax = Specifies the size of the given buffer in floats. Receives the number of values (not bytes!) read. null to read a scalar property.
Returns: Specifies whether the key has been found. If not, the output arrays remains unmodified and pMax is set to 0.
aiReturn assimp::api::function | ( | aiMaterial * | pMat, |
char * | pKey, | ||
uint | type, | ||
uint | index, | ||
int * | pOut, | ||
uint * | pMax = null |
||
) |
Retrieves a single integer value or an array of integer values from the material.
aiReturn assimp::api::function | ( | aiMaterial * | pMat, |
char * | pKey, | ||
uint | type, | ||
uint | index, | ||
aiColor4D * | pOut | ||
) |
Retrieves a color value from the material.
aiReturn assimp::api::function | ( | aiMaterial * | pMat, |
char * | pKey, | ||
uint | type, | ||
uint | index, | ||
aiString * | pOut | ||
) |
Retrieves a string value from the material.
uint assimp::api::function | ( | aiMaterial * | pMat, |
aiTextureType | type | ||
) |
Get the number of textures for a particular texture type.
Params: pMat = Pointer to the input material. May not be NULL type = Texture type to check for
Returns: Number of textures for this type.
aiReturn assimp::api::function | ( | aiMaterial * | mat, |
aiTextureType | type, | ||
uint | index, | ||
aiString * | path, | ||
aiTextureMapping * | mapping = null , |
||
uint * | uvindex = null , |
||
float * | blend = null , |
||
aiTextureOp * | op = null , |
||
aiTextureMapMode * | mapmode = null |
||
) |
Helper function to get all values pertaining to a particular texture slot from a material structure.
This function is provided just for convenience. You could also read the texture by parsing all of its properties manually. This function bundles all of them in a huge function monster.
Params: mat = Pointer to the input material. May not be null. type = Specifies the texture stack (aiTextureType
) to read from. index = Index of the texture. The function fails if the requested index is not available for this texture type. aiGetMaterialTextureCount()
can be used to determine the number of textures in a particular texture stack. path = Receives the output path. null is not a valid value. mapping = Receives the texture mapping mode to be used. Pass null if you are not interested in this information. uvindex = For UV-mapped textures: receives the index of the UV source channel. Unmodified otherwise. Pass null if you are not interested in this information. blend = Receives the blend factor for the texture. Pass null if you are not interested in this information. op = Receives the texture blend operation to be perform between this texture and the previous texture. Pass null if you are not interested in this information. mapmode = Receives the mapping modes to be used for the texture. Pass a pointer to an array of two aiTextureMapMode's (one for each axis, UV order) or null if you are not interested in this information.
Returns: aiReturn.SUCCESS
on success, otherwise something else.
alias aiGetMaterialFloatArray assimp::api::aiGetMaterialFloat |
Convenience alias for aiGetMaterialFloatArray()
.
alias aiGetMaterialIntegerArray assimp::api::aiGetMaterialInteger |
Convenience alias for aiGetMaterialIntegerArray()
.
assimp::api::C |