1 // Copyright 2001-2018 Crytek GmbH / Crytek Group. All rights reserved.
2 // Utilities for FbxTool.
11 static const char* const kDefaultTextureName
= "<anonymous>";
13 const char* const* GetSupportedFileExtensions(TIndex
& numExtensions
)
15 static const char* ppExtensions
[] =
23 numExtensions
= (TIndex
)(sizeof(ppExtensions
) / sizeof(*ppExtensions
));
27 string
GetNodePath(FbxNode
* pNode
, const char* szLastName
)
29 static const char kSeparator
= '/';
30 const char szSeparator
[] = { kSeparator
, 0 };
31 const char szRootName
[] = "<root>";
34 if (pNode
!= nullptr && !pNode
->GetParent())
38 while (pNode
!= nullptr && pNode
->GetParent() != nullptr)
40 string nodeDescription
;
41 const char* const szName
= pNode
->GetName();
42 if (szName
&& szName
[0])
44 nodeDescription
= szName
;
49 const FbxNode
* const pParent
= pNode
->GetParent();
52 const int numChildren
= pParent
->GetChildCount();
53 for (int i
= 0; i
< numChildren
; ++i
)
55 if (pParent
->GetChild(i
) == pNode
)
64 char szDescription
[100];
65 std::sprintf(szDescription
, "<node at index %d>", nodeIndex
);
66 nodeDescription
= szDescription
;
70 nodeDescription
= "<anonymous node>";
75 result
.swap(nodeDescription
);
79 result
= nodeDescription
+ szSeparator
+ result
;
81 pNode
= pNode
->GetParent();
87 if (szLastName
&& szLastName
[0])
89 result
= result
+ szSeparator
+ szLastName
;