Public Types | Static Public Attributes | Protected Member Functions | Protected Attributes

KFbxCache Class Reference

This reference page is linked to from the following overview topics: FBX SDK 2012, List of Python FBX classes.


Search for all occurrences

Detailed Description

This object contains methods for accessing point animation in a cache file.

The FBX SDK supports two point cache file formats :

Accessing cache data using these formats differ significantly. To address this difference, two sets of methods have been created. Use the GetCacheFileFormat() function to determine which set of methods to use.

Examples:

ExportScene03/main.cxx, ViewScene/DrawScene.cxx, and ViewScene/InitScene.cxx.

Definition at line 62 of file kfbxcache.h.

#include <kfbxcache.h>

Inheritance diagram for KFbxCache:
Inheritance graph
[legend]

List of all members.

Public Types

enum   EOpenFlag { eO_RDONLY, eO_WRONLY }

Public Member Functions

ePC2 Format Specific Functions.
bool  OpenFileForWrite (double pFrameStartOffset, double pSamplingFrameRate, unsigned int pSampleCount, unsigned int pPointCount)
  Open a cache file for writing.
unsigned int  GetSampleCount ()
  Get the number of frames of animation found in the point cache file.
unsigned int  GetPointCount ()
  Get the number of points animated in the cache file.
double  GetFrameStartOffset ()
  Get the start time of the animation.
bool  Read (unsigned int pFrameIndex, double *pBuffer, unsigned int pPointCount)
  Read a sample at a given frame index.
bool  Write (unsigned int pFrameIndex, double *pBuffer)
  Write a sample at a given frame index.
File conversion Functions.
bool  ConvertFromPC2ToMC (EMCFileCount pFileCount, double pSamplingFrameRate)
  Create an eMC cache file from an ePC2 cache file.
bool  ConvertFromMCToPC2 (double pSamplingFrameRate, unsigned int pChannelIndex)
  Create an ePC2 cache file from an eMC cache file.

Static Public Attributes

static const char *  sCacheFilePropertyName
static const char *  sCacheFileAbsolutePathPropertyName
static const char *  sCacheFileTypePropertyName

Protected Member Functions

bool  OpenFile (EOpenFlag pFlag, EMCFileCount pFileCount, double pSamplingFrameRate, const char *pChannelName, const char *pInterpretation, unsigned int pSampleCount, unsigned int pPointCount, double pFrameStartOffset, EMCDataType pMCDataType=kDoubleVectorArray)
  KFbxCache (KFbxSdkManager &pManager, char const *pName)
virtual void  Construct (const KFbxCache *pFrom)
virtual bool  ConstructProperties (bool pForceSet)
virtual void  Destruct (bool pRecursive, bool pDependents)

Protected Attributes

KFbxCache_internal *  mData

Format Independent Functions.

enum   EFileFormat { eUNKNOWN, ePC2, eMC }
 

Supported cache file formats.

More...
void  SetCacheFileFormat (EFileFormat pFileFormat)
  Set the cache file format.
EFileFormat  GetCacheFileFormat () const
  Get the cache file format.
void  SetCacheFileName (const char *pRelativeFileName, const char *pAbsoluteFileName)
  Set the cache file name.
void  GetCacheFileName (KString &pRelativeFileName, KString &pAbsoluteFileName) const
  Get the cache file name.
bool  OpenFileForRead ()
  Open the cache file for reading.
bool  IsOpen () const
  Get the open state of the cache file.
bool  CloseFile ()
  Close the cache file.
double  GetSamplingFrameRate ()
  Get the sampling frame rate of the cache file.
KTime  GetCacheTimePerFrame ()
  Get the sampling frame rate of the cache file, as a KTime object.

eMC Format Specific Functions.

enum   EMCFileCount { eMC_ONE_FILE, eMC_ONE_FILE_PER_FRAME }
 

Number of files used to store the animation.

