fbxobjectscontainer.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /****************************************************************************************
  2. Copyright (C) 2015 Autodesk, Inc.
  3. All rights reserved.
  4. Use of this software is subject to the terms of the Autodesk license agreement
  5. provided at the time of installation or download, or which otherwise accompanies
  6. this software in either electronic or hard copy form.
  7. ****************************************************************************************/
  8. //! \file fbxobjectscontainer.h
  9. #ifndef _FBXSDK_SCENE_OBJECTS_CONTAINER_H_
  10. #define _FBXSDK_SCENE_OBJECTS_CONTAINER_H_
  11. #include <fbxsdk/fbxsdk_def.h>
  12. #include <fbxsdk/core/base/fbxarray.h>
  13. #include <fbxsdk/scene/fbxscene.h>
  14. #include <fbxsdk/fbxsdk_nsbegin.h>
  15. typedef FbxArray<FbxNodeAttribute::EType> FbxAttributeFilters;
  16. /* Internal helper class used to traverse scene in the FbxAxisSystem and FbxSystemUnit
  17. */
  18. class FbxObjectsContainer
  19. {
  20. public:
  21. enum EDepth
  22. {
  23. eChildOnly,
  24. eChildAndSubChild,
  25. eSubChildWithNoScaleInherit
  26. };
  27. FbxObjectsContainer() : mStartNode(NULL) {}
  28. virtual ~FbxObjectsContainer(){ Clear(); }
  29. // Store all anim curve nodes pointers that need to be converted
  30. FbxArray<FbxAnimCurveNode*> mFCurvesT;
  31. FbxArray<FbxAnimCurveNode*> mFCurvesR;
  32. FbxArray<FbxAnimCurveNode*> mFCurvesS;
  33. // Store all node that need to be converted
  34. FbxArray<FbxNode*> mNodes;
  35. public:
  36. void ExtractSceneObjects(FbxScene* pScene, EDepth pDepth, const FbxAttributeFilters& pFilters);
  37. void ExtractSceneObjects(FbxNode* pRootNode, EDepth pDepth, const FbxAttributeFilters& pFilters);
  38. void Clear() { mFCurvesT.Clear(); mFCurvesR.Clear(); mFCurvesS.Clear(); mNodes.Clear(); mStartNode = NULL; }
  39. protected:
  40. // Extract all node and fcurve from all take for this node.
  41. void ExtractNodesAnimCurveNodes(FbxNode* pNode, EDepth pDepth, const FbxAttributeFilters& pFilters);
  42. void ExtractAnimCurveNodes(FbxNode* pNode);
  43. bool InheritsScale( FbxNode* pNode ) const;
  44. FbxNode* mStartNode;
  45. };
  46. #include <fbxsdk/fbxsdk_nsend.h>
  47. #endif /* _FBXSDK_SCENE_OBJECTS_CONTAINER_H_ */