fbxsdk/scene/fbxpose.h Source File

fbxpose.h
Go to the documentation of this file.
1 /****************************************************************************************
2 
3  Copyright (C) 2014 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 
283  bool IsValidBindPose(FbxNode* pRoot, double pMatrixCmpTolerance=0.0001, FbxStatus* pStatus = NULL);
284 
297  bool IsValidBindPoseVerbose(FbxNode* pRoot, NodeList& pMissingAncestors, NodeList& pMissingDeformers, NodeList& pMissingDeformersAncestors, NodeList& pWrongMatrices, double pMatrixCmpTolerance=0.0001, FbxStatus* pStatus = NULL);
298 
308  bool IsValidBindPoseVerbose(FbxNode* pRoot, FbxUserNotification* pUserNotification, double pMatrixCmpTolerance=0.0001, FbxStatus* pStatus = NULL);
309 
311 
312 /*****************************************************************************************************************************
313 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
314 *****************************************************************************************************************************/
315 #ifndef DOXYGEN_SHOULD_SKIP_THIS
316 protected:
317  virtual void Construct(const FbxObject* pFrom);
318  virtual void Destruct(bool pRecursive);
319  virtual void ConstructProperties(bool pForceSet);
320 
321  virtual FbxObject& Copy(const FbxObject& pObject);
322  virtual const char* GetTypeName() const;
323 
324  //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
325  //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.
326  bool ValidateParams(const FbxNode* pNode, const FbxMatrix& pMatrix, int& pPos);
327 
328  bool LocalValidateParams(const FbxNode* pNode, const FbxMatrix& pMatrix, int& pPos);
329  static bool GetSpecificPoseContaining(int poseType, FbxScene* pScene, FbxNode* pNode, PoseList& pPoseList, FbxArray<int>& pIndex);
330 
331 private:
332  FbxPoseInfo* GetItem(int pIndex) const;
333  void UpdatePosInfoList();
334  bool IsValidBindPoseCommon(FbxNode* pRoot, NodeList* pMissingAncestors, NodeList* pMissingDeformers, NodeList* pMissingDeformersAncestors, NodeList* pWrongMatrices, FbxStatus* pStatus, double pMatrixCmpTolerance=0.0001);
335 
336  char mType;
337  PoseInfoList mPoseInfo;
338  bool mPoseInfoIsDirty;
340 
341 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
342 };
343 
344 #include <fbxsdk/fbxsdk_nsend.h>
345 
346 #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:207
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:26
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:170
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:1150
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