fbxblendshape.h 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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 fbxblendshape.h
  9. #ifndef _FBXSDK_SCENE_GEOMETRY_BLEND_SHAPE_H_
  10. #define _FBXSDK_SCENE_GEOMETRY_BLEND_SHAPE_H_
  11. #include <fbxsdk/fbxsdk_def.h>
  12. #include <fbxsdk/scene/geometry/fbxdeformer.h>
  13. #include <fbxsdk/fbxsdk_nsbegin.h>
  14. class FbxGeometry;
  15. class FbxBlendShapeChannel;
  16. /** Class for blend shape deformer.
  17. * A blend shape deformer takes a base shape (polygonal surface, curve, or surface)
  18. * and blends it with other target shapes based on weight values.
  19. * Blend shape deformer organize all target shapes via blend shape channel.
  20. * One blend shape deformer can contains multiple blend shape channels, then each
  21. * channel can organize multiple target shapes, \see FbxBlendShapeChannel, FbxShape.
  22. * \remarks The blend effect of each blend shape channel is additive, so the final blend
  23. * effect of a blend shape deformer is the sum of blend effect of all blend shape
  24. * channels it contains, the blend effect of each blend shape channel is controlled
  25. * by the property DeformPercent of blend shape channel.
  26. * \see FbxGeometry, FbxGeometryBase.
  27. * \nosubgrouping
  28. */
  29. class FBXSDK_DLL FbxBlendShape : public FbxDeformer
  30. {
  31. FBXSDK_OBJECT_DECLARE(FbxBlendShape, FbxDeformer);
  32. public:
  33. /** Set the geometry affected by this blend shape deformer.
  34. * \param pGeometry Pointer to the geometry object to set.
  35. * \return \c true on success, \c false otherwise.
  36. * \remarks One blend shape deformer can only be used on one base geometry.
  37. * So when SetGeometry is called, the pGeometry will replace the
  38. * current base geometry connected to this blend shape deformer.
  39. */
  40. bool SetGeometry(FbxGeometry* pGeometry);
  41. /** Get the geometry affected by this blend shape deformer.
  42. * \return A pointer to the geometry if it is set or \c NULL if not set yet.
  43. */
  44. FbxGeometry* GetGeometry();
  45. /** Add a blend shape channel.
  46. * \param pBlendShapeChannel Pointer to the blend shape channel object to add.
  47. * \return \c true on success, \c false otherwise.
  48. */
  49. bool AddBlendShapeChannel(FbxBlendShapeChannel* pBlendShapeChannel);
  50. /** Remove the given blend shape.
  51. * \param pBlendShapeChannel Pointer to the blend shape channel to remove from this blend shape deformer.
  52. * \return Pointer to the blend shape channel or \c NULL if pBlendShapeChannel is not owned by this blend shape deformer.
  53. */
  54. FbxBlendShapeChannel* RemoveBlendShapeChannel(FbxBlendShapeChannel* pBlendShapeChannel);
  55. /** Get the number of blend shape channels.
  56. * \return Number of blend shape channels that have been added to this object.
  57. */
  58. int GetBlendShapeChannelCount() const;
  59. /** Get blend shape channel at given index.
  60. * \param pIndex Index of the blend shape channel.
  61. * \return Pointer to the blend shape channel or \c NULL if index is out of range.
  62. */
  63. FbxBlendShapeChannel* GetBlendShapeChannel(int pIndex);
  64. /** Get the blend shape channel at given index.
  65. * \param pIndex Index of the blend shape channel.
  66. * \return Pointer to the blend shape channel or \c NULL if index is out of range.
  67. */
  68. const FbxBlendShapeChannel* GetBlendShapeChannel(int pIndex) const;
  69. /** Get the type of the deformer.
  70. * \return The deformer type identifier of blend shape deformer.
  71. */
  72. EDeformerType GetDeformerType() const {return eBlendShape; };
  73. /** Restore the blend shape deformer to the initial state.
  74. * Calling this function will do the following:
  75. * \li Clear the pointer to base geometry.
  76. * \li Remove all the blend shape channels.
  77. */
  78. void Reset();
  79. /*****************************************************************************************************************************
  80. ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
  81. *****************************************************************************************************************************/
  82. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  83. virtual FbxObject& Copy(const FbxObject& pObject);
  84. virtual FbxObject* Clone(FbxObject::ECloneType pCloneType=eDeepClone, FbxObject* pContainer=NULL, void* pSet = NULL) const;
  85. protected:
  86. virtual FbxStringList GetTypeFlags() const;
  87. #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
  88. };
  89. #include <fbxsdk/fbxsdk_nsend.h>
  90. #endif /* _FBXSDK_SCENE_GEOMETRY_BLEND_SHAPE_H_ */