FBX C++ API Reference
All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FbxRenamingStrategy Class Reference

#include <fbxrenamingstrategy.h>

Class Description

The FbxRenamingStrategy object can be set to rename all the objects in a scene.

It can remove name clashing, remove illegal characters, manage namespaces and manage backward compatibility. It is better to choose FbxSceneRenamer instead of this class to simplify the usage.

Remarks
This class implements a legacy renaming strategy where unsupported characters are replaced with the underscore character. Improved renaming strategies solvers can be implemented using the functions provided by the FbxRenamingStrategyUtils class and the FbxRenamingStrategyBase.
See also
FbxSceneRenamer

Definition at line 117 of file fbxrenamingstrategy.h.

+ Inheritance diagram for FbxRenamingStrategy:

Public Types

enum  EDirection { eToFBX, eFromFBX }
 The mode describing the convention direction, from FBX format or to FBX format. More...
 
enum  EClashType { eNameClashAuto, eNameClashType1, eNameClashType2 }
 

Public Member Functions

 FbxRenamingStrategy (EDirection pMod, bool pOnCreationRun=false)
 Constructor. More...
 
virtual ~FbxRenamingStrategy ()
 Destructor. More...
 
virtual bool Rename (FbxNameHandler &pName)
 Rename a name if necessary. More...
 
virtual void Clear ()
 Resets internal state regarding assigned names. More...
 
virtual FbxRenamingStrategyInterfaceClone ()
 Create a dynamic renaming strategy instance of the same type as the child class. More...
 
void SetClashSolverType (EClashType pType)
 Setup the strategy to perform this algorithm. More...
 
virtual char * GetNameSpace ()
 Get the namespace of the last renamed object. More...
 
virtual void SetInNameSpaceSymbol (FbxString pNameSpaceSymbol)
 Sets the current scene namespace symbol. More...
 
virtual void SetOutNameSpaceSymbol (FbxString pNameSpaceSymbol)
 Sets the wanted scene namespace symbol. More...
 
virtual void SetCaseSensibility (bool pIsCaseSensitive)
 Sets case sensitivity for name clashing. More...
 
virtual void SetReplaceNonAlphaNum (bool pReplaceNonAlphaNum)
 Sets the flag for character acceptance during renaming. More...
 
virtual void SetFirstNotNum (bool pFirstNotNum)
 Sets the flag for first character acceptance during renaming. More...
 
virtual bool RenameUnparentNameSpace (FbxNode *pNode, bool pIsRoot=false)
 Recursively renames all the unparented namespaced objects (Prefix mode) starting from this node. More...
 
virtual bool RemoveImportNameSpaceClash (FbxNode *pNode)
 Recursively removes all the unparented namespaced "key" starting from this node. More...
 
virtual void GetParentsNameSpaceList (FbxNode *pNode, FbxArray< FbxString *> &pNameSpaceList)
 Recursively get all the namespace starting from this node's parent. More...
 
virtual bool PropagateNameSpaceChange (FbxNode *pNode, FbxString OldNS, FbxString NewNS)
 Recursively replace the namespace starting from this node to its children. More...
 
- Public Member Functions inherited from FbxRenamingStrategyInterface
 FbxRenamingStrategyInterface ()
 Constructor. More...
 
virtual ~FbxRenamingStrategyInterface ()
 Destructor. More...
 

Member Enumeration Documentation

◆ EDirection

enum EDirection

The mode describing the convention direction, from FBX format or to FBX format.

  • eToFBX Convert to FBX format from another format.
  • eFromFBX Convert from FBX format to another format.
Enumerator
eToFBX 
eFromFBX 

Definition at line 124 of file fbxrenamingstrategy.h.

◆ EClashType

enum EClashType
  • eNameClashAuto
  • eNameClashType1
  • eNameClashType2
Enumerator
eNameClashAuto 
eNameClashType1 
eNameClashType2 

Definition at line 158 of file fbxrenamingstrategy.h.

Constructor & Destructor Documentation

◆ FbxRenamingStrategy()

FbxRenamingStrategy ( EDirection  pMod,
bool  pOnCreationRun = false 
)

Constructor.

Parameters
pModThe mode describing the convention direction, from FBX format or to FBX format.
pOnCreationRun

◆ ~FbxRenamingStrategy()

virtual ~FbxRenamingStrategy ( )
virtual

Destructor.

Member Function Documentation

◆ Rename()

virtual bool Rename ( FbxNameHandler pName)
virtual

Rename a name if necessary.

Parameters
pNameThe name to be renamed.
Returns
Return true on success, false otherwise.