More...
enum   EMCDataType {
  kUnknownData, kDouble, kDoubleArray, kDoubleVectorArray,
  kInt32Array, kFloatArray, kFloatVectorArray
}
 

cache datatypes formats.

More...
enum   EMCSamplingType { eSAMPLING_REGULAR, eSAMPLING_IRREGULAR }
 

cache channel sampling types.

More...
bool  OpenFileForWrite (EMCFileCount pFileCount, double pSamplingFrameRate, const char *pChannelName, EMCDataType pMCDataType=kDoubleVectorArray, const char *pInterpretation="Points")
  Open a cache file for writing.
bool  AddChannel (const char *pChannelName, EMCDataType pMCDataType, const char *pInterpretation, unsigned int &pChannelIndex)
  Creates a new channel in the cache.
int  GetChannelCount ()
  Get the number of channels in the cache file.
bool  GetChannelName (int pChannelIndex, KString &pChannelName)
  Get the channel name for a specific channel index.
bool  GetChannelDataType (int pChannelIndex, EMCDataType &pChannelType)
  Get the DataType of the specified channel.
int  GetChannelIndex (const char *pChannelName)
  Get the index of the specified channel.
bool  Read (int pChannelIndex, KTime &pTime, double *pBuffer, unsigned int pPointCount)
  Read a sample at a given time.
bool  Read (int pChannelIndex, KTime &pTime, float *pBuffer, unsigned int pPointCount)
  Read a sample at a given time.
bool  Read (int pChannelIndex, KTime &pTime, int *pBuffer, unsigned int pPointCount)
  Read a sample at a given time.
bool  BeginWriteAt (KTime &pTime)
  Instruct the cache system that data is about to be written to it.
bool  Write (int pChannelIndex, KTime &pTime, double *pBuffer, unsigned int pPointCount)
  Write a sample at a given time.
bool  Write (int pChannelIndex, KTime &pTime, float *pBuffer, unsigned int pPointCount)
  Write a sample at a given time.
bool  Write (int pChannelIndex, KTime &pTime, int *pBuffer, unsigned int pPointCount)
  Write a sample at a given time.
bool  EndWriteAt ()
  Instruct the cache system that all the data on all the channels has been written to it for the given time (specified by the BeginWriteAt() call).
bool  GetAnimationRange (int pChannelIndex, KTime &pTimeStart, KTime &pTimeEnd)
  Get the Animation Range of the specified channel.
bool  GetCacheType (EMCFileCount &pFileCount)
  Get the cache type.
bool  GetChannelInterpretation (int pChannelIndex, KString &pInterpretation)
  Get the cache channel interpretation.
bool  GetChannelSamplingType (int pChannelIndex, EMCSamplingType &pSamplingType)
  Get the cache channel sampling type.
bool  GetChannelSamplingRate (int pChannelIndex, KTime &pSamplingRate)
  Get the cache channel sampling rate, in frames per second.
bool  GetChannelSampleCount (int pChannelIndex, unsigned int &pSampleCount)
  Get the number of data points for a channel.
bool  GetChannelPointCount (int pChannelIndex, KTime pTime, unsigned int &pPointCount)
  Get the number of points animated in the cache file, for a channel, for a given time.
int  GetCacheDataFileCount () const
  Returns the number of cache data files.
bool  GetCacheDataFileName (int pIndex, KString &pRelativeFileName, KString &pAbsoluteFileName)
  Get the nth cache file name.
bool  EnableMultiChannelFetching (bool pMultiChannelFetching)
  Enable multi-channel fetching.
bool  GetNextTimeWithData (KTime pCurTime, KTime &pNextTime, int pChannelIndex=-1)
  Get the next time where data is stored.
int  GetDataCount (int pChannelIndex)
  Get the number of data points the channel contains.
bool  GetDataTime (int pChannelIndex, unsigned int pDataIndex, KTime &pTime)
  Get the time of the specified data point.

Error Management

