FBX C++ API Reference
fbxnode.h
Go to the documentation of this file.
1 /****************************************************************************************
2 
3  Copyright (C) 2015 Autodesk, Inc.
4  All rights reserved.
5 
6  Use of this software is subject to the terms of the Autodesk license agreement
7  provided at the time of installation or download, or which otherwise accompanies
8  this software in either electronic or hard copy form.
9 
10 ****************************************************************************************/
11 
13 #ifndef _FBXSDK_SCENE_GEOMETRY_NODE_H_
14 #define _FBXSDK_SCENE_GEOMETRY_NODE_H_
15 
16 #include <fbxsdk/fbxsdk_def.h>
17 
18 #include <fbxsdk/core/fbxobject.h>
20 
21 #include <fbxsdk/fbxsdk_nsbegin.h>
22 
23 class FbxStatus;
24 class FbxNodeAttribute;
25 class FbxCachedEffect;
26 class FbxLODGroup;
27 class FbxNull;
28 class FbxMarker;
29 class FbxSkeleton;
30 class FbxGeometry;
31 class FbxMesh;
32 class FbxNurbs;
33 class FbxNurbsCurve;
34 class FbxLine;
35 class FbxNurbsSurface;
37 class FbxPatch;
38 class FbxCamera;
39 class FbxCameraStereo;
40 class FbxCameraSwitcher;
41 class FbxLight;
43 class FbxSubDiv;
44 class FbxCharacter;
45 class FbxSurfaceMaterial;
46 class FbxAnimStack;
48 
73 {
75 
76 public:
84  FbxNode* GetParent();
85  const FbxNode* GetParent() const;
86 
94  bool AddChild(FbxNode* pNode);
95 
100  FbxNode* RemoveChild(FbxNode* pNode);
101 
106  int GetChildCount(bool pRecursive = false) const;
107 
112  FbxNode* GetChild(int pIndex);
113 
118  const FbxNode* GetChild(int pIndex) const;
119 
127  FbxNode* FindChild(const char* pName, bool pRecursive=true, bool pInitial=false);
129 
157  void SetTarget(FbxNode* pNode);
158 
162  FbxNode* GetTarget() const;
163 
167  void SetPostTargetRotation(FbxVector4 pVector);
168 
172  FbxVector4 GetPostTargetRotation() const;
173 
177  void SetTargetUp(FbxNode* pNode);
178 
182  FbxNode* GetTargetUp() const;
183 
187  void SetTargetUpVector(FbxVector4 pVector);
188 
192  FbxVector4 GetTargetUpVector() const;
194 
212  void SetVisibility(bool pIsVisible);
213 
219  bool GetVisibility() const;
220 
228  {
234  eFullShading
235  };
236 
240  void SetShadingMode(EShadingMode pShadingMode);
241 
245  EShadingMode GetShadingMode() const;
247 
261  FbxNodeAttribute* SetNodeAttribute(FbxNodeAttribute* pNodeAttribute);
262 
268  FbxNodeAttribute* GetNodeAttribute();
269 
275  const FbxNodeAttribute* GetNodeAttribute() const;
276 
278  int GetNodeAttributeCount() const;
279 
284  int GetDefaultNodeAttributeIndex() const;
285 
292  bool SetDefaultNodeAttributeIndex(int pIndex, FbxStatus* pStatus = NULL);
293 
298  FbxNodeAttribute* GetNodeAttributeByIndex(int pIndex);
299 
304  const FbxNodeAttribute* GetNodeAttributeByIndex(int pIndex) const;
305 
314  int GetNodeAttributeIndex(FbxNodeAttribute* pNodeAttribute, FbxStatus* pStatus = NULL) const;
315 
327  bool AddNodeAttribute(FbxNodeAttribute* pNodeAttribute, FbxStatus* pStatus = NULL);
328 
333  FbxNodeAttribute* RemoveNodeAttribute(FbxNodeAttribute* pNodeAttribute);
334 
343  FbxNodeAttribute* RemoveNodeAttributeByIndex(int pIndex);
344 
350  FbxCachedEffect* GetCachedEffect();
351 
357  FbxLODGroup* GetLodGroup();
358 
364  FbxNull* GetNull();
365 
371  FbxMarker* GetMarker();
372 
378  FbxSkeleton* GetSkeleton();
379 
396  FbxGeometry* GetGeometry();
397 
406  FbxMesh* GetMesh();
407 
416  FbxNurbs* GetNurbs();
417 
426  FbxNurbsSurface* GetNurbsSurface();
427 
436  FbxNurbsCurve* GetNurbsCurve();
437 
446  FbxLine* GetLine();
447 
456  FbxTrimNurbsSurface* GetTrimNurbsSurface();
457 
466  FbxSubDiv* GetSubdiv();
467 
476  FbxPatch* GetPatch();
477 
483  FbxCamera* GetCamera();
484  const FbxCamera* GetCamera() const;
485 
491  FbxCameraStereo* GetCameraStereo();
492 
498  FbxCameraSwitcher* GetCameraSwitcher();
499 
505  FbxLight* GetLight();
506  const FbxLight* GetLight() const;
507 
513  FbxOpticalReference* GetOpticalReference();
515 
529  void SetTransformationInheritType(FbxTransform::EInheritType pInheritType);
530 
532  void GetTransformationInheritType(FbxTransform::EInheritType& pInheritType) const;
534 
654  {
656  eDestinationPivot
657  };
658 
662  {
664  ePivotReference
665  };
666 
671  void SetPivotState(EPivotSet pPivotSet, EPivotState pPivotState);
672 
679  void GetPivotState(EPivotSet pPivotSet, EPivotState& pPivotState) const;
680 
686  void SetRotationOrder(EPivotSet pPivotSet, EFbxRotationOrder pRotationOrder);
687 
692  void GetRotationOrder(EPivotSet pPivotSet, EFbxRotationOrder& pRotationOrder) const;
693 
703  void SetUseRotationSpaceForLimitOnly(EPivotSet pPivotSet, bool pUseForLimitOnly);
704 
709  bool GetUseRotationSpaceForLimitOnly(EPivotSet pPivotSet) const;
710 
716  void SetRotationActive(bool pVal);
717 
721  bool GetRotationActive() const;
722 
729  void SetQuaternionInterpolation(EPivotSet pPivotSet, EFbxQuatInterpMode pQuatIterp);
730 
735  EFbxQuatInterpMode GetQuaternionInterpolation(EPivotSet pPivotSet) const;
736 
745  void SetRotationStiffness(FbxVector4 pRotationStiffness);
746 
750  FbxVector4 GetRotationStiffness() const;
751 
760  void SetMinDampRange(FbxVector4 pMinDampRange);
761 
765  FbxVector4 GetMinDampRange() const;
766 
775  void SetMaxDampRange(FbxVector4 pMaxDampRange);
776 
780  FbxVector4 GetMaxDampRange() const;
781 
790  void SetMinDampStrength(FbxVector4 pMinDampStrength);
791 
795  FbxVector4 GetMinDampStrength() const;
796 
805  void SetMaxDampStrength(FbxVector4 pMaxDampStrength);
806 
810  FbxVector4 GetMaxDampStrength() const;
811 
817  void SetPreferedAngle(FbxVector4 pPreferedAngle);
818 
822  FbxVector4 GetPreferedAngle() const;
823 
829  void SetRotationOffset(EPivotSet pPivotSet, FbxVector4 pVector);
830 
836  const FbxVector4& GetRotationOffset(EPivotSet pPivotSet) const;
837 
844  void SetRotationPivot(EPivotSet pPivotSet, FbxVector4 pVector);
845 
852  const FbxVector4& GetRotationPivot(EPivotSet pPivotSet) const;
853 
860  void SetPreRotation(EPivotSet pPivotSet, FbxVector4 pVector);
861 
868  const FbxVector4& GetPreRotation(EPivotSet pPivotSet) const;
869 
876  void SetPostRotation(EPivotSet pPivotSet, FbxVector4 pVector);
877 
884  const FbxVector4& GetPostRotation(EPivotSet pPivotSet) const;
885 
891  void SetScalingOffset(EPivotSet pPivotSet, FbxVector4 pVector);
892 
898  const FbxVector4& GetScalingOffset(EPivotSet pPivotSet) const;
899 
906  void SetScalingPivot(EPivotSet pPivotSet, FbxVector4 pVector);
907 
914  const FbxVector4& GetScalingPivot(EPivotSet pPivotSet) const;
915 
924  void SetGeometricTranslation(EPivotSet pPivotSet, FbxVector4 pVector);
925 
930  FbxVector4 GetGeometricTranslation(EPivotSet pPivotSet) const;
931 
940  void SetGeometricRotation(EPivotSet pPivotSet, FbxVector4 pVector);
941 
946  FbxVector4 GetGeometricRotation(EPivotSet pPivotSet) const;
947 
956  void SetGeometricScaling(EPivotSet pPivotSet, FbxVector4 pVector);
957 
962  FbxVector4 GetGeometricScaling(EPivotSet pPivotSet) const;
963 
970  void ResetPivotSet( FbxNode::EPivotSet pPivotSet );
971 
1000  void ConvertPivotAnimationRecursive(FbxAnimStack* pAnimStack, EPivotSet pConversionTarget, double pFrameRate, bool pKeyReduce=true);
1001 
1015  void ResetPivotSetAndConvertAnimation(double pFrameRate=30.0, bool pKeyReduce=false, bool pToNodeCenter=true, bool pForceResetLimits=false);
1016 
1020  void SetRotationPivotAsCenterRecursive(FbxVector4 pParentGeometricOffset=FbxVector4());
1022 
1029  FbxAnimEvaluator* GetAnimationEvaluator() const;
1030 
1039  FbxAMatrix& EvaluateGlobalTransform(FbxTime pTime=FBXSDK_TIME_INFINITE, FbxNode::EPivotSet pPivotSet=FbxNode::eSourcePivot, bool pApplyTarget=false, bool pForceEval=false);
1040 
1052  FbxAMatrix& EvaluateLocalTransform(FbxTime pTime=FBXSDK_TIME_INFINITE, FbxNode::EPivotSet pPivotSet=FbxNode::eSourcePivot, bool pApplyTarget=false, bool pForceEval=false);
1053 
1063  FbxVector4& EvaluateLocalTranslation(FbxTime pTime=FBXSDK_TIME_INFINITE, FbxNode::EPivotSet pPivotSet=FbxNode::eSourcePivot, bool pApplyTarget=false, bool pForceEval=false);
1064 
1074  FbxVector4& EvaluateLocalRotation(FbxTime pTime=FBXSDK_TIME_INFINITE, FbxNode::EPivotSet pPivotSet=FbxNode::eSourcePivot, bool pApplyTarget=false, bool pForceEval=false);
1075 
1085  FbxVector4& EvaluateLocalScaling(FbxTime pTime=FBXSDK_TIME_INFINITE, FbxNode::EPivotSet pPivotSet=FbxNode::eSourcePivot, bool pApplyTarget=false, bool pForceEval=false);
1086 
1094  bool EvaluateGlobalBoundingBoxMinMaxCenter(FbxVector4& pBBoxMin, FbxVector4& pBBoxMax, FbxVector4& pBBoxCenter, const FbxTime& pTime=FBXSDK_TIME_INFINITE);
1095 
1104  bool EvaluateRayIntersectionPoint(FbxVector4& pOut, const FbxVector4& pRayOrigin, const FbxVector4& pRayDir, bool pCulling=false, const FbxTime& pTime=FBXSDK_TIME_INFINITE);
1106 
1114  int GetCharacterLinkCount() const;
1115 
1128  bool GetCharacterLink(int pIndex, FbxCharacter** pCharacter, int* pCharacterLinkType, int* pNodeId, int* pNodeSubId);
1129 
1141  int FindCharacterLink(FbxCharacter* pCharacter, int pCharacterLinkType, int pNodeId, int pNodeSubId) const;
1143 
1157  bool GetAnimationInterval(FbxTimeSpan& pInterval, FbxAnimStack* pAnimStack=NULL, int pAnimLayerId=0);
1158 
1167  int AddMaterial(FbxSurfaceMaterial* pMaterial);
1168 
1173  bool RemoveMaterial(FbxSurfaceMaterial* pMaterial);
1174 
1181  int GetMaterialCount() const;
1182 
1187  FbxSurfaceMaterial* GetMaterial(int pIndex) const;
1188 
1191  void RemoveAllMaterials();
1192 
1198  int GetMaterialIndex(const char* pName) const;
1200 
1213 
1222 
1231 
1251 
1270 
1271 
1280 
1289 
1298 
1307 
1316 
1330 
1339 
1348 
1358 
1368 
1369 
1379 
1389 
1399 
1409 
1418 
1429 
1438 
1447 
1456 
1465 
1474 
1483 
1499 
1508 
1517 
1527 
1537 
1547 
1557 
1567 
1577 
1586 
1600 
1609 
1618 
1628 
1638 
1648 
1658 
1668 
1678 
1687 
1696 
1705 
1706  // IK Settings
1708 
1717 
1726 
1735 
1744 
1753 
1762 
1771 
1780 
1789 
1798 
1807 
1816 
1825 
1834 
1843 
1845 
1853 
1861 
1885 
1894 
1903 
1912 
1924 
1925 /*****************************************************************************************************************************
1926 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
1927 *****************************************************************************************************************************/
1928 #ifndef DOXYGEN_SHOULD_SKIP_THIS
1929  class FBXSDK_DLL Pivot
1930  {
1931  public:
1932  static const FbxVector4 sZeroVector;
1933  static const FbxVector4 sOneVector;
1934 
1935  Pivot()
1936  {
1937  mRotationOffset = NULL;
1938  mRotationPivot = NULL;
1939  mPreRotation = NULL;
1940  mPostRotation = NULL;
1941  mScalingOffset = NULL;
1942  mScalingPivot = NULL;
1943  mGeometricTranslation = NULL;
1944  mGeometricRotation = NULL;
1945  mGeometricScaling = NULL;
1946  Reset();
1947  }
1948  ~Pivot() { Reset(); }
1949 
1950  void Reset()
1951  {
1952  FBX_SAFE_DELETE(mRotationOffset);
1953  FBX_SAFE_DELETE(mRotationPivot);
1954  FBX_SAFE_DELETE(mPreRotation);
1955  FBX_SAFE_DELETE(mPostRotation);
1956  FBX_SAFE_DELETE(mScalingOffset);
1957  FBX_SAFE_DELETE(mScalingPivot);
1958  FBX_SAFE_DELETE(mGeometricTranslation);
1959  FBX_SAFE_DELETE(mGeometricRotation);
1960  FBX_SAFE_DELETE(mGeometricScaling);
1961  mRotationOrder = eEulerXYZ;
1962  mRotationSpaceForLimitOnly = false;
1963  mPivotState = FbxNode::ePivotReference;
1964  mQuaternionInterpolate = eQuatInterpOff;
1965  }
1966 
1967  inline const FbxVector4& GetRotationOffset() const { return (mRotationOffset) ? *mRotationOffset : sZeroVector; }
1968  inline void SetRotationOffset(const FbxVector4& pV)
1969  {
1970  if( !mRotationOffset )
1971  {
1972  #if defined(__GNUC__) && (__GNUC__ < 4)
1973  mRotationOffset = FbxNew< FbxVector4 >((FbxVector4&)pV);
1974  #else
1975  mRotationOffset = FbxNew< FbxVector4 >(pV);
1976  #endif
1977  }
1978  else
1979  {
1980  *mRotationOffset = pV;
1981  }
1982  }
1983 
1984  inline const FbxVector4& GetRotationPivot() const { return (mRotationPivot) ? *mRotationPivot : sZeroVector; }
1985  inline void SetRotationPivot(const FbxVector4& pV)
1986  {
1987  if( !mRotationPivot )
1988  {
1989  #if defined(__GNUC__) && (__GNUC__ < 4)
1990  mRotationPivot = FbxNew< FbxVector4 >((FbxVector4&)pV);
1991  #else
1992  mRotationPivot = FbxNew< FbxVector4 >(pV);
1993  #endif
1994  }
1995  else
1996  {
1997  *mRotationPivot = pV;
1998  }
1999  }
2000 
2001  inline const FbxVector4& GetPreRotation() const { return (mPreRotation) ? *mPreRotation : sZeroVector; }
2002  inline void SetPreRotation(const FbxVector4& pV)
2003  {
2004  if( !mPreRotation )
2005  {
2006  #if defined(__GNUC__) && (__GNUC__ < 4)
2007  mPreRotation = FbxNew< FbxVector4 >((FbxVector4&)pV);
2008  #else
2009  mPreRotation = FbxNew< FbxVector4 >(pV);
2010  #endif
2011  }
2012  else
2013  {
2014  *mPreRotation = pV;
2015  }
2016  }
2017 
2018  inline const FbxVector4& GetPostRotation() const { return (mPostRotation) ? *mPostRotation : sZeroVector; }
2019  inline void SetPostRotation(const FbxVector4& pV)
2020  {
2021  if( !mPostRotation )
2022  {
2023  #if defined(__GNUC__) && (__GNUC__ < 4)
2024  mPostRotation = FbxNew< FbxVector4 >((FbxVector4&)pV);
2025  #else
2026  mPostRotation = FbxNew< FbxVector4 >(pV);
2027  #endif
2028  }
2029  else
2030  {
2031  *mPostRotation = pV;
2032  }
2033  }
2034 
2035  inline const FbxVector4& GetScalingOffset() const { return (mScalingOffset) ? *mScalingOffset : sZeroVector; }
2036  inline void SetScalingOffset(const FbxVector4& pV)
2037  {
2038  if( !mScalingOffset )
2039  {
2040  #if defined(__GNUC__) && (__GNUC__ < 4)
2041  mScalingOffset = FbxNew< FbxVector4 >((FbxVector4&)pV);
2042  #else
2043  mScalingOffset = FbxNew< FbxVector4 >(pV);
2044  #endif
2045  }
2046  else
2047  {
2048  *mScalingOffset = pV;
2049  }
2050  }
2051 
2052  inline const FbxVector4& GetScalingPivot() const { return (mScalingPivot) ? *mScalingPivot : sZeroVector; }
2053  inline void SetScalingPivot(const FbxVector4& pV)
2054  {
2055  if( !mScalingPivot )
2056  {
2057  #if defined(__GNUC__) && (__GNUC__ < 4)
2058  mScalingPivot = FbxNew< FbxVector4 >((FbxVector4&)pV);
2059  #else
2060  mScalingPivot = FbxNew< FbxVector4 >(pV);
2061  #endif
2062  }
2063  else
2064  {
2065  *mScalingPivot = pV;
2066  }
2067  }
2068 
2069  inline const FbxVector4& GetGeometricTranslation() const { return (mGeometricTranslation) ? *mGeometricTranslation : sZeroVector; }
2070  inline void SetGeometricTranslation(const FbxVector4& pV)
2071  {
2072  if( !mGeometricTranslation )
2073  {
2074  #if defined(__GNUC__) && (__GNUC__ < 4)
2075  mGeometricTranslation = FbxNew< FbxVector4 >((FbxVector4&)pV);
2076  #else
2077  mGeometricTranslation = FbxNew< FbxVector4 >(pV);
2078  #endif
2079  }
2080  else
2081  {
2082  *mGeometricTranslation = pV;
2083  }
2084  }
2085 
2086  inline const FbxVector4& GetGeometricRotation() const { return (mGeometricRotation) ? *mGeometricRotation : sZeroVector; }
2087  inline void SetGeometricRotation(const FbxVector4& pV)
2088  {
2089  if( !mGeometricRotation )
2090  {
2091  #if defined(__GNUC__) && (__GNUC__ < 4)
2092  mGeometricRotation = FbxNew< FbxVector4 >((FbxVector4&)pV);
2093  #else
2094  mGeometricRotation = FbxNew< FbxVector4 >(pV);
2095  #endif
2096  }
2097  else
2098  {
2099  *mGeometricRotation = pV;
2100  }
2101  }
2102 
2103  inline const FbxVector4& GetGeometricScaling() const { return (mGeometricScaling) ? *mGeometricScaling : sOneVector; }
2104  inline void SetGeometricScaling(const FbxVector4& pV)
2105  {
2106  if( !mGeometricScaling )
2107  {
2108  #if defined(__GNUC__) && (__GNUC__ < 4)
2109  mGeometricScaling = FbxNew< FbxVector4 >((FbxVector4&)pV);
2110  #else
2111  mGeometricScaling = FbxNew< FbxVector4 >(pV);
2112  #endif
2113  }
2114  else
2115  {
2116  *mGeometricScaling = pV;
2117  }
2118  }
2119 
2120  inline EFbxRotationOrder GetRotationOrder() const { return mRotationOrder; }
2121  inline void SetRotationOrder(EFbxRotationOrder pROrder) { mRotationOrder = pROrder; }
2122  inline bool GetRotationSpaceForLimitOnly() const { return mRotationSpaceForLimitOnly; }
2123  inline void SetRotationSpaceForLimitOnly(bool pVal) { mRotationSpaceForLimitOnly = pVal; }
2124  inline EFbxQuatInterpMode GetQuaternionInterpolate() const { return mQuaternionInterpolate; }
2125  inline void SetQuaternionInterpolate(EFbxQuatInterpMode pVal) { mQuaternionInterpolate = pVal; }
2126  inline FbxNode::EPivotState GetPivotState() const { return mPivotState; }
2127  inline void SetPivotState(FbxNode::EPivotState pVal) { mPivotState = pVal; }
2128 
2129  private:
2130  FbxVector4* mRotationOffset;
2131  FbxVector4* mRotationPivot;
2132  FbxVector4* mPreRotation;
2133  FbxVector4* mPostRotation;
2134  FbxVector4* mScalingOffset;
2135  FbxVector4* mScalingPivot;
2136  FbxVector4* mGeometricTranslation;
2137  FbxVector4* mGeometricRotation;
2138  FbxVector4* mGeometricScaling;
2139  EFbxRotationOrder mRotationOrder;
2140  bool mRotationSpaceForLimitOnly;
2141  EFbxQuatInterpMode mQuaternionInterpolate;
2142  FbxNode::EPivotState mPivotState;
2143  };
2144 
2145  class FBXSDK_DLL Pivots
2146  {
2147  public:
2148  Pivots()
2149  {
2150  for( int i = 0; i < 2; i++ )
2151  {
2152  mIsDefault[i] = true;
2153  mPivotState[i] = FbxNode::ePivotReference;
2154  mPivot[i] = NULL;
2155  }
2156  }
2157 
2158  ~Pivots()
2159  {
2160  FbxDelete(mPivot[0]);
2161  FbxDelete(mPivot[1]);
2162  }
2163 
2164  Pivot& Get(int id)
2165  {
2166  FBX_ASSERT(id == 0 || id == 1);
2167  if (mPivot[id] == NULL && mIsDefault[id])
2168  {
2169  smDefaultPivot.SetPivotState(mPivotState[id]);
2170  return smDefaultPivot;
2171  }
2172 
2173  if (!mPivot[id])
2174  mPivot[id] = FbxNew< Pivot >();
2175 
2176  FBX_ASSERT(mPivot[id] != NULL);
2177  if (mPivot[id])
2178  mPivot[id]->SetPivotState(mPivotState[id]);
2179 
2180  return *mPivot[id];
2181  }
2182 
2183  #define MACRO_PIVOT_VECTOR_FCTS(name, defVect) \
2184  inline const FbxVector4& Get##name(int id) const \
2185  {\
2186  FBX_ASSERT(id == 0 || id == 1); \
2187  Pivot* p = mPivot[id]; \
2188  if (p == NULL) p = &smDefaultPivot; \
2189  return p->Get##name(); \
2190  }\
2191  inline void Set##name(int id, const FbxVector4& pV) \
2192  {\
2193  FBX_ASSERT(id == 0 || id == 1); \
2194  if (mIsDefault[id] && pV[0] == defVect[0] && pV[1] == defVect[1] && pV[2] == defVect[2]) return; \
2195  mIsDefault[id] = false; \
2196  Get(id).Set##name(pV); \
2197  }
2198 
2199  MACRO_PIVOT_VECTOR_FCTS(RotationOffset, Pivot::sZeroVector);
2200  MACRO_PIVOT_VECTOR_FCTS(RotationPivot, Pivot::sZeroVector);
2201  MACRO_PIVOT_VECTOR_FCTS(PreRotation, Pivot::sZeroVector);
2202  MACRO_PIVOT_VECTOR_FCTS(PostRotation, Pivot::sZeroVector);
2203  MACRO_PIVOT_VECTOR_FCTS(ScalingOffset, Pivot::sZeroVector);
2204  MACRO_PIVOT_VECTOR_FCTS(ScalingPivot, Pivot::sZeroVector);
2205  MACRO_PIVOT_VECTOR_FCTS(GeometricTranslation, Pivot::sZeroVector);
2206  MACRO_PIVOT_VECTOR_FCTS(GeometricRotation, Pivot::sZeroVector);
2207  MACRO_PIVOT_VECTOR_FCTS(GeometricScaling, Pivot::sOneVector);
2208 
2209  #define MACRO_PIVOT_BOOL_FCTS(name) \
2210  inline bool Get##name(int id) const \
2211  {\
2212  FBX_ASSERT(id == 0 || id == 1); \
2213  Pivot* p = mPivot[id]; \
2214  if (p == NULL) p = &smDefaultPivot; \
2215  return p->Get##name(); \
2216  }\
2217  inline void Set##name(int id, bool pV) \
2218  {\
2219  FBX_ASSERT(id == 0 || id == 1); \
2220  mIsDefault[id] = false; \
2221  Get(id).Set##name(pV); \
2222  }
2223 
2224  MACRO_PIVOT_BOOL_FCTS(RotationSpaceForLimitOnly);
2225 
2226  inline EFbxQuatInterpMode GetQuaternionInterpolate(int id) const
2227  {
2228  FBX_ASSERT(id == 0 || id == 1);
2229  Pivot* p = mPivot[id];
2230  if (p == NULL) p = &smDefaultPivot;
2231  return p->GetQuaternionInterpolate();
2232  }
2233 
2234  inline void SetQuaternionInterpolate(int id, EFbxQuatInterpMode pV)
2235  {
2236  FBX_ASSERT(id == 0 || id == 1);
2237  // If pivot has default values, and we want to set default eQuatInterpOff,
2238  // return to avoid allocating memory for the pivot (in Get(id).)
2239  if (mIsDefault[id] && pV == eQuatInterpOff) return;
2240  mIsDefault[id] = false;
2241  Get(id).SetQuaternionInterpolate(pV);
2242  }
2243 
2244  inline EFbxRotationOrder GetRotationOrder(int id) const
2245  {
2246  FBX_ASSERT(id == 0 || id == 1);
2247  Pivot* p = mPivot[id];
2248  if (p == NULL) p = &smDefaultPivot;
2249  return p->GetRotationOrder();
2250  }
2251 
2252  inline void SetRotationOrder(int id, EFbxRotationOrder pROrder)
2253  {
2254  FBX_ASSERT(id == 0 || id == 1);
2255  // If pivot has default values, and we want to set default rotation order eEulerXYZ,
2256  // return to avoid allocating memory for the pivot (in Get(id).)
2257  if (mIsDefault[id] && pROrder == eEulerXYZ) return;
2258  mIsDefault[id] = false;
2259  Get(id).SetRotationOrder(pROrder);
2260  }
2261 
2262  inline FbxNode::EPivotState GetPivotState(int id) const
2263  {
2264  FBX_ASSERT(id == 0 || id == 1);
2265  return mPivotState[id];
2266  }
2267 
2268  inline void SetPivotState(int id, FbxNode::EPivotState pVal)
2269  {
2270  FBX_ASSERT(id == 0 || id == 1);
2271  if (pVal == FbxNode::ePivotReference) return;
2272  mPivotState[id] = pVal;
2273  if (mPivot[id])
2274  mPivot[id]->SetPivotState(pVal);
2275  }
2276 
2277  #undef MACRO_PIVOT_VECTOR_FCTS
2278  #undef MACRO_PIVOT_BOOL_FCTS
2279 
2280  void Reset()
2281  {
2282  smDefaultPivot.Reset();
2283  for (int i = 0; i < 2; i++)
2284  {
2285  mIsDefault[i] = true;
2286  mPivotState[i] = FbxNode::ePivotReference;
2287  if (mPivot[i]) mPivot[i]->Reset();
2288  }
2289  }
2290 
2291  private:
2292  Pivot* mPivot[2];
2293  FbxNode::EPivotState mPivotState[2];
2294  bool mIsDefault[2];
2295  static Pivot smDefaultPivot;
2296  };
2297 
2298  class FBXSDK_DLL LinkToCharacter
2299  {
2300  public:
2301  bool operator==(LinkToCharacter& pLinkToCharacter)
2302  {
2303  if (mCharacter == pLinkToCharacter.mCharacter &&
2304  mType == pLinkToCharacter.mType &&
2305  mIndex == pLinkToCharacter.mIndex &&
2306  mSubIndex == pLinkToCharacter.mSubIndex)
2307  {
2308  return true;
2309  }
2310  else return false;
2311  }
2312 
2313  FbxCharacter* mCharacter;
2314  int mType;
2315  int mIndex;
2316  int mSubIndex;
2317  };
2318 
2319  void AddChildName(const char* pChildName);
2320  char* GetChildName(FbxUInt pIndex) const;
2321  FbxUInt GetChildNameCount() const;
2322 
2323  FbxTransform& GetTransform();
2324  FbxLimits& GetTranslationLimits();
2325  FbxLimits& GetRotationLimits();
2326  FbxLimits& GetScalingLimits();
2327  Pivots& GetPivots();
2328 
2329  void UpdatePivotsAndLimitsFromProperties();
2330  void UpdatePropertiesFromPivotsAndLimits();
2331 
2332  void SetRotationActiveProperty(bool pVal);
2333  void PivotSetToMBTransform(EPivotSet pPivotSet);
2334 
2335  int AddCharacterLink(FbxCharacter* pCharacter, int pCharacterLinkType, int pNodeId, int pNodeSubId);
2336  int RemoveCharacterLink(FbxCharacter* pCharacter, int pCharacterLinkType, int pNodeId, int pNodeSubId);
2337 
2338  // Duplicate this node as well as all its node attributes and the Target and UpTarget objects.
2339  FbxNode* DeepCloneWithNodeAttributes();
2340 
2341  FbxObject& Copy(const FbxObject& pObject) override;
2342  const char* GetTypeName() const override;
2343  FbxStringList GetTypeFlags() const override;
2344  bool PropertyNotify(EPropertyNotifyType pType, FbxProperty& pProperty) override;
2345 
2346  enum ECullingType
2347  {
2348  eCullingOff,
2349  eCullingOnCCW,
2350  eCullingOnCW
2351  };
2352 
2353  ECullingType mCullingType;
2354  bool mCorrectInheritType;
2355 
2356 protected:
2357  void Construct(const FbxObject* pFrom) override;
2358  void ConstructProperties(bool pForceSet) override;
2359  void Destruct(bool pRecursive) override;
2360 
2361  void Reset();
2362  bool GetAnimationIntervalRecursive(FbxTimeSpan& pTimeInterval, FbxAnimLayer* pAnimLayer);
2363 
2364 private:
2365  typedef FbxSet<FbxHandle> GeomInstSet;
2366 
2367  void ResetLimitsRecursive(FbxNode* pNode);
2368 
2369  void ConvertPivotAnimationRecurseLoop(FbxAnimStack* pAnimStack, const EPivotSet pConversionTarget, const double pFrameRate, const bool pKeyReduce, GeomInstSet& pGeomInstSet);
2370  void ConvertPivotAnimation(FbxAnimStack* pAnimStack, const EPivotSet pConversionTarget, const double pFrameRate, const bool pKeyReduce, GeomInstSet& pGeomInstSet);
2371  bool ConvertPivotAnimation_SetupMatrixConverter(FbxAnimCurveFilterMatrixConverter& pConverter, const EPivotSet& pSrcSet, const EPivotSet& pDstSet, const double pFrameRate, const bool pKeyReduce, GeomInstSet& pGeomInstSet);
2372  void ConvertPivotAnimation_ApplyGeometryPivot(const EPivotSet& pSrcSet, const EPivotSet& pDstSet, GeomInstSet& pGeomInstSet);
2373 
2374  FbxTransform mTransform;
2375  Pivots mPivots;
2376  FbxObject* mAnimCurveNodeContainer;
2377  FbxArray<FbxString*> mChildrenNameList;
2378  FbxVector4 mPostTargetRotation;
2379  FbxVector4 mTargetUpVector;
2380  FbxNode::EShadingMode mShadingMode;
2381  FbxArray<LinkToCharacter> mLinkToCharacter;
2382 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
2383 };
2384 
2388 
2389 #include <fbxsdk/fbxsdk_nsend.h>
2390 
2391 #endif /* _FBXSDK_SCENE_GEOMETRY_NODE_H_ */
FbxPropertyT< FbxEuler::EOrder > RotationOrder
This property contains the rotation order information of the node.
Definition: fbxnode.h:1417
unsigned int FbxUInt
Definition: fbxtypes.h:40
The animation layer is a collection of animation curve nodes.
Definition: fbxanimlayer.h:30
#define FBXSDK_OBJECT_DECLARE(Class, Parent)
Macro used to declare a new class derived from FbxObject.
Definition: fbxobject.h:61
FbxPropertyT< EFbxQuatInterpMode > QuaternionInterpolate
This property contains the quaternion interpolate flag of the node.
Definition: fbxnode.h:1279
Solid geometries rendered with the scene lights.
Definition: fbxnode.h:232
FBX SDK environment definition.
The Animation stack is a collection of animation layers.
Definition: fbxanimstack.h:37
The source pivot context.
Definition: fbxnode.h:655
FbxPropertyT< FbxBool > ScalingMinY
This property enables or disables the limit on scaling Y.
Definition: fbxnode.h:1637
FbxPropertyT< FbxBool > TranslationMaxX
This property enables or disables the limit on translation X.
Definition: fbxnode.h:1388
#define eEulerXYZ
Definition: fbxmath.h:95
FbxPropertyT< FbxDouble3 > RotationMax
This property sets the maximum rotation values the object can occupy on each individual axis...
Definition: fbxnode.h:1516
FbxPropertyT< FbxBool > RotationMaxY
This property enables or disables the limit on rotation Y.
Definition: fbxnode.h:1566
FbxPropertyT< FbxBool > TranslationMaxY
This property enables or disables the limit on translation Y.
Definition: fbxnode.h:1398
EPivotSet
Pivot context identifier.
Definition: fbxnode.h:653
EFbxQuatInterpMode
Quaternion interpolation modes.
Definition: fbxmath.h:106
#define NULL
Definition: fbxarch.h:213
FbxPropertyT< FbxBool > RotationSpaceForLimitOnly
This property contains the rotation space for limit only flag of the node.
Definition: fbxnode.h:1428
Array that stores pairs of FbxString and a pointer.
This class contains material settings.
This node attribute contains the properties of an optical reference.
FbxPropertyT< FbxBool > ScalingMinX
This property activates or disables the limit on scaling X.
Definition: fbxnode.h:1627
FbxPropertyT< FbxDouble3 > ScalingPivot
This property contains the scaling pivot information of the node.
Definition: fbxnode.h:1315
void FbxDelete(T *p)
Deletion policy for pointer template classes that uses the FbxDelete() function.
Definition: fbxnew.h:341
This node attribute contains methods for accessing the properties of a camera switcher.
This class facilitates the testing/reporting of errors.
Definition: fbxstatus.h:29
FbxPropertyT< FbxBool > TranslationMinY
This property enables or disables the limit on translation Y.
Definition: fbxnode.h:1367
FbxPropertyT< FbxBool > VisibilityInheritance
This property contains the visibility inheritance flag that allow applications to modify the Visibili...
Definition: fbxnode.h:1269
Do not evaluate using quaternion interpolation.
Definition: fbxmath.h:108
FbxPropertyT< FbxDouble3 > ScalingOffset
This property contains the scaling offset information of the node.
Definition: fbxnode.h:1306
The pivot context with this state is not used during the node transform computation but can be access...
Definition: fbxnode.h:664
FbxPropertyT< FbxReference > UpVectorProperty
This property contains the up vector property of the node.
Definition: fbxnode.h:1860
FbxPropertyT< FbxDouble3 > GeometricTranslation
This property contains geometric translation information of the node.
Definition: fbxnode.h:1686
Handle transform behaviors such as pivots, limits and offets, etc.
FbxPropertyT< FbxDouble > PreferedAngleX
This property contains the x component of the preferred angle of the node.
Definition: fbxnode.h:1824
This node attribute contains the properties of a marker.
Definition: fbxmarker.h:26
FbxPropertyT< FbxDouble > MaxDampStrengthZ
This property contains the z component of the maximum damp strength of the node.
Definition: fbxnode.h:1815
The pivot context with this state is affecting the node's transform computation.
Definition: fbxnode.h:663
#define FBXSDK_TIME_INFINITE
Definition: fbxtime.h:23
FbxPropertyT< FbxBool > ScalingMinZ
This property enables or disables the limit on scaling Z.
Definition: fbxnode.h:1647
FbxPropertyT< FbxDouble > MinDampRangeY
This property contains the y component of the minimum damp range angles of the node.
Definition: fbxnode.h:1725
FbxPropertyT< FbxDouble3 > RotationMin
This property sets the minimum rotation values the object can occupy on each individual axis...
Definition: fbxnode.h:1507
FbxPropertyT< FbxDouble3 > LclScaling
This property contains the scaling information of the node.
Definition: fbxnode.h:1230
FbxPropertyT< FbxDouble3 > PostRotation
This property contains post-rotation information of the node.
Definition: fbxnode.h:1482
FbxPropertyT< FbxTransform::EInheritType > InheritType
This property contains inherit type information of the node.
Definition: fbxnode.h:1585
FbxPropertyT< FbxInt > DefaultAttributeIndex
This property contains default attribute index information of the node.
Definition: fbxnode.h:1902
#define EFbxRotationOrder
Rotation order flags.
Definition: fbxmath.h:94
FbxPropertyT< FbxDouble > Visibility
This property contains the visibility information of the node.
Definition: fbxnode.h:1250
FbxPropertyT< FbxDouble > AxisLen
This property contains axis length information of the node.
Definition: fbxnode.h:1464
EFbxType
Type identifier constants.
FbxPropertyT< FbxBool > RotationActive
This property enables or disables the limit on rotation.
Definition: fbxnode.h:1498
Class to encapsulate time units.
Definition: fbxtime.h:44
FbxPropertyT< FbxDouble3 > PreRotation
This property contains pre-rotation information of the node.
Definition: fbxnode.h:1473
FbxPropertyT< FbxDouble > RotationStiffnessY
This property contains the y value of the rotation stiffness of the node.
Definition: fbxnode.h:1446
The base class of most FBX objects.
Definition: fbxobject.h:157
FbxPropertyT< FbxDouble > MaxDampRangeZ
This property contains the z component of the maximum damp range angles of the node.
Definition: fbxnode.h:1761
FbxLimits defines a limit range for one transform component, either translation, rotation or scaling...
Definition: fbxtransforms.h:34
FbxPropertyT< FbxBool > TranslationMinZ
This property enables or disables the limit on translation Z.
Definition: fbxnode.h:1378
FbxPropertyT< FbxBool > ScalingActive
This property enables or disables the limit on scaling.
Definition: fbxnode.h:1599
FbxPropertyT< FbxDouble > MaxDampStrengthX
This property contains the x component of the maximum damp strength of the node.
Definition: fbxnode.h:1797
EShadingMode
Shading modes.
Definition: fbxnode.h:227
FbxTrimNurbsSurface describes a NURBS surface with regions trimmed or cut away with trimming boundari...
Represents an element in the scene graph.
Definition: fbxnode.h:72
A patch is a type of node attribute with parametric surface.
Definition: fbxpatch.h:26
FbxPropertyT< FbxDouble > MinDampStrengthY
This property contains the y component of the minimum damp strength of the node.
Definition: fbxnode.h:1779
FbxPropertyT< FbxBool > TranslationActive
This property enables or disables the limit on translation.
Definition: fbxnode.h:1329
This node attribute contains methods for accessing the properties of a light.
Definition: fbxlight.h:27
FbxPropertyT< FbxDouble > MinDampRangeX
This property contains the x component of the minimum damp range angles of the node.
Definition: fbxnode.h:1716
FbxPropertyT< FbxDouble3 > ScalingMax
This property sets the maximum scaling values the object can occupy on each individual axis...
Definition: fbxnode.h:1617
FbxPropertyT< FbxBool > RotationMaxX
This property enables or disables the limit on rotation X.
Definition: fbxnode.h:1556
FbxPropertyT< FbxBool > Show
This property contains the show information of the node.
Definition: fbxnode.h:1884
FbxPropertyT< FbxDouble > MinDampRangeZ
This property contains the z component of the minimum damp range angles of the node.
Definition: fbxnode.h:1734
This class implements an efficient set based on value comparison, which stores values.
Definition: fbxset.h:25
A NURBS surface is a type of parametric geometry.
FbxPropertyT< FbxDouble3 > RotationOffset
This property contains the rotation offset information of the node.
Definition: fbxnode.h:1288
FbxPropertyT< FbxBool > TranslationMaxZ
This property enables or disables the limit on translation Z.
Definition: fbxnode.h:1408
FbxPropertyT< FbxDouble3 > LclTranslation
This property contains the translation information of the node.
Definition: fbxnode.h:1212
FbxPropertyT< FbxDouble > MaxDampRangeY
This property contains the y component of the maximum damp range angles of the node.
Definition: fbxnode.h:1752
FbxPropertyT< FbxDouble3 > GeometricRotation
This property contains geometric rotation information of the node.
Definition: fbxnode.h:1695
FbxPropertyT< FbxBool > RotationMinY
This property enables or disables the limit on rotation Y.
Definition: fbxnode.h:1536
FbxPropertyT< FbxReference > LookAtProperty
This property contains lookat property of the node.
Definition: fbxnode.h:1852
FbxPropertyT< FbxDouble3 > TranslationMax
This property sets the maximum translation values the object can occupy on each individual axis...
Definition: fbxnode.h:1347
FbxPropertyT< FbxBool > TranslationMinX
This property enables or disables the limit on translation X.
Definition: fbxnode.h:1357
FbxPropertyT< FbxBool > ScalingMaxX
This property enables or disables the limit on scaling X.
Definition: fbxnode.h:1657
FbxPropertyT< FbxDouble3 > TranslationMin
This property sets the minimum translation values the object can occupy on each individual axis...
Definition: fbxnode.h:1338
The principal interface for animation evaluators.
EFbxType FbxTypeOf(const FbxEuler::EOrder &)
Definition: fbxnode.h:2385
FbxPropertyT< FbxDouble > MinDampStrengthZ
This property contains the z component of the minimum damp strength of the node.
Definition: fbxnode.h:1788
Enumeration.
Class to hold user properties.
Definition: fbxproperty.h:39
FbxPropertyT< FbxBool > LODBox
This property contains level of detail mode information of the node.
Definition: fbxnode.h:1922
A four double mathematic vector class.
Definition: fbxvector4.h:25
FBX SDK affine matrix class.
FbxPropertyT< FbxDouble > MinDampStrengthX
This property contains the x component of the minimum damp strength of the node.
Definition: fbxnode.h:1770
Solid geometries rendered faceted - using the system light.
Definition: fbxnode.h:231
#define FBX_SAFE_DELETE(p)
Definition: fbxsdk_def.h:53
FbxPropertyT< FbxDouble > PreferedAngleY
This property contains the y component of the preferred angle of the node.
Definition: fbxnode.h:1833
This node attribute contains methods for accessing the properties of a camera.
Definition: fbxcamera.h:34
FbxPropertyT< FbxDouble3 > GeometricScaling
This property contains geometric scaling information of the node.
Definition: fbxnode.h:1704
FbxPropertyT< FbxBool > RotationMinX
This property enables or disables the limit on rotation X.
Definition: fbxnode.h:1526
FbxPropertyT< FbxDouble > PreferedAngleZ
This property contains the z component of the preferred angle of the node.
Definition: fbxnode.h:1842
#define FBXSDK_DLL
Definition: fbxarch.h:176
A NURBS surface is a type of parametric geometry.
Definition: fbxnurbs.h:31
A Non-Uniform Rational B-Spline (NURBS) curve is a type of parametric geometry.
Definition: fbxnurbscurve.h:60
This node attribute contains the properties of a null node.
Definition: fbxnull.h:25
A cached effect is a type of node attribute to represent certain type of effect by an cache object...
FbxPropertyT< FbxBool > Freeze
This property contains manipulation state information of the node.
Definition: fbxnode.h:1911
This class specializes a node attribute to represent the elements forming "bone" chains.
Definition: fbxskeleton.h:34
A Character is a person or animal with pre-defined skeleton system.
Definition: fbxcharacter.h:109
Class to encapsulate time intervals.
Definition: fbxtime.h:510
The base class of geometric objects that support control point deformations (e.g. ...
Definition: fbxgeometry.h:45
FbxPropertyT< FbxDouble > RotationStiffnessZ
This property contains the z value of the rotation stiffness of the node.
Definition: fbxnode.h:1455
FbxPropertyT< FbxDouble3 > ScalingMin
This property sets the minimum scaling values the object can occupy on each individual axis...
Definition: fbxnode.h:1608
FbxPropertyT< FbxBool > ScalingMaxY
This property enables or disables the limit on scaling Y.
Definition: fbxnode.h:1667
FbxPropertyT< FbxBool > RotationMinZ
This property enables or disables the limit on rotation Z.
Definition: fbxnode.h:1546
FbxPropertyT< FbxDouble3 > LclRotation
This property contains the rotation information of the node.
Definition: fbxnode.h:1221
FbxPropertyT< FbxDouble > RotationStiffnessX
This property contains the x value of the rotation stiffness of the node.
Definition: fbxnode.h:1437
Solid geometries rendered with smooth textured surfaces - using system light.
Definition: fbxnode.h:233
FbxPropertyT< FbxDouble3 > RotationPivot
This property contains the rotation pivot information of the node.
Definition: fbxnode.h:1297
This class is the base class to all types of node attributes.
FbxPropertyT< FbxDouble > MaxDampRangeX
This property contains the x component of the maximum damp range angles of the node.
Definition: fbxnode.h:1743
FbxPropertyT< FbxDouble > MaxDampStrengthY
This property contains the y component of the maximum damp strength of the node.
Definition: fbxnode.h:1806
FbxPropertyT< FbxBool > RotationMaxZ
This property enables or disables the limit on rotation Z.
Definition: fbxnode.h:1576
FbxPropertyT< FbxBool > NegativePercentShapeSupport
This property contains negative percent shape support information of the node.
Definition: fbxnode.h:1893
This template class is used to contain user properties of specific data types.
Definition: fbxproperty.h:1072
FbxPropertyT< FbxBool > ScalingMaxZ
This property enables or disables the limit on scaling Z.
Definition: fbxnode.h:1677
Solid geometries rendered with smooth surfaces - using the system light.
Definition: fbxnode.h:229
A line is a geometry made of points.
Definition: fbxline.h:34
EPivotState
Pivot context state.
Definition: fbxnode.h:661
Geometries displayed in wire frame.
Definition: fbxnode.h:230
A mesh is a geometry made of polygons.
Definition: fbxmesh.h:33
This node attribute contains methods for accessing the properties of a stereo camera.