Implements FbxRenamingStrategyInterface.

◆ Clear()

virtual void Clear ( )
virtual

Resets internal state regarding assigned names.

Implements FbxRenamingStrategyInterface.

◆ Clone()

virtual FbxRenamingStrategyInterface* Clone ( )
virtual

Create a dynamic renaming strategy instance of the same type as the child class.

Returns
New instance.

Implements FbxRenamingStrategyInterface.

◆ SetClashSolverType()

void SetClashSolverType ( EClashType  pType)

Setup the strategy to perform this algorithm.

Parameters
pType

◆ GetNameSpace()

virtual char* GetNameSpace ( )
inlinevirtual

Get the namespace of the last renamed object.

Returns
Char pointer to the namespace.

Definition at line 173 of file fbxrenamingstrategy.h.

173 { return mNameSpace.Buffer(); }

◆ SetInNameSpaceSymbol()

virtual void SetInNameSpaceSymbol ( FbxString  pNameSpaceSymbol)
inlinevirtual

Sets the current scene namespace symbol.

Parameters
pNameSpaceSymbolnamespace symbol.

Definition at line 178 of file fbxrenamingstrategy.h.

178 {mInNameSpaceSymbol = pNameSpaceSymbol;}

◆ SetOutNameSpaceSymbol()

virtual void SetOutNameSpaceSymbol ( FbxString  pNameSpaceSymbol)
inlinevirtual

Sets the wanted scene namespace symbol.

Parameters
pNameSpaceSymbolnamespace symbol.

Definition at line 183 of file fbxrenamingstrategy.h.

183 {mOutNameSpaceSymbol = pNameSpaceSymbol;}

◆ SetCaseSensibility()

virtual void SetCaseSensibility ( bool  pIsCaseSensitive)
inlinevirtual

Sets case sensitivity for name clashing.

Parameters
pIsCaseSensitiveSet to true to make the name clashing case sensitive.

Definition at line 188 of file fbxrenamingstrategy.h.

188 {mCaseSensitive = pIsCaseSensitive ;}

◆ SetReplaceNonAlphaNum()

virtual void SetReplaceNonAlphaNum ( bool  pReplaceNonAlphaNum)
inlinevirtual

Sets the flag for character acceptance during renaming.

Parameters
pReplaceNonAlphaNumSet to true to replace illegal characters with an underscore ("_").

Definition at line 193 of file fbxrenamingstrategy.h.

193 {mReplaceNonAlphaNum = pReplaceNonAlphaNum;}

◆ SetFirstNotNum()

virtual void SetFirstNotNum ( bool  pFirstNotNum)
inlinevirtual

Sets the flag for first character acceptance during renaming.

Parameters
pFirstNotNumSet to true to add an underscore to the name if the first character is a number.

Definition at line 198 of file fbxrenamingstrategy.h.

198 {mFirstNotNum = pFirstNotNum;}

◆ RenameUnparentNameSpace()

virtual bool RenameUnparentNameSpace ( FbxNode pNode,
bool  pIsRoot = false 
)
virtual

Recursively renames all the unparented namespaced objects (Prefix mode) starting from this node.

Parameters
pNodeParent node.
pIsRootThe root node.
Returns
true if the "_NSclash" have been added to one or more node.
Remarks
This function adds "_NSclash" when it encounters an unparented namespaced object.

◆ RemoveImportNameSpaceClash()

virtual bool RemoveImportNameSpaceClash ( FbxNode pNode)
virtual

Recursively removes all the unparented namespaced "key" starting from this node.

Parameters
pNodeParent node.
Returns
true if successfully removed the "_NSclash" from one or more nodes.
Remarks
This function removes "_NSclash" when encountered. This is the opposite from RenameUnparentNameSpace.

◆ GetParentsNameSpaceList()

virtual void GetParentsNameSpaceList ( FbxNode pNode,
FbxArray< FbxString *> &  pNameSpaceList 
)
virtual

Recursively get all the namespace starting from this node's parent.

Parameters
pNodeParent node.
pNameSpaceListoutput the namespace list from pNode's parent to the root node.

◆ PropagateNameSpaceChange()

virtual bool PropagateNameSpaceChange ( FbxNode pNode,
FbxString  OldNS,
FbxString  NewNS 
)
virtual

Recursively replace the namespace starting from this node to its children.

Parameters
pNodeCurrent node.
OldNSThe old namespace to be replaced with the NewNs.
NewNSThe new namespace to replace OldNs.
Returns
true if successfull
Remarks
This function only replaces the first occurence of OldNS with NewNS.

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