enum   EError {
  eUNSUPPORTED_ARCHITECTURE, eINVALID_ABSOLUTE_PATH, eINVALID_SAMPLING_RATE, eINVALID_CACHE_FORMAT,
  eUNSUPPORTED_FILE_VERSION, eCONVERSION_FROM_PC2_FAILED, eCONVERSION_FROM_MC_FAILED, eCACHE_FILE_NOT_FOUND,
  eCACHE_FILE_NOT_OPENED, eCACHE_FILE_NOT_CREATED, eINVALID_OPEN_FLAG, eERROR_WRITING_SAMPLE,
  eERROR_READING_SAMPLE, eERROR_DATATYPE, eERROR_INVALIDCHANNELINDEX, eERROR_IRREGULARCHANNELSAMPLING,
  eERROR_CHANNELINTERPRETATION, eERROR_CHANNELSAMPLING, eERROR_INVALID_FILEINDEX, eERROR_CACHEDATAFILENAME,
  eERROR_CHANNELSTARTTIME, eERROR_CHANNELPOINTCOUNT, eERROR_INVALIDTIME, eERROR_BEGINWRITEAT_NOTCALLED,
  eERROR_COUNT
}
 

Error identifiers.

More...
KError GetError ()
  Retrieve error object.
EError  GetLastErrorID () const
  Get last error code.
const char *  GetLastErrorString () const
  Get last error string.

Member Enumeration Documentation

Supported cache file formats.

  • eUNKNOWN
  • ePC2 3ds Max Point Cache 2 file format
  • eMC Maya Cache file format
Enumerator:
eUNKNOWN 
ePC2 
eMC 

Definition at line 77 of file kfbxcache.h.

Number of files used to store the animation.

  • eMC_ONE_FILE One file is used for all the frames of animation
  • eMC_ONE_FILE_PER_FRAME One file is used for every frame of animation
Enumerator:
eMC_ONE_FILE 
eMC_ONE_FILE_PER_FRAME 

Definition at line 143 of file kfbxcache.h.

cache datatypes formats.

  • kUnknownData
  • kDouble - not used but has to be defined for consistency reasons
  • kDoubleArray would be double*
  • kDoubleVectorArray is double* [3]
  • kInt32Array is int*
  • kFloatArray would be float*
  • kFloatVectorArray is float* [3]
Enumerator:
kUnknownData 
kDouble 
kDoubleArray 
kDoubleVectorArray 
kInt32Array 
kFloatArray 
kFloatVectorArray 

Definition at line 158 of file kfbxcache.h.

        {
            kUnknownData,
            kDouble,             // not used
            kDoubleArray,        //KArrayTemplate<kDouble>
            kDoubleVectorArray,  //KArrayTemplate<fbxDouble3> 
            kInt32Array,         //KArrayTemplate<kInt>
            kFloatArray,    
            kFloatVectorArray    //KArrayTemplate<fbxFloat3>
        }EMCDataType;

cache channel sampling types.

  • eSAMPLING_REGULAR Regular sampling
  • eSAMPLING_IRREGULAR Irregular sampling
Enumerator:
eSAMPLING_REGULAR 
eSAMPLING_IRREGULAR 

Definition at line 343 of file kfbxcache.h.

enum EError

Error identifiers.

  • eUNSUPPORTED_ARCHITECTURE
  • eINVALID_ABSOLUTE_PATH
  • eINVALID_SAMPLING_RATE
  • eINVALID_CACHE_FORMAT
  • eUNSUPPORTED_FILE_VERSION
  • eCONVERSION_FROM_PC2_FAILED
  • eCONVERSION_FROM_MC_FAILED
  • eCACHE_FILE_NOT_FOUND
  • eCACHE_FILE_NOT_OPENED
  • eCACHE_FILE_NOT_CREATED
  • eINVALID_OPEN_FLAG
  • eERROR_WRITING_SAMPLE
  • eERROR_READING_SAMPLE
  • eERROR_DATATYPE
  • eERROR_INVALIDCHANNELINDEX
  • eERROR_IRREGULARCHANNELSAMPLING
  • eERROR_CHANNELINTERPRETATION
  • eERROR_CHANNELSAMPLING
  • eERROR_INVALID_FILEINDEX
  • eERROR_CACHEDATAFILENAME
  • eERROR_COUNT
  • eERROR_CHANNELSTARTTIME
  • eERROR_CHANNELPOINTCOUNT
  • eERROR_INVALIDTIME
  • eERROR_BEGINWRITEAT_NOTCALLED
