FBX C++ API Reference
fbxpose.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_POSE_H_
14 #define _FBXSDK_SCENE_POSE_H_
15 
16 #include <fbxsdk/fbxsdk_def.h>
17 
18 #include <fbxsdk/core/fbxobject.h>
21 
22 #include <fbxsdk/fbxsdk_nsbegin.h>
23 
24 class FbxStatus;
25 class FbxPose;
26 class FbxNode;
28 
33 {
37 };
38 
42 
97 {
99 
100 public:
104  void SetIsBindPose(bool pIsBindPose);
105 
109  bool IsBindPose() const { return mType == 'b'; }
110 
114  bool IsRestPose() const { return mType == 'r'; }
115 
119  int GetCount() const { return mPoseInfo.GetCount(); }
120 
128  int Add(FbxNode* pNode, const FbxMatrix& pMatrix, bool pLocalMatrix = false, bool pMultipleBindPose = true);
129 
133  void Remove(int pIndex);
134 
140  FbxNameHandler GetNodeName(int pIndex) const;
141 
148  FbxNode* GetNode(int pIndex) const;
149 
156  const FbxMatrix& GetMatrix(int pIndex) const;
157 
163  bool IsLocalMatrix(int pIndex) const;
164 
173  {
174  eInitialNameComponent = 1,
175  eCurrentNameComponent = 2,
176  eAllNameComponents = 3
177  };
178 
184  int Find(const FbxNameHandler& pNodeName, char pCompareWhat = eAllNameComponents) const;
185 
190  int Find(const FbxNode* pNode) const;
192 
207  static bool GetPosesContaining(FbxManager& pManager, FbxNode* pNode, PoseList& pPoseList, FbxArray<int>& pIndex);
208 
218  static bool GetPosesContaining(FbxScene* pScene, FbxNode* pNode, PoseList& pPoseList, FbxArray<int>& pIndex);
219 
230  static bool GetBindPoseContaining(FbxManager& pManager, FbxNode* pNode, PoseList& pPoseList, FbxArray<int>& pIndex);
231 
241  static bool GetBindPoseContaining(FbxScene* pScene, FbxNode* pNode, PoseList& pPoseList, FbxArray<int>& pIndex);
242 
253  static bool GetRestPoseContaining(FbxManager& pManager, FbxNode* pNode, PoseList& pPoseList, FbxArray<int>& pIndex);
254 
264  static bool GetRestPoseContaining(FbxScene* pScene, FbxNode* pNode, PoseList& pPoseList, FbxArray<int>& pIndex);
265 
287  bool IsValidBindPose(FbxNode* pRoot, double pMatrixCmpTolerance=0.0001, FbxStatus* pStatus = NULL);
288 
303  bool IsValidBindPoseVerbose(FbxNode* pRoot, NodeList& pMissingAncestors, NodeList& pMissingDeformers, NodeList& pMissingDeformersAncestors, NodeList& pWrongMatrices, double pMatrixCmpTolerance=0.0001, FbxStatus* pStatus = NULL);
304 
316  bool IsValidBindPoseVerbose(FbxNode* pRoot, FbxUserNotification* pUserNotification, double pMatrixCmpTolerance=0.0001, FbxStatus* pStatus = NULL);
317 
319 
320 /*****************************************************************************************************************************
321 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
322 *****************************************************************************************************************************/
323 #ifndef DOXYGEN_SHOULD_SKIP_THIS
324  bool SetMatrix(int pIndex, const FbxMatrix& pMatrix);
325 
326 protected:
327  void Construct(const FbxObject* pFrom) override;
328  void Destruct(bool pRecursive) override;
329  void ConstructProperties(bool pForceSet) override;
330 
331  FbxObject& Copy(const FbxObject& pObject) override;
332  const char* GetTypeName() const override;
333 
334  //Returns false if pNode is already inserted in the list and the current matrix is different from the stored one. Also, if this pose is a rest pose, check if
335  //pNode belongs to other BindPoses (accessed through the scene pointer). pPos will contains the index of the FbxPoseInfo if the parameters are already stored in this object.
336  bool ValidateParams(const FbxNode* pNode, const FbxMatrix& pMatrix, int& pPos);
337 
338  bool LocalValidateParams(const FbxNode* pNode, const FbxMatrix& pMatrix, int& pPos);
339  static bool GetSpecificPoseContaining(int poseType, FbxScene* pScene, FbxNode* pNode, PoseList& pPoseList, FbxArray<int>& pIndex);
340 
341 private:
342  FbxPoseInfo* GetItem(int pIndex) const;
343  void UpdatePosInfoList();
344  bool IsValidBindPoseCommon(FbxNode* pRoot, NodeList* pMissingAncestors, NodeList* pMissingDeformers, NodeList* pMissingDeformersAncestors, NodeList* pWrongMatrices, FbxStatus* pStatus, double pMatrixCmpTolerance=0.0001);
345 
346  char mType;
347  PoseInfoList mPoseInfo;
348  bool mPoseInfoIsDirty;
350 
351 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
352 };
353 
354 #include <fbxsdk/fbxsdk_nsend.h>
355 
356 #endif /* _FBXSDK_SCENE_POSE_H_ */
#define FBXSDK_OBJECT_DECLARE(Class, Parent)
Macro used to declare a new class derived from FbxObject.
Definition: fbxobject.h:61
FbxMatrix mMatrix
Transform matrix of the node.
Definition: fbxpose.h:34
FBX SDK environment definition.
SDK object manager.
Definition: fbxmanager.h:56
FbxArray< FbxPoseInfo * > PoseInfoList
Definition: fbxpose.h:41
#define NULL
Definition: fbxarch.h:213
virtual FbxObject & Copy(const FbxObject &pObject)
Copy an object content into this object.
This class accumulates user notifications and sends them to any device opened by the derived classes...
FbxNode * mNode
FBX node, which may be skeleton or geometry (skinned) node.
Definition: fbxpose.h:36
bool mMatrixIsLocal
If true, the transform matrix above is defined in local coordinates.
Definition: fbxpose.h:35
This class facilitates the testing/reporting of errors.
Definition: fbxstatus.h:29
This structure contains the description of a named pose.
Definition: fbxpose.h:32
bool IsRestPose() const
Pose identifier flag.
Definition: fbxpose.h:114
The base class of most FBX objects.
Definition: fbxobject.h:157
Represents an element in the scene graph.
Definition: fbxnode.h:72
bool IsBindPose() const
Pose identifier flag.
Definition: fbxpose.h:109
This class contains the description of a 3D scene.
Definition: fbxscene.h:61
This class contains the description of a Pose and provide some methods to access Pose info in one FBX...
Definition: fbxpose.h:96
virtual void Construct(const FbxObject *pFrom)
Optional constructor override, automatically called by default constructor.
FbxArray< FbxPose * > PoseList
Definition: fbxpose.h:40
FbxArray< FbxNode * > NodeList
Definition: fbxpose.h:39
ENameComponent
This structure defines the strategy of comparing FBX node name.
Definition: fbxpose.h:172
#define FBXSDK_DLL
Definition: fbxarch.h:176
A name is a case-sensitive string ID of a property, a node, a node attribute, a texture, etc.
virtual void Destruct(bool pRecursive)
Optional destructor override, automatically called by default destructor.
FBX SDK basic 4x4 double matrix class.
Definition: fbxmatrix.h:27
This template class is used to contain user properties of specific data types.
Definition: fbxproperty.h:1072
virtual void ConstructProperties(bool pForceSet)
Optional property constructor override, automatically called by default constructor.
int GetCount() const
Get number of stored items.
Definition: fbxpose.h:119