kfbxutilities.h File Reference

#include <fbxfilesdk/fbxfilesdk_def.h>
#include <fbxfilesdk/kfbxplugins/kfbxscene.h>
#include <fbxfilesdk/fbxfilesdk_nsbegin.h>
#include <fbxfilesdk/fbxfilesdk_nsend.h>

Go to the source code of this file.

Classes

class   KFbxFile
  Generic utility class to manipulate files on different file systems similarly. More...

Enumerations

enum   eFileMode { KFBX_READ, KFBX_WRITE, KFBX_READWRITE, KFBX_APPEND }
 

File open mode.

More...
enum   eSeekPos { KFBX_BEGIN, KFBX_CURRENT, KFBX_END }
 

File seek mode.

More...

Functions

Scene cleaning
KFBX_DLL KArrayTemplate
< KFbxNode * > 
RemoveBadPolygonsFromMeshes (KFbxScene *pScene)
  Clean bad meshes in the scene by removing bad polygons.
Animation query functions
KFBX_DLL bool  IsAnimated (KFbxObject *pObj)
  Inspects all the properties of the given object for animation curves.
KFBX_DLL bool  IsChannelAnimated (KFbxObject *pObj, char *pPropertyName, char *pChannelName=NULL)
  Inspects the specified property of the given object for animation curves.
File utilities
KFBX_DLL char *  FBXGet_Internet_Source_File (const char *url)
  Get the content of a file from an hyper link.
KFBX_DLL void  FBXFree_Internet_Buffer (char *pBuf)
  Free the memory allocated by FBXGet_Internet_Source_File()
KFBX_DLL KString  KFbxFullPath (const char *pRelativePath)
  Get the full path of given path (if the given path is relative path, it will take current directory as default root path.)
KFBX_DLL KString  KFbxExtractDirectory (const char *pFilePath)
  Extract Directory from the given file path.
KFBX_DLL KString  KFbxExtractFileName (const char *pFilePath, bool pWithExtension=true)
  Extract file name from the given file path.
KFBX_DLL KString  KFbxExtractFileExtension (const char *pFilePath)
  Extract the given file's extension.
KFBX_DLL KString  KFbxChangeFileExtension (const char *pFilePath, const char *pNewExtension)
  This function is used to change the given file's extension with given new extension, if the given file haven't extension,it will directly add the new extension at the end of given file.
KFBX_DLL KString  KFbxCleanPath (const char *pFilePath)
  Clean the redundant and useless denotations in given path name.
KFBX_DLL KString  KFbxGetRelativeFilePath (const char *pRootPath, const char *pNewFilePath)
  Get the given new path's relative path to the given root path.
KFBX_DLL bool  KFbxIsRelativePath (const char *pFilePath)
  Test if the given path is relative path, if it is return true.
KFBX_DLL bool  KFbxFileExist (const char *pFilePath)
  Find if the given file exist.If the given file without directory, it will find the file in the work directory.
KFBX_DLL bool  KFbxEnsureDirectoryExistance (const char *pFilePath)
  Test if the given directory exists, if the directory does not exist, it will create this directory.
KFBX_DLL KString  KFbxGetApplicationDirectory ()
  Get the application directory.
KFBX_DLL KString  KFbxMakeFullPath (const char *pRootPath, const char *pFilePath)
  Get the full path.
KFBX_DLL KString  KFbxGetCurrentDirectory ()
  Get the current path.