Enumerator:
eUNSUPPORTED_ARCHITECTURE 
eINVALID_ABSOLUTE_PATH 
eINVALID_SAMPLING_RATE 
eINVALID_CACHE_FORMAT 
eUNSUPPORTED_FILE_VERSION 
eCONVERSION_FROM_PC2_FAILED 
eCONVERSION_FROM_MC_FAILED 
eCACHE_FILE_NOT_FOUND 
eCACHE_FILE_NOT_OPENED 
eCACHE_FILE_NOT_CREATED 
eINVALID_OPEN_FLAG 
eERROR_WRITING_SAMPLE 
eERROR_READING_SAMPLE 
eERROR_DATATYPE 
eERROR_INVALIDCHANNELINDEX 
eERROR_IRREGULARCHANNELSAMPLING 
eERROR_CHANNELINTERPRETATION 
eERROR_CHANNELSAMPLING 
eERROR_INVALID_FILEINDEX 
eERROR_CACHEDATAFILENAME 
eERROR_CHANNELSTARTTIME 
eERROR_CHANNELPOINTCOUNT 
eERROR_INVALIDTIME 
eERROR_BEGINWRITEAT_NOTCALLED 
eERROR_COUNT 

Definition at line 549 of file kfbxcache.h.

enum EOpenFlag

Constructor & Destructor Documentation

KFbxCache ( KFbxSdkManager pManager,
char const *  pName 
) [protected]

Member Function Documentation

void SetCacheFileFormat ( EFileFormat  pFileFormat )

Set the cache file format.

Parameters:
pFileFormat Valid values are ePC2 or eMC.
Examples:
ExportScene03/main.cxx.
EFileFormat GetCacheFileFormat ( ) const

Get the cache file format.

Returns:
The current cache file format, or eUNKNOWN if it is not set.
Examples:
ViewScene/DrawScene.cxx, and ViewScene/InitScene.cxx.
void SetCacheFileName ( const char *  pRelativeFileName,
const char *  pAbsoluteFileName 
)

Set the cache file name.

Parameters:
pRelativeFileName The point cache file, relative to the FBX file name.
pAbsoluteFileName The point cache file absolute path.
Examples:
ExportScene03/main.cxx.
void GetCacheFileName ( KString pRelativeFileName,
KString pAbsoluteFileName 
) const

Get the cache file name.

Parameters:
pRelativeFileName Return the point cache file name, relative to the FBX File name.
pAbsoluteFileName Return the point cache file absolute path.
bool OpenFileForRead ( )

Open the cache file for reading.

Returns:
true if the file is successfully opened, false otherwise. See the error management functions for error details.
Examples:
ExportScene03/main.cxx, and ViewScene/InitScene.cxx.
bool IsOpen ( ) const

Get the open state of the cache file.

Returns:
true if the cache file is currently open, false otherwise.
bool CloseFile ( )

Close the cache file.

Returns:
true if the cache file is closed successfully, false otherwise.
Examples:
ExportScene03/main.cxx.
double GetSamplingFrameRate ( )

Get the sampling frame rate of the cache file.

Returns:
The sampling frame rate of the cache file, in frames per second.
KTime GetCacheTimePerFrame ( )

Get the sampling frame rate of the cache file, as a KTime object.

Returns:
The sampling frame rate of the cache file.
bool OpenFileForWrite ( EMCFileCount  pFileCount,
double  pSamplingFrameRate,
const char *  pChannelName,
EMCDataType  pMCDataType = kDoubleVectorArray,
const char *  pInterpretation = "Points" 
)

