The interface to the functionality for loading saving XML animation files.
This class contains key functionality for saving and creating both animation and map files and for loading in animation. You get this interface by calling GetILoadSaveAnimation()
#include <ILoadSaveAnimation.h>
Public Types |
|
Enums
|
|
enum | NodeMapType { eMatchExactName = 0, eMatchClosestName = 1, eMatchHierarchy = 2 } |
Enum for the type of node mapping to due when creating a map file using CreateMapFile. More... |
|
enum |
SaveFlags { eAnimatedTracks = 0x1, eIncludeConstraints = 0x2, eKeyableTracks = 0x4, eSaveSeg = 0x8, eSegPerFrame = 0x10 } |
Enum for different flags to pass in when calling ILoadSaveAnimation::SaveAnimation and ILoadSaveAnimation10::SetUpAnimsForSaveExt. More... |
|
enum | LoadFlags { eRelative = 0x1, eInsert = 0x2, eStripLayers = 0x4, eIncludePB2s = 0x8 } |
Enum for different flags to pass in when calling ILoadSaveAnimation::LoadAnimation and ILoadSaveAnimation10::SetUpAnimsForLoadExt. More... |
|
enum | MapFlags { eMapControllerExactName = 0x1, eMapControllerType = 0x2, eStripLayersInMap = 0x4 } |
Enum for different flags to pass in when calling ILoadSaveAnimation::CreateMapFile and ILoadSaveAnimation10::SetUpAnimsForMapExt. More... |
|
Public Member Functions |
|
virtual BOOL | GetUserAttributes (const MCHAR *filename, Tab< MSTR * > &userAttributes, Tab< MSTR * > &userValues) const =0 |
Get the user attributes that are present out
of the corresponding animation or map file. |
|
virtual void | LoadForMixing (BOOL flag) const =0 |
Dialog Functions
|
|
virtual const MCHAR * | SaveAnimationDlg () const =0 |
Brings up the Save Animation dialog.
|
|
virtual const MCHAR * | LoadAnimationDlg () const =0 |
Brings up the Load Animation dialog.
|
|
virtual BOOL | GetLoadAndMapFileFromDlg (MCHAR fileName[MAX_PATH], MCHAR mapFileName[MAX_PATH]) const =0 |
Brings up the Load Animation dialog and
returns the fileName and the mapFileName in the passed in
parameters. |
|
virtual BOOL | GetMultLoadAndMapFileFromDlg (Tab< MSTR * > &names, MCHAR *mapName) const =0 |
Brings up the Load Animation dialog and
returns a list of possible multiple file names in the passed in
parameters. |
|
Save Functions
|
|
virtual BOOL | SaveAnimation (const MCHAR *filename, Tab< INode * > &nodes, Tab< MSTR * > &userAttributes, Tab< MSTR * > &userValues, DWORD saveFlag, Interval &segInterval) const =0 |
Save the animation from the current nodes
into the specified file. |
|
virtual BOOL | SaveAnimationNodeAnims (const MCHAR *filename, Tab< NodeAndAnims > &nodeAnims, Tab< MSTR * > &userAttributes, Tab< MSTR * > &userValues, DWORD saveFlag, Interval &segInterval) const =0 |
Save the animation from the current nodeAnim
tracks into the specified file. |
|
Load Functions
|
|
virtual BOOL | LoadAnimation (const MCHAR *filename, Tab< INode * > &nodes, DWORD loadFlag, TimeValue insertTime, BOOL useMapFile, MCHAR *mapFileName) const =0 |
Load the animation from the current file
onto the specified nodes using any mapping that's specified.
|
|
virtual BOOL | LoadAnimationNodeAnims (const MCHAR *filename, Tab< NodeAndAnims > &nodeAnims, DWORD loadFlag, TimeValue insertTime, BOOL useMapFile, MCHAR *mapFileName) const =0 |
Load the animation from the current file
onto the specified nodeAnim tracks using any mapping that's
specified. |
|
Map Functions
|
|
virtual BOOL | CreateMapFile (const MCHAR *filename, Tab< INode * > ¤tNodes, const MCHAR *incomingAnimationFile, Tab< MSTR * > &userAttributes, Tab< MSTR * > &userValues, Tab< LoadSaveRetargetData > &retargetData, int nodeMapType, DWORD mapFlag) const =0 |
Create a map file based upon nodes to map
to, the animation file that will be loaded, and the specific
mapping protocols. |
|
virtual BOOL | CreateMapFileNodeAnims (const MCHAR *filename, Tab< NodeAndAnims > &nodeAnims, const MCHAR *incomingAnimationFile, Tab< MSTR * > &userAttributes, Tab< MSTR * > &userValues, Tab< LoadSaveRetargetData > &retargetData, int nodeMapType, DWORD mapFlag) const =0 |
Create a map file based upon nodeAnim tracks
to map to, the animation file that will be loaded, and the specific
mapping protocols. |
|
File and Directory Functions
|
|
virtual const MCHAR * | GetAnimFileExtension () const =0 |
Get the extension used for the animation
files. |
|
virtual const MCHAR * | GetAnimMapFileExtension () const =0 |
Get the extension used for the animation map
files. |
|
virtual const MCHAR * | GetAnimFileDirectory () const =0 |
Get the current directory for finding
animation files. |
|
virtual void | GetAnimFileDirectories (Tab< MSTR * > &animFileDirectories) const =0 |
Get all of the anim file directories in the
load/save UI. |
|
virtual void | GetMapFiles (Tab< MSTR * > &mapFiles) const =0 |
Get all of the recently used map files in
the load/save UI. |
|
virtual const MCHAR * | GetAnimMapFile () const =0 |
Get the current map file. |
|
virtual void | SetAnimFileDirectory (const MCHAR *directory)=0 |
Set the current directory for finding
animation files. |
|
virtual void | SetAnimMapFile (const MCHAR *filename)=0 |
Set the latest map file found. |
|
Getting Animation Tracks
|
|
virtual void | SetUpAnimsForSave (Tab< INode * > &nodeTab, BOOL animatedTracks, BOOL includeConstraints, BOOL keyable, Tab< NodeAndAnims > &nodeAnims) const =0 |
Sets up the anim list to be used for saving
out an xml animation file. |
|
virtual void | SetUpAnimsForLoad (Tab< INode * > &nodeTab, BOOL includePB2s, Tab< NodeAndAnims > &nodeAnims) const =0 |
Sets up the anim list to be used for loading
in an xml animation file or putting nodes and their tracks into the
mixer. |
|
virtual void | SetUpAnimsForMap (Tab< INode * > &nodeTab, Tab< NodeAndAnims > &nodeAnims) const =0 |
Sets up the anim list to be used for mapping
an xml animation file. |
enum NodeMapType |
Enum for the type of node mapping to due when creating a map file using CreateMapFile.
{ eMatchExactName=0, eMatchClosestName=1,eMatchHierarchy=2};
enum SaveFlags |
Enum for different flags to pass in when calling ILoadSaveAnimation::SaveAnimation and ILoadSaveAnimation10::SetUpAnimsForSaveExt.
If eAnimatedTracks is set, then a track needs to be animated. If eIncludeConstraints is set, and if eAnimatedTracks is set, constraints will also be considered to be animated. If eKeyable is set, then keyable tracks will be saved if eSaveSeg is set, then a segment of time will be saved. if eSegPerFrame is set then a key per frame will be saved over a saved segment.
{eAnimatedTracks = 0x1, eIncludeConstraints = 0x2, eKeyableTracks = 0x4,eSaveSeg = 0x8, eSegPerFrame = 0x10};
enum LoadFlags |
Enum for different flags to pass in when calling ILoadSaveAnimation::LoadAnimation and ILoadSaveAnimation10::SetUpAnimsForLoadExt.
If eRelative is set, then nodes who are children of the scene root will keep their original position and orientation and the animation will be loaded relatively to that, otherwise the animation will be loaded in absolutely. If eInsert is set, then the animation will be inserted at the specified time and the existing animation will be moved over, otherwise the animation will replaced the existing animation at that time. If eStripLayers is set, then the active layer name will be stripped out from the current node controllers that have layers. If eIncludePB2s is set then we will include ParamBlock2 tracks when loading into the animation. Note that the eIncludePB2s flags is currently only used by ILoadSaveAnimation10::SetUpAnimsForLoadExt
{eRelative = 0x1,eInsert = 0x2, eStripLayers = 0x4, eIncludePB2s = 0x8};
enum MapFlags |
Enum for different flags to pass in when calling ILoadSaveAnimation::CreateMapFile and ILoadSaveAnimation10::SetUpAnimsForMapExt.
If eMapControllerExactName is set then the controllers will try to be matched based upon their exact names, otherwise, they will try to match off of their subanim order. If eMapControllerType is set then the controller need to be the same of the same class, otherwise they won't map. If eStripLayersInMap is set, then the active layer name will be removed from the current node controllers that have layers.
{eMapControllerExactName = 0x1,eMapControllerType = 0x2,eStripLayersInMap = 0x4};
virtual const MCHAR* SaveAnimationDlg | ( | ) | const [pure virtual] |
Brings up the Save Animation dialog.
virtual const MCHAR* LoadAnimationDlg | ( | ) | const [pure virtual] |
Brings up the Load Animation dialog.
virtual BOOL GetLoadAndMapFileFromDlg | ( | MCHAR | fileName[MAX_PATH], |
MCHAR | mapFileName[MAX_PATH] | ||
) | const [pure virtual] |
Brings up the Load Animation dialog and returns the fileName and the mapFileName in the passed in parameters.
[out] | fileName | The name of the animation file returned. Note that the character array passed in ! should have a size of MAX_PATH. ! |
[out] | mapFileName | The name of the map file returned. Note that the character array passed in ! should have a size of MAX_PATH. ! |
virtual BOOL GetMultLoadAndMapFileFromDlg | ( | Tab< MSTR * > & | names, |
MCHAR * | mapName | ||
) | const [pure virtual] |
Brings up the Load Animation dialog and returns a list of possible multiple file names in the passed in parameters.
param[out] names The list of animation files. param[out] mapFileName The name of the map file. Note that the character array passed in should have a size of MAX_PATH.
virtual BOOL SaveAnimation | ( | const MCHAR * | filename, |
Tab< INode * > & | nodes, | ||
Tab< MSTR * > & | userAttributes, | ||
Tab< MSTR * > & | userValues, | ||
DWORD | saveFlag, | ||
Interval & | segInterval | ||
) | const [pure virtual] |
Save the animation from the current nodes into the specified file.
This function will save out an animation file given the passed in nodes and user attributes, based upon the saveFlags and possible segment interval.
[in] | filename | The file to save the animation to. ! |
[in] | nodes | The nodes whose animation you would like to save. ! |
[in] | userAttributes | A Tab of strings that specify the names of the user attributes to be ! saved out. The values of these attributes are found in the next parameter. Thus the userAttributes Tab ! and the userValues Tab need to be the same size or the function will return FALSE. ! |
[in] | userValues | A Tab of strings that specify the names of the user values to be saved out. Each ! user value corresponds to a user attribute that's passed in the previous parameter. ! |
[in] | saveFlag | Determines which tracks under the specified nodes will be saved. The possible values ! of the saveFlag are found in the SaveFlags enum. The possible vales are eAnimatedTracks, if this value is set, ! then only animated tracks only will be saved, otherwise non-animated tracks will also be saved. ! eIncludeConstraints, if set and eAnimatedTracks is set, then constraints will also be saved out, ! otherwise if eAnimatedTracks is set and this value isn't set, they won't be saved out. If eAnimatedTracks isn't ! set this parameter is unused since constraints will be automatically saved out. eKeyableTracks, if set keyable ! tracks only will be saved, otherwise non-keyable tracks will also be saved. eSaveSegment, if set a segment will ! be saved specified by the segInterval and eSegKeyPerFrame flag. eSegKeyPerFrame, which if set ! will save out a key per frame when saving out a segment, otherwise only the keys will be saved out. ! |
[in] | segInterval | The interval over which to save the segment. ! |
virtual BOOL SaveAnimationNodeAnims | ( | const MCHAR * | filename, |
Tab< NodeAndAnims > & | nodeAnims, | ||
Tab< MSTR * > & | userAttributes, | ||
Tab< MSTR * > & | userValues, | ||
DWORD | saveFlag, | ||
Interval & | segInterval | ||
) | const [pure virtual] |
Save the animation from the current nodeAnim tracks into the specified file.
This function saves out the animation file given the passed in nodeAnim array and user attributes, based upon the saveFlags and possible segment interval.
[in] | filename | The file to save the animation to. ! |
[in] | nodeAnims | The nodeAnim list whose animation you would like to save. Should have been created via ! SetUpAnimsForSave. ! |
[in] | userAttributes | A Tab of strings that specify the names of the user attributes to be ! saved out. The values of these attributes are found in the next parameter. Thus the userAttributes Tab ! and the userValues Tab need to be the same size or the function will return FALSE. ! |
[in] | userValues | A Tab of strings that specify the names of the user values to be saved out. Each ! user value corresponds to a user attribute that's passed in the previous parameter. /*! |
[in] | saveFlag | Determines which tracks under the specified nodes will be saved. The possible values of the saveFlag are found in the SaveFlags enum. The possible vales are: eAnimatedTracks, if this value is set, then only animated tracks only will be saved, otherwise non-animated tracks will also be saved. eIncludeConstraints, if set and eAnimatedTracks is set, then constraints will also be saved out, otherwise if eAnimatedTracks is set and this value isn't set, they won't be saved out. If eAnimatedTracks isn't set this parameter is unused since constraints will be automatically saved out. eKeyableTracks, if set keyable tracks only will be saved, otherwise non-keyable tracks will also be saved. eSaveSegment, if set a segment will be saved specified by the segInterval and eSegKeyPerFrame flag. eSegKeyPerFrame, which if set will save out a key per frame when saving out a segment, otherwise only the keys will be saved out. ! |
[in] | segInterval | The interval over which to save the segment. ! |
virtual BOOL LoadAnimation | ( | const MCHAR * | filename, |
Tab< INode * > & | nodes, | ||
DWORD | loadFlag, | ||
TimeValue | insertTime, | ||
BOOL | useMapFile, | ||
MCHAR * | mapFileName | ||
) | const [pure virtual] |
Load the animation from the current file onto the specified nodes using any mapping that's specified.
This function loads in the specified file onto the passed in nodes based upon the the passed in flags, insertion time and possible mapFileName.
[in] | filename | The file to load the animation from. ! |
[in] | nodes | The nodes where the animation will be loaded onto. ! |
[in] | loadFlag | Determines which tracks under the specified nodes will be loaded onto. The possible values ! of the loadFlag are found in the LoadFlags enum. The possible vales are: eRelative, if this value is set, ! the animation will be loaded at the current position and orientation of a node, if it's ! parent is the root, if not set the animation will be loaded in absolutely. eInsert, if this value is set, ! the existing animation will be moved to the left when the animation is loaded, otherwise is not set the ! animation will overwrite the existing animation. eStripLayers, if this value is set, then any layer controller name ! will be removed from the current controller names, otherwise it won't. ! |
[in] | insertTime | The time where the animation is loaded. ! |
[in] | useMapFile | If TRUE the mapFileName file name parameter will be used to specify what map file to use. ! If FALSE then default mapping is used. ! |
[in] | mapFileName | The file name of the map file to use if the useMapFile parameter is TRUE. ! |
virtual BOOL LoadAnimationNodeAnims | ( | const MCHAR * | filename, |
Tab< NodeAndAnims > & | nodeAnims, | ||
DWORD | loadFlag, | ||
TimeValue | insertTime, | ||
BOOL | useMapFile, | ||
MCHAR * | mapFileName | ||
) | const [pure virtual] |
Load the animation from the current file onto the specified nodeAnim tracks using any mapping that's specified.
This function loads in the specified file onto the passed in nodeAndAnim tracks based upon the the passed in flags, insertion time and possible mapFileName.
[in] | filename | The file to load the animation from. ! |
[in] | nodeAnims | The nodeAnim list whose animation you would like to save. Should have been created via ! SetUpAnimsForLoad. |
[in] | loadFlag | Determines which tracks under the specified nodes will be loaded onto. The possible values ! of the loadFlag are found in the LoadFlags enum. The possible vales are: eRelative, if this value is set, ! the animation will be loaded at the current position and orientation of a node, if it's ! parent is the root, if not set the animation will be loaded in absolutely. eInsert, if this value is set, ! the existing animation will be moved to the left when the animation is loaded, otherwise is not set the ! animation will overwrite the existing animation. ! |
[in] | insertTime | The time where the animation is loaded. ! |
[in] | useMapFile | If TRUE the mapFileName file name parameter will be used to specify what map file to use. ! If FALSE then default mapping is used. ! |
[in] | mapFileName | The file name of the map file to use if the useMapFile parameter is TRUE. ! |
virtual BOOL CreateMapFile | ( | const MCHAR * | filename, |
Tab< INode * > & | currentNodes, | ||
const MCHAR * | incomingAnimationFile, | ||
Tab< MSTR * > & | userAttributes, | ||
Tab< MSTR * > & | userValues, | ||
Tab< LoadSaveRetargetData > & | retargetData, | ||
int | nodeMapType, | ||
DWORD | mapFlag | ||
) | const [pure virtual] |
Create a map file based upon nodes to map to, the animation file that will be loaded, and the specific mapping protocols.
[in] | filename | The file to save the map file to. |
[in] | currentNodes | The nodes which will be mapped to the specified incoming Animation File. |
[in] | incomingAnimationFile | The file from which to map from. The controllers in this file will map to the controllers of the current nodes. |
[in] | userAttributes | A Tab of strings that specify the names of the user attributes to be saved out. The values of these attributes are found in the next parameter. Thus the userAttributes Tab and the userValues Tab need to be the same size or the function will return FALSE. |
[in] | userValues | A Tab of strings that specify the names of the user values to be saved out. Each user value corresponds to a user attribute that's passed in the previous parameter. |
[in] | retargetData | A Tab of LoadSaveRetargetData values that specify how specific nodes that get mapped should be retargeted. |
[in] | nodeMapType | The type of node mapping to perform. If the value is eMatchExactName, the nodes will map if the nodes have the same exact name. If the value is eMatchClosestName, the nodes will match based off of which nodes have the closest names. If the value is eMatchHierarchy, the nodes will try to match by matching their hierarchies. |
[in] | mapFlag | Determines how the controller mapping will occur once the nodes are mapped. The possible values of the mapFlag are found in the MapFlags enum. The possible vales are: eMapControllerExactName, if set the controllers of the mapped nodes will try to map to each other by matching their names exactly, if not set the controllers will map by their subanim ordering. eMapControllerType, if set, the controllers will check to see if they have the same exact type, that is the same ClassID and SuperClassID, otherwise they won't map, if not set then the controllers only need to be have the same SuperClassID. eStripLayersinMap, if set, will strip the layer controller name from any active layers on the current nodes. |
virtual BOOL CreateMapFileNodeAnims | ( | const MCHAR * | filename, |
Tab< NodeAndAnims > & | nodeAnims, | ||
const MCHAR * | incomingAnimationFile, | ||
Tab< MSTR * > & | userAttributes, | ||
Tab< MSTR * > & | userValues, | ||
Tab< LoadSaveRetargetData > & | retargetData, | ||
int | nodeMapType, | ||
DWORD | mapFlag | ||
) | const [pure virtual] |
Create a map file based upon nodeAnim tracks to map to, the animation file that will be loaded, and the specific mapping protocols.
[in] | filename | The file to save the map file to. |
[in] | nodeAnims | The nodeAnim list whose animation you would like to map. Should have been created via SetUpAnimsForMap. |
[in] | incomingAnimationFile | The file from which to map from. The controllers in this file will map to the controllers of the current nodes. |
[in] | userAttributes | A Tab of strings that specify the names of the user attributes to be saved out. The values of these attributes are found in the next parameter. Thus the userAttributes Tab and the userValues Tab need to be the same size or the function will return FALSE. |
[in] | userValues | A Tab of strings that specify the names of the user values to be saved out. Each user value corresponds to a user attribute that's passed in the previous parameter. |
[in] | retargetData | A Tab of LoadSaveRetargetData values that specify how specific nodes that get mapped should be retargetted. |
[in] | nodeMapType | The type of node mapping to perform. If the value is eMatchExactName, the nodes will map if the nodes have the same exact name. If the value is eMatchClosestName, the nodes will match based off of which nodes have the closest names. If the value is eMatchHierarchy, the nodes will try to match by matching their hierarchies. |
[in] | mapFlag | Determines how the controller mapping will occur once the nodes are mapped. The possible values of the mapFlag are found in the MapFlags enum. The possible vales are: eMapControllerExactName, if set the controllers of the mapped nodes will try to map to each other by matching their names exactly, if not set the controllers will map by their subanim ordering. eMapControllerType, if set, the controllers will check to see if they have the same exact type,(ClassID and SuperClassID), otherwise they won't map, if not set, then the controllers only need to be have the same SuperClassID. |
virtual BOOL GetUserAttributes | ( | const MCHAR * | filename, |
Tab< MSTR * > & | userAttributes, | ||
Tab< MSTR * > & | userValues | ||
) | const [pure virtual] |
Get the user attributes that are present out of the corresponding animation or map file.
[in] | filename | The name of the animation or map file that you are getting user attributes from. |
[out] | userAttributes | A Tab of MSTR strings of the user defined attributes found in the file. There is a one to one correspondence between the number of attributes and number of values in the file. The callee of this function is responsible for deleting the valid MSTR * pointers. |
[out] | userValues | A Tab of MSTR strings of the user defined values found in the file. There is one string value for each attribute. The caller of this function is responsible for deleting the valid MSTR * pointers |
virtual const MCHAR* GetAnimFileExtension | ( | ) | const [pure virtual] |
Get the extension used for the animation files.
virtual const MCHAR* GetAnimMapFileExtension | ( | ) | const [pure virtual] |
Get the extension used for the animation map files.
virtual const MCHAR* GetAnimFileDirectory | ( | ) | const [pure virtual] |
Get the current directory for finding animation files.
Get all of the anim file directories in the load/save UI.
[out] | animFileDirectories | A Tab of MSTR strings containing all of recently used directories. The caller of this function is responsible for deleting the valid MSTR * pointers. |
Get all of the recently used map files in the load/save UI.
[out] | mapFiles | A Tab of MSTR strings containing all of recently used map files. The caller of this function is responsible for deleting the valid MSTR * pointers. |
virtual const MCHAR* GetAnimMapFile | ( | ) | const [pure virtual] |
Get the current map file.
virtual void SetAnimFileDirectory | ( | const MCHAR * | directory | ) | [pure virtual] |
Set the current directory for finding animation files.
[in] | directory | The name of the anim file directory. |
virtual void SetAnimMapFile | ( | const MCHAR * | filename | ) | [pure virtual] |
Set the latest map file found.
[in] | file | The name of the map file. |
virtual void SetUpAnimsForSave | ( | Tab< INode * > & | nodeTab, |
BOOL | animatedTracks, | ||
BOOL | includeConstraints, | ||
BOOL | keyable, | ||
Tab< NodeAndAnims > & | nodeAnims | ||
) | const [pure virtual] |
Sets up the anim list to be used for saving out an xml animation file.
[in] | nodeTab | Nodes you want to save out |
[in] | animatedTracks | If TRUE will only included animated tracks in the list, |
[in] | includeConstraints | If animatedTracks is TRUE and this is TRUE, constraints will be considered to be animated and thus also in the list. |
[in] | keyable | If TRUE will only include keyable tracks in the list. |
[out] | nodeAnims | The returned list of nodes and their anim tracks based upon the flags passed into the function. |
virtual void SetUpAnimsForLoad | ( | Tab< INode * > & | nodeTab, |
BOOL | includePB2s, | ||
Tab< NodeAndAnims > & | nodeAnims | ||
) | const [pure virtual] |
Sets up the anim list to be used for loading in an xml animation file or putting nodes and their tracks into the mixer.
[in] | nodeTab | Nodes you want to load |
[in] | includePB2s | Whether or not to include param block2 tracks when loading in the animation. |
[out] | nodeAnims | The returned list of nodes and their anim tracks based upon the flags passed into the function. |
virtual void SetUpAnimsForMap | ( | Tab< INode * > & | nodeTab, |
Tab< NodeAndAnims > & | nodeAnims | ||
) | const [pure virtual] |
Sets up the anim list to be used for mapping an xml animation file.
[in] | nodeTab | Nodes you want to map |
[out] | nodeAnims | The returned list of nodes and their anim tracks |
virtual void LoadForMixing | ( | BOOL | flag | ) | const [pure virtual] |