KFBX_DLL size_t  KGetProcessVirtualMemoryAvailSize ()
  Returns the amount of virtual memory available to the process; will take into account swap file, and the process address space if there are such limits (ie: Win32 process can access 2, 3 or 4gb depending on the OS they're running on, Win64 has a much larger limit, limited possibly by the swap file)

Detailed Description

Definition in file kfbxutilities.h.


Enumeration Type Documentation

enum eFileMode

File open mode.

  • KFBX_READ
  • KFBX_WRITE
  • KFBX_READWRITE
  • KFBX_APPEND
Enumerator:
KFBX_READ 
KFBX_WRITE 
KFBX_READWRITE 
KFBX_APPEND 

Definition at line 203 of file kfbxutilities.h.

enum eSeekPos

File seek mode.

  • KFBX_BEGIN
  • KFBX_CURRENT
  • KFBX_END
Enumerator:
KFBX_BEGIN 
KFBX_CURRENT 
KFBX_END 

Definition at line 210 of file kfbxutilities.h.


Function Documentation

KFBX_DLL KArrayTemplate<KFbxNode*> RemoveBadPolygonsFromMeshes ( KFbxScene pScene )

Clean bad meshes in the scene by removing bad polygons.

Parameters:
pScene Pointer to the scene object.
Returns:
Array of nodes containing modified meshes.
KFBX_DLL bool IsAnimated ( KFbxObject pObj )

Inspects all the properties of the given object for animation curves.

Parameters:
pObj Pointer to the object to query.
Returns:
true if at least one property is animated and false otherwise.
Remarks:
A property is animated if it contains at least one KFbxAnimCurve with keys.
KFBX_DLL bool IsChannelAnimated ( KFbxObject pObj,
char *  pPropertyName,
char *  pChannelName = NULL 
)

Inspects the specified property of the given object for animation curves.

Parameters:
pObj Pointer to the object to query.
pPropertyName Name of the inspected property.
pChannelName Name of the specific channel of the inspected property.
Returns:
true if the specified channel is animated and false otherwise.
Remarks:
A property is animated if it contains at least one KFbxAnimCurve with keys.
KFBX_DLL char* FBXGet_Internet_Source_File ( const char *  url )

Get the content of a file from an hyper link.

Parameters:
url The hyper link to the file. The URL must start with < http:// > ex: http://www.autodesk.com.
Returns:
An allocated <char *buffer> containing the source text. You must use FBXFree_Internet_Buffer() to free the allocated memory.
KFBX_DLL void FBXFree_Internet_Buffer ( char *  pBuf )

Free the memory allocated by FBXGet_Internet_Source_File()

Parameters:
pBuf Pointer previously returned by a call to FBXGet_Internet_Source_File().
KFBX_DLL KString KFbxFullPath ( const char *  pRelativePath )

Get the full path of given path (if the given path is relative path, it will take current directory as default root path.)

Parameters:
pRelativePath The relative path.
Returns:
Full path
Examples:
ExportScene03/main.cxx.
KFBX_DLL KString KFbxExtractDirectory ( const char *  pFilePath )

Extract Directory from the given file path.

Parameters:
pFilePath The given file path.
Returns:
The directory without file name.If there isn't any '\' or '/' in the given file path, it will directly return the given file path.
Examples:
ExportScene03/main.cxx, and ViewScene/main.cxx.
KFBX_DLL KString KFbxExtractFileName ( const char *  pFilePath,
bool  pWithExtension = true 
)

Extract file name from the given file path.

Parameters:
pFilePath The given file path.
pWithExtension Decide the file name with extension or without extension. If it is true, return the file name with extension,if it is false, return the file name without extension.
Returns:
The file name.
Examples:
ExportScene03/main.cxx, and ProceduralTexture/main.cxx.
KFBX_DLL KString KFbxExtractFileExtension ( const char *  pFilePath )

Extract the given file's extension.

Parameters:
pFilePath The given file path.
Returns:
The file extension.
Examples:
ProceduralTexture/main.cxx.
KFBX_DLL KString KFbxChangeFileExtension ( const char *  pFilePath,
const char *  pNewExtension 
)

This function is used to change the given file's extension with given new extension, if the given file haven't extension,it will directly add the new extension at the end of given file.

The given new extension must add "." before the extension name.

Parameters:
pFilePath The old file path.
pNewExtension The given new extension, it must add "." before the extension name
Returns:
New file path with new extension name.
KFBX_DLL KString KFbxCleanPath ( const char *  pFilePath )

Clean the redundant and useless denotations in given path name.

Parameters:
pFilePath The file path.
Returns:
Cleaned path.
Examples:
ExportScene03/main.cxx.
KFBX_DLL KString KFbxGetRelativeFilePath ( const char *  pRootPath,
const char *  pNewFilePath 
)

Get the given new path's relative path to the given root path.

Parameters:
pRootPath The root path.
pNewFilePath The given new path.
Returns:
The relative path.
Examples:
ExportScene03/main.cxx.
KFBX_DLL bool KFbxIsRelativePath ( const char *  pFilePath )

Test if the given path is relative path, if it is return true.

Parameters:
pFilePath The given file path.
Returns:
True if it is a relative path, false otherwise.
KFBX_DLL bool KFbxFileExist ( const char *  pFilePath )

Find if the given file exist.If the given file without directory, it will find the file in the work directory.

Parameters:
pFilePath The given file path.
Returns:
True if the file exists, false otherwise.
Examples:
ProceduralTexture/main.cxx.
KFBX_DLL bool KFbxEnsureDirectoryExistance ( const char *  pFilePath )

Test if the given directory exists, if the directory does not exist, it will create this directory.

Parameters:
pFilePath The given file path
Returns:
True if the directory exists or is created successfully, False if the directory does not exist nor isn't created successfully.
Examples:
ExportScene03/main.cxx, and ProceduralTexture/main.cxx.
KFBX_DLL KString KFbxGetApplicationDirectory ( )

Get the application directory.

Returns:
The application directory.
Examples:
Common/Common.cxx, and ExportDocument/main.cxx.
KFBX_DLL KString KFbxMakeFullPath ( const char *  pRootPath,
const char *  pFilePath 
)

Get the full path.

Parameters:
pRootPath The root path.
pFilePath The file path.
KFBX_DLL KString KFbxGetCurrentDirectory ( )

Get the current path.

Returns:
The current directory.
Examples:
ProceduralTexture/main.cxx.
KFBX_DLL size_t KGetProcessVirtualMemoryAvailSize ( )

Returns the amount of virtual memory available to the process; will take into account swap file, and the process address space if there are such limits (ie: Win32 process can access 2, 3 or 4gb depending on the OS they're running on, Win64 has a much larger limit, limited possibly by the swap file)