Open a cache file for writing.

Parameters:
pFileCount Create one file for each frame of animation, or one file for all the frames.
pSamplingFrameRate Number of frames per second.
pChannelName The name of the channel of animation to create.
pMCDataType The MC DataType of the cache.
pInterpretation A piece of meta data to help users of the cache understand how to interpret the data.
Examples:
ExportScene03/main.cxx.
bool AddChannel ( const char *  pChannelName,
EMCDataType  pMCDataType,
const char *  pInterpretation,
unsigned int &  pChannelIndex 
)

Creates a new channel in the cache.

Parameters:
pChannelName The name of the channel of animation to create.
pMCDataType The MC DataType of the cache.
pInterpretation A piece of meta data to help users of the cache understand how to interpret the data.
pChannelIndex The index of the new animation channel.
Remarks:
pChannelName must be unique within the cache.
pChannelName and pInterpretation cannot be NULL pointers.
This method must be called before adding any data to the cache but after the OpenFileForWrite.
int GetChannelCount ( )

Get the number of channels in the cache file.

Returns:
The number of animation channels in the cache file.
bool GetChannelName ( int  pChannelIndex,
KString pChannelName 
)

Get the channel name for a specific channel index.

Parameters:
pChannelIndex The index of the animation channel, between 0 and GetChannelCount().
pChannelName Returns the name of the requested channel.
Returns:
true if successful, false otherwise. See the error management functions for error details.
bool GetChannelDataType ( int  pChannelIndex,
EMCDataType pChannelType 
)

Get the DataType of the specified channel.

Parameters:
pChannelIndex The index of the channel.
pChannelType The channel's datatype
Returns:
true if successful, false otherwise. See the error management functions for error details.
int GetChannelIndex ( const char *  pChannelName )

Get the index of the specified channel.

Parameters:
pChannelName The name of the channel.
Returns:
The index of the channel in the cache file, or -1 if an error occurred. See the error management functions for error details.
Examples:
ExportScene03/main.cxx, and ViewScene/DrawScene.cxx.
bool Read ( int  pChannelIndex,
KTime pTime,
double *  pBuffer,
unsigned int  pPointCount 
)

Read a sample at a given time.

Parameters:
pChannelIndex The index of the animation channel, between 0 and GetChannelCount().
pTime Time at which the point animation must be evaluated.
pBuffer The place where the point value will be copied. If the channel datatype is DoubleVectorArray this buffer must be of size 3*pPointCount.
pPointCount The number of points to read from the point cache file.
Returns:
true if successful, false otherwise. See the error management functions for error details.
Examples:
ExportScene03/main.cxx, and ViewScene/DrawScene.cxx.
bool Read ( int  pChannelIndex,
KTime pTime,
float *  pBuffer,
unsigned int  pPointCount 
)

Read a sample at a given time.

Parameters:
pChannelIndex The index of the animation channel, between 0 and GetChannelCount().
pTime Time at which the point animation must be evaluated.
pBuffer The place where the point value will be copied. If the channel datatype is FloatVectorArray this buffer must be of size 3*pPointCount.
pPointCount The number of points to read from the point cache file.
Returns:
true if successful, false otherwise. See the error management functions for error details.
bool Read ( int  pChannelIndex,
KTime pTime,
int *  pBuffer,
unsigned int  pPointCount 
)

Read a sample at a given time.

Parameters:
pChannelIndex The index of the animation channel, between 0 and GetChannelCount().
pTime Time at which the point animation must be evaluated.
pBuffer The place where the point value will be copied. This buffer must be of size pPointCount.
pPointCount The number of points to read from the point cache file.
Returns:
true if successful, false otherwise. See the error management functions for error details.
bool BeginWriteAt ( KTime pTime )

Instruct the cache system that data is about to be written to it.

