#include <Importer.h>
Inherits EMotionFX::BaseObject.
Classes | |
struct | ActorSettings |
struct | FileInfo |
struct | ImportParameters |
struct | MotionSetSettings |
struct | MotionSettings |
struct | NodeMapSettings |
Public Types | |
enum | EFileType { FILETYPE_UNKNOWN = 0 , FILETYPE_ACTOR , FILETYPE_MOTION , FILETYPE_ANIMGRAPH , FILETYPE_MOTIONSET , FILETYPE_NODEMAP } |
typedef bool(MCORE_CDECL * | AttributeEndianConverter) (MCore::Attribute &attribute, MCore::Endian::EEndianType sourceEndianType) |
Public Member Functions | |
AZStd::unique_ptr< Actor > | LoadActor (MCore::File *f, ActorSettings *settings=nullptr, const char *filename="") |
AZStd::unique_ptr< Actor > | LoadActor (AZStd::string filename, ActorSettings *settings=nullptr) |
AZStd::unique_ptr< Actor > | LoadActor (uint8 *memoryStart, size_t lengthInBytes, ActorSettings *settings=nullptr, const char *filename="") |
bool | ExtractActorFileInfo (FileInfo *outInfo, const char *filename) const |
Motion * | LoadMotion (MCore::File *f, MotionSettings *settings=nullptr) |
Motion * | LoadMotion (AZStd::string filename, MotionSettings *settings=nullptr) |
Motion * | LoadMotion (uint8 *memoryStart, size_t lengthInBytes, MotionSettings *settings=nullptr) |
bool | ExtractMotionFileInfo (FileInfo *outInfo, const char *filename) const |
AnimGraph * | LoadAnimGraph (AZStd::string, const AZ::ObjectStream::FilterDescriptor &loadFilter=AZ::ObjectStream::FilterDescriptor(nullptr, AZ::ObjectStream::FILTERFLAG_IGNORE_UNKNOWN_CLASSES)) |
AnimGraph * | LoadAnimGraph (uint8 *memoryStart, size_t lengthInBytes) |
MotionSet * | LoadMotionSet (AZStd::string filename, MotionSetSettings *settings=nullptr, const AZ::ObjectStream::FilterDescriptor &loadFilter=AZ::ObjectStream::FilterDescriptor(nullptr, AZ::ObjectStream::FILTERFLAG_IGNORE_UNKNOWN_CLASSES)) |
MotionSet * | LoadMotionSet (uint8 *memoryStart, size_t lengthInBytes, MotionSetSettings *settings=nullptr) |
NodeMap * | LoadNodeMap (MCore::File *f, NodeMapSettings *settings=nullptr) |
NodeMap * | LoadNodeMap (AZStd::string filename, NodeMapSettings *settings=nullptr) |
NodeMap * | LoadNodeMap (uint8 *memoryStart, size_t lengthInBytes, NodeMapSettings *settings=nullptr) |
void | RegisterChunkProcessor (ChunkProcessor *processorToRegister) |
void | SetLoggingEnabled (bool enabled) |
bool | GetLogging () const |
void | SetLogDetails (bool detailLoggingActive) |
bool | GetLogDetails () const |
EFileType | CheckFileType (const char *filename) |
EFileType | CheckFileType (MCore::File *file) |
Public Member Functions inherited from EMotionFX::BaseObject | |
BaseObject () | |
virtual | ~BaseObject () |
Public Member Functions inherited from MCore::MemoryObject | |
MemoryObject () | |
virtual | ~MemoryObject () |
void | IncreaseReferenceCount () |
void | DecreaseReferenceCount () |
void | Destroy () |
uint32 | GetReferenceCount () const |
Static Public Member Functions | |
static bool MCORE_CDECL | StandardAttributeEndianConvert (MCore::Attribute &attribute, MCore::Endian::EEndianType sourceEndianType) |
static Importer * | Create () |
static SharedData * | FindSharedData (AZStd::vector< SharedData * > *sharedDataArray, uint32 type) |
Friends | |
class | Initializer |
class | EMotionFXManager |
Additional Inherited Members | |
Protected Member Functions inherited from EMotionFX::BaseObject | |
void | Delete () override |
virtual void | Delete () |
The EMotion FX importer, used to load actors, motions, animgraphs, motion sets and node maps and other EMotion FX related files. The files can be loaded from memory or disk.
Basic usage:
EMotionFX::Actor* actor = EMotionFX::GetImporter().LoadActor("TestActor.actor"); if (actor == nullptr) MCore::LogError("Failed to load the actor.");
The same applies to other types like motions, but using the LoadMotion, LoadAnimGraph and LoadMotionSet methods.
typedef bool(MCORE_CDECL * EMotionFX::Importer::AttributeEndianConverter) (MCore::Attribute &attribute, MCore::Endian::EEndianType sourceEndianType) |
The attribute data endian conversion callback. This callback is responsible for converting the endian of the data stored inside a given attribute into the currently expected endian.
The file types. This can be used to identify the file type, with the CheckFileType methods.
EFileType EMotionFX::Importer::CheckFileType | ( | const char * | filename | ) |
Check the type of a given file on disk.
filename | The file on disk to check. |
EFileType EMotionFX::Importer::CheckFileType | ( | MCore::File * | file | ) |
Check the type of a given file (in memory or disk). The file will be closed after executing this method!
file | The file object to check. |
|
static |
Find shared data objects which have the same type as the ID passed as parameter.
sharedDataArray | The shared data array to search in. |
type | The shared data ID to search for. |
bool EMotionFX::Importer::GetLogDetails | ( | ) | const |
Check if detail-logging is enabled or not.
bool EMotionFX::Importer::GetLogging | ( | ) | const |
Check if logging is enabled or not.
AZStd::unique_ptr< Actor > EMotionFX::Importer::LoadActor | ( | AZStd::string | filename, |
ActorSettings * | settings = nullptr |
||
) |
Loads an actor from a file on disk.
filename | The name of the file on disk. |
settings | The settings to use for loading. When set to nullptr, all defaults will be used and everything will be loaded. |
AZStd::unique_ptr< Actor > EMotionFX::Importer::LoadActor | ( | MCore::File * | f, |
ActorSettings * | settings = nullptr , |
||
const char * | filename = "" |
||
) |
Load an actor from a given file. A file does not have to be stored on disk, but can also be in memory or in an archive or on some network stream. Anything is possible.
f | The file to load the actor from (after load, the file will be closed). |
settings | The settings to use for loading. When set to nullptr, all defaults will be used and everything will be loaded. |
filename | The file name to set inside the Actor object. This is not going to load the actor from the file specified to this parameter, but just updates the value returned by actor->GetFileName(). |
AZStd::unique_ptr< Actor > EMotionFX::Importer::LoadActor | ( | uint8 * | memoryStart, |
size_t | lengthInBytes, | ||
ActorSettings * | settings = nullptr , |
||
const char * | filename = "" |
||
) |
Loads an actor from memory.
memoryStart | The start address of the file in memory. |
lengthInBytes | The length of the file, in bytes. |
settings | The settings to use for loading. When set to nullptr, all defaults will be used and everything will be loaded. |
filename | The file name to set inside the Actor object. This is not going to load the actor from the file specified to this parameter, but just updates the value returned by actor->GetFileName(). |
AnimGraph * EMotionFX::Importer::LoadAnimGraph | ( | AZStd::string | , |
const AZ::ObjectStream::FilterDescriptor & | loadFilter = AZ::ObjectStream::FilterDescriptor(nullptr, AZ::ObjectStream::FILTERFLAG_IGNORE_UNKNOWN_CLASSES) |
||
) |
Load a anim graph file by filename.
filename | The filename to load from. |
loadFilter | The filter descriptor for loading anim graph from file |
AnimGraph * EMotionFX::Importer::LoadAnimGraph | ( | uint8 * | memoryStart, |
size_t | lengthInBytes | ||
) |
Load a anim graph file from a memory location.
memoryStart | The start address of the file in memory. |
lengthInBytes | The length of the file, in bytes. |
Motion * EMotionFX::Importer::LoadMotion | ( | AZStd::string | filename, |
MotionSettings * | settings = nullptr |
||
) |
Loads a motion from a file on disk.
filename | The name of the file on disk. |
settings | The settings to use during loading, or nullptr when you want to use default settings, which would load everything. |
Motion * EMotionFX::Importer::LoadMotion | ( | MCore::File * | f, |
MotionSettings * | settings = nullptr |
||
) |
Load a motion from a given file. A file does not have to be stored on disk, but can also be in memory or in an archive or on some network stream. Anything is possible.
f | The file to load the motion from (after load, the file will be closed). |
settings | The settings to use during loading, or nullptr when you want to use default settings, which would load everything. |
Motion * EMotionFX::Importer::LoadMotion | ( | uint8 * | memoryStart, |
size_t | lengthInBytes, | ||
MotionSettings * | settings = nullptr |
||
) |
Loads a motion from memory.
memoryStart | The start address of the file in memory. |
lengthInBytes | The length of the file, in bytes. |
settings | The settings to use during loading, or nullptr when you want to use default settings, which would load everything. |
MotionSet * EMotionFX::Importer::LoadMotionSet | ( | AZStd::string | filename, |
MotionSetSettings * | settings = nullptr , |
||
const AZ::ObjectStream::FilterDescriptor & | loadFilter = AZ::ObjectStream::FilterDescriptor(nullptr, AZ::ObjectStream::FILTERFLAG_IGNORE_UNKNOWN_CLASSES) |
||
) |
Loads a motion set from a file on disk.
filename | The name of the file on disk. |
settings | The motion set importer settings, or nullptr to use default settings. |
loadFilter | The filter descriptor for loading motion set from file |
MotionSet * EMotionFX::Importer::LoadMotionSet | ( | uint8 * | memoryStart, |
size_t | lengthInBytes, | ||
MotionSetSettings * | settings = nullptr |
||
) |
Loads a motion set from memory.
memoryStart | The start address of the file in memory. |
lengthInBytes | The length of the file, in bytes. |
settings | The motion set importer settings, or nullptr to use default settings. |
NodeMap * EMotionFX::Importer::LoadNodeMap | ( | AZStd::string | filename, |
NodeMapSettings * | settings = nullptr |
||
) |
Loads a node map from a file on disk.
filename | The name of the file on disk. |
settings | The node map importer settings, or nullptr to use default settings. |
NodeMap * EMotionFX::Importer::LoadNodeMap | ( | MCore::File * | f, |
NodeMapSettings * | settings = nullptr |
||
) |
Load a node map from a given file. A file does not have to be stored on disk, but can also be in memory or in an archive or on some network stream. Anything is possible.
f | The file to load the motion set from (after load, the file will be closed). |
settings | The node map importer settings, or nullptr to use default settings. |
NodeMap * EMotionFX::Importer::LoadNodeMap | ( | uint8 * | memoryStart, |
size_t | lengthInBytes, | ||
NodeMapSettings * | settings = nullptr |
||
) |
Loads a node map from memory.
memoryStart | The start address of the file in memory. |
lengthInBytes | The length of the file, in bytes. |
settings | The node map importer settings, or nullptr to use default settings. |
void EMotionFX::Importer::RegisterChunkProcessor | ( | ChunkProcessor * | processorToRegister | ) |
Register a new chunk processor. It can either be a new version of a chunk processor to extend the current file format or a complete new chunk processor. It will be added to the processor database and will then be executable.
processorToRegister | The processor to register to the importer. |
void EMotionFX::Importer::SetLogDetails | ( | bool | detailLoggingActive | ) |
Set if the importer should log the processor details or not.
detailLoggingActive | Set to true when you want to enable this feature, otherwise set it to false. |
void EMotionFX::Importer::SetLoggingEnabled | ( | bool | enabled | ) |
Enable or disable logging.
enabled | Set to true if you want to enable logging, or false when you want to disable it. |
|
static |
The standard endian conversion callback which converts endian for attribute data. This automatically handles the default types of the attributes.
attribute | The attribute to convert the endian for. |
sourceEndianType | The endian type the data is stored in before conversion. |