This call must appear before any calls to the Write() methods on any channel and terminated by a call to EndWriteAt().

Parameters:
pTime Time at which the point animation must be inserted.
Returns:
true if successful, false otherwise. See the error management functions for error details.
bool Write ( int  pChannelIndex,
KTime pTime,
double *  pBuffer,
unsigned int  pPointCount 
)

Write a sample at a given time.

Parameters:
pChannelIndex The index of the animation channel, between 0 and GetChannelCount().
pTime Time at which the point animation must be inserted.
pBuffer Point to the values to be copied. If the channel datatype is DoubleVectorArray this buffer must be of size 3*pPointCount.
pPointCount The number of points to write in the point cache file.
Returns:
true if successful, false otherwise. See the error management functions for error details.
Remarks:
This method will fail if the time pTime is different from the time set using the call BeginWriteAt().
For backward compatibility reasons you can still call this method without the prior call to BeginWriteAt() only if this cached system has been defined with one channel. Any other configuration will result in a failure.
Examples:
ExportScene03/main.cxx.
bool Write ( int  pChannelIndex,
KTime pTime,
float *  pBuffer,
unsigned int  pPointCount 
)

Write a sample at a given time.

Parameters:
pChannelIndex The index of the animation channel, between 0 and GetChannelCount().
pTime Time at which the point animation must be inserted.
pBuffer Point to the values to be copied. If the channel datatype is FloatVectorArray this buffer must be of size 3*pPointCount.
pPointCount The number of points to write in the point cache file.
Returns:
true if successful, false otherwise. See the error management functions for error details.
Remarks:
This method will fail if the time pTime is different from the time set using the call BeginWriteAt().
For backward compatibility reasons you can still call this method without the prior call to BeginWriteAt() only if this cached system has been defined with one channel. Any other configuration will result in a failure.
bool Write ( int  pChannelIndex,
KTime pTime,
int *  pBuffer,
unsigned int  pPointCount 
)

Write a sample at a given time.

Parameters:
pChannelIndex The index of the animation channel, between 0 and GetChannelCount().
pTime Time at which the point animation must be inserted.
pBuffer Point to the values to be copied. This buffer must be of size pPointCount.
pPointCount The number of points to write in the point cache file.
Returns:
true if successful, false otherwise. See the error management functions for error details.
Remarks:
This method will fail if the time pTime is different from the time set using the call BeginWriteAt().
For backward compatibility reasons you can still call this method without the prior call to BeginWriteAt() only if this cached system has been defined with one channel. Any other configuration will result in a failure.
bool EndWriteAt ( )

Instruct the cache system that all the data on all the channels has been written to it for the given time (specified by the BeginWriteAt() call).

The call to this method must be made after all the Write() for every channel defined.

Returns:
true if successful, false otherwise. See the error management functions for error details.
bool GetAnimationRange ( int  pChannelIndex,
KTime pTimeStart,
KTime pTimeEnd 
)

Get the Animation Range of the specified channel.

Parameters:
pChannelIndex The index of the channel.
pTimeStart The Channel's Animation Start Time
pTimeEnd The Channel's Animation End Time
Returns:
true if successful, false otherwise. See the error management functions for error details.
bool GetCacheType ( EMCFileCount pFileCount )

Get the cache type.

Parameters:
pFileCount The cache type.
Returns:
true if successful, false otherwise. See the error management functions for error details.
bool GetChannelInterpretation ( int  pChannelIndex,
KString pInterpretation 
)

Get the cache channel interpretation.

Parameters:
pChannelIndex The index of the animation channel, between 0 and GetChannelCount().
pInterpretation The channel interpretation; user-defined.
Returns:
true if successful, false otherwise. See the error management functions for error details.
bool GetChannelSamplingType ( int  pChannelIndex,
EMCSamplingType pSamplingType 
)

Get the cache channel sampling type.

Parameters:
pChannelIndex The index of the animation channel, between 0 and GetChannelCount().
pSamplingType The sampling type of the channel.
Returns:
true if successful, false otherwise. See the error management functions for error details.
bool GetChannelSamplingRate ( int  pChannelIndex,
KTime pSamplingRate 
)

Get the cache channel sampling rate, in frames per second.

Parameters:
pChannelIndex The index of the animation channel, between 0 and GetChannelCount().
pSamplingRate The sampling rate of the channel. The channel must have a regular sampling type.
Returns:
true if successful, false otherwise. See the error management functions for error details.
bool GetChannelSampleCount ( int  pChannelIndex,
unsigned int &  pSampleCount 
)

Get the number of data points for a channel.

Parameters:
pChannelIndex The index of the animation channel, between 0 and GetChannelCount().
pSampleCount Number of available samples.
Returns:
true if successful, false otherwise. See the error management functions for error details.
bool GetChannelPointCount ( int  pChannelIndex,
KTime  pTime,
unsigned int &  pPointCount 
)

Get the number of points animated in the cache file, for a channel, for a given time.

Parameters:
pChannelIndex The index of the animation channel, between 0 and GetChannelCount().
pTime Reference time; must be within the boundaries of the animation.
pPointCount Number of available points.
Returns:
true if successful, false otherwise. See the error management functions for error details.
int GetCacheDataFileCount ( ) const

Returns the number of cache data files.

Returns:
The count returned does not include the main cache file, and depends on the cache type. WIll return -1 point cache support is not enabled.
bool GetCacheDataFileName ( int  pIndex,
KString pRelativeFileName,
KString pAbsoluteFileName 
)

Get the nth cache file name.

Parameters:
pIndex Index of the cache file to return; index is zero-based, and must be < GetCacheDataFileCount().
pRelativeFileName Return the point cache file name, relative to the FBX File name.
pAbsoluteFileName Return the point cache file absolute path.
Returns:
true if successful, false otherwise. See the error management functions for error details.
bool EnableMultiChannelFetching ( bool  pMultiChannelFetching )

Enable multi-channel fetching.

Parameters:
pMultiChannelFetching Enable/disable multi-channel fetching. When multi-channel is enabled, any load of data on a channel at a specific time will prefetch data from all channels, for that specific time. This can reduce disk access, and increase performance (but requires more memory).
Returns:
true if successful, false otherwise. See the error management functions for error details.
bool GetNextTimeWithData ( KTime  pCurTime,
KTime pNextTime,
int  pChannelIndex = -1 
)

Get the next time where data is stored.

Parameters:
pCurTime Current time; must be within the boundaries of the animation.
pNextTime Next time (filled if the function is successful).
pChannelIndex The index of the animation channel, between 0 and GetChannelCount(). If pChannel is left at -1, get the next time for any channel.
Returns:
true if successful, false otherwise.
int GetDataCount ( int  pChannelIndex )

Get the number of data points the channel contains.

Parameters:
pChannelIndex The index of the animation channel, between 0 and GetChannelCount().
Returns:
the number of the channel's data points.
bool GetDataTime ( int  pChannelIndex,
unsigned int  pDataIndex,
KTime pTime 
)

Get the time of the specified data point.

Parameters:
pChannelIndex The index of the animation channel, between 0 and GetChannelCount().
pDataIndex Index of the data point.
pTime Time of the data point (filled if the function is successful).
Returns:
true if successful, false otherwise.
bool OpenFileForWrite ( double  pFrameStartOffset,
double  pSamplingFrameRate,
unsigned int  pSampleCount,
unsigned int  pPointCount 
)

Open a cache file for writing.

Parameters:
pFrameStartOffset Start time of the animation, in frames.
pSamplingFrameRate Number of frames per second.
pSampleCount The number of samples to write to the file.
pPointCount The number of points to write in the point cache file.
Returns:
true if successful, false otherwise. See the error management functions for error details.
unsigned int GetSampleCount ( )

Get the number of frames of animation found in the point cache file.

Returns:
The number of frames of animation.
unsigned int GetPointCount ( )

Get the number of points animated in the cache file.

Returns:
The number of points.
double GetFrameStartOffset ( )

Get the start time of the animation.

Returns:
The start time of the animation, in frames.
bool Read ( unsigned int  pFrameIndex,
double *  pBuffer,
unsigned int  pPointCount 
)

Read a sample at a given frame index.

Parameters:
pFrameIndex The index of the animation frame, between 0 and GetSampleCount().
pBuffer The place where the point value will be copied. This buffer must be of size 3*pPointCount.
pPointCount The number of points to read from the point cache file.
Returns:
true if successful, false otherwise. See the error management functions for error details.
bool Write ( unsigned int  pFrameIndex,
double *  pBuffer 
)

Write a sample at a given frame index.

Parameters:
pFrameIndex The index of the animation frame.
pBuffer Point to the values to be copied. This buffer must be of size 3*pPointCount, as passed to the function OpenFileForWrite().
Returns:
true if successful, false otherwise. See the error management functions for error details.
Remarks:
Successive calls to Write() must use successive index.
bool ConvertFromPC2ToMC ( EMCFileCount  pFileCount,
double  pSamplingFrameRate 
)

Create an eMC cache file from an ePC2 cache file.

Parameters:
pFileCount Create one file for each frame of animation, or one file for all the frames.
pSamplingFrameRate Number of frames per second used to resample the point animation.
Returns:
true if successful, false otherwise. See the error management functions for error details.
Remarks:
The created point cache file will be located in the _fpc folder associate with the FBX file.
Examples:
ViewScene/InitScene.cxx.
bool ConvertFromMCToPC2 ( double  pSamplingFrameRate,
unsigned int  pChannelIndex 
)

Create an ePC2 cache file from an eMC cache file.

Parameters:
pSamplingFrameRate Number of frames per second to resample the point animation.
pChannelIndex Index of the channel of animation to read from.
Returns:
true if successful, false otherwise. See the error management functions for error details.
Remarks:
The created point cache file will be located in the _fpc folder associate with the FBX file.
Examples:
ViewScene/InitScene.cxx.
KError& GetError ( )

Retrieve error object.

Returns:
Reference to error object.
Examples:
ExportScene03/main.cxx, and ViewScene/InitScene.cxx.
EError GetLastErrorID ( ) const

Get last error code.

Returns:
Last error code.
const char* GetLastErrorString ( ) const

Get last error string.

Returns:
Textual description of the last error.
bool OpenFile ( EOpenFlag  pFlag,
EMCFileCount  pFileCount,
double  pSamplingFrameRate,
const char *  pChannelName,
const char *  pInterpretation,
unsigned int  pSampleCount,
unsigned int  pPointCount,
double  pFrameStartOffset,
EMCDataType  pMCDataType = kDoubleVectorArray 
) [protected]
virtual void Construct ( const KFbxCache pFrom ) [protected, virtual]
virtual bool ConstructProperties ( bool  pForceSet ) [protected, virtual]
virtual void Destruct ( bool  pRecursive,
bool  pDependents 
) [protected, virtual]

Member Data Documentation

const char* sCacheFilePropertyName [static]

Definition at line 601 of file kfbxcache.h.

const char* sCacheFileAbsolutePathPropertyName [static]

Definition at line 602 of file kfbxcache.h.

const char* sCacheFileTypePropertyName [static]

Definition at line 603 of file kfbxcache.h.

KFbxCache_internal* mData [protected]

Reimplemented from KFbxObject.

Definition at line 621 of file kfbxcache.h.


The documentation for this class was generated from the following file:

KFbxCache KFbxCache KFbxCache KFbxCache KFbxCache KFbxCache KFbxCache KFbxCache KFbxCache KFbxCache
KFbxCache KFbxCache KFbxCache KFbxCache KFbxCache KFbxCache KFbxCache KFbxCache KFbxCache KFbxCache