fbxanimlayer.h 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  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 fbxanimlayer.h
  9. #ifndef _FBXSDK_SCENE_ANIMATION_LAYER_H_
  10. #define _FBXSDK_SCENE_ANIMATION_LAYER_H_
  11. #include <fbxsdk/fbxsdk_def.h>
  12. #include <fbxsdk/scene/fbxcollection.h>
  13. #include <fbxsdk/fbxsdk_nsbegin.h>
  14. class FbxAnimCurveNode;
  15. /** The animation layer is a collection of animation curve nodes. Its purpose is to store
  16. * a variable number of FbxAnimCurveNode. The class provides different states flags (bool properties),
  17. * an animatable weight, and the blending mode flag to indicate how the data on this layer is interacting
  18. * with the data of the other layers during the evaluation.
  19. * \nosubgrouping
  20. */
  21. class FBXSDK_DLL FbxAnimLayer : public FbxCollection
  22. {
  23. FBXSDK_OBJECT_DECLARE(FbxAnimLayer, FbxCollection);
  24. public:
  25. //////////////////////////////////////////////////////////////////////////
  26. //
  27. // Properties
  28. //
  29. //////////////////////////////////////////////////////////////////////////
  30. /** This property stores the weight factor.
  31. * The weight factor is the percentage of influence this layer has during
  32. * the evaluation.
  33. *
  34. * Default value is \c 100.0
  35. */
  36. FbxPropertyT<FbxDouble> Weight;
  37. /** This property stores the mute state.
  38. * The mute state indicates that this layer should be excluded from the evaluation.
  39. *
  40. * Default value is \c false
  41. */
  42. FbxPropertyT<FbxBool> Mute;
  43. /** This property stores the solo state.
  44. * The solo state indicates that this layer is the only one that should be
  45. * processed during the evaluation.
  46. *
  47. * Default value is \c false
  48. */
  49. FbxPropertyT<FbxBool> Solo;
  50. /** This property stores the lock state.
  51. * The lock state indicates that this layer has been "locked" from editing operations
  52. * and should no longer receive keyframes.
  53. *
  54. * Default value is \c false
  55. */
  56. FbxPropertyT<FbxBool> Lock;
  57. /** This property stores the display color.
  58. * This color can be used by applications if they display a graphical representation
  59. * of the layer. The FBX SDK does not use it but guarantees that the value is saved to the FBX
  60. * file and retrieved from it.
  61. *
  62. * Default value is \c (0.8, 0.8, 0.8)
  63. */
  64. FbxPropertyT<FbxDouble3> Color;
  65. /** This property stores the blend mode.
  66. * The blend mode is used to specify how this layer influences the animation evaluation. See the
  67. * BlendMode enumeration for the description of the modes.
  68. *
  69. * Default value is \c eModeAdditive
  70. */
  71. FbxPropertyT<FbxEnum> BlendMode;
  72. /** This property stores the rotation accumulation mode.
  73. * This option indicates how the rotation curves on this layer combine with any preceding layers
  74. * that share the same attributes. See the RotationAccumulationMode enumeration for the description
  75. * of the modes.
  76. *
  77. * Default value is \c eRotationByLayer
  78. */
  79. FbxPropertyT<FbxEnum> RotationAccumulationMode;
  80. /** This property stores the scale accumulation mode.
  81. * This option indicates how the scale curves on this layer combine with any preceding layers
  82. * that share the same attributes. See the ScaleAccumulationMode enumeration for the description
  83. * of the modes.
  84. *
  85. * Default value is \c eScaleMultiply
  86. */
  87. FbxPropertyT<FbxEnum> ScaleAccumulationMode;
  88. //! Reset this object properties to their default value.
  89. void Reset();
  90. /**
  91. * \name BlendMode bypass functions
  92. * This section provides methods to bypass the current layer blend mode by data type.
  93. * When the state is \c true, the evaluators that are processing the layer will
  94. * need to consider that, for the given data type, the blend mode is forced to be Overwrite.
  95. * If the state is left to its default \c false value, then the layer blend mode applies.
  96. * \remarks This section only supports the basic types defined in the fbxtypes.h header file.
  97. */
  98. //@{
  99. /** Set the bypass flag for the given data type.
  100. * \param pType The fbxType identifier.
  101. * \param pState The new state of the bypass flag.
  102. * \remarks If pType is eFbxTypeCount, then pState is applied to all the data types.
  103. */
  104. void SetBlendModeBypass(EFbxType pType, bool pState);
  105. /** Get the current state of the bypass flag for the given data type.
  106. * \param pType The fbxType identifier.
  107. * \return The current state of the flag for a valid pType value and \c false in any other case.
  108. */
  109. bool GetBlendModeBypass(EFbxType pType);
  110. //@}
  111. /** Blend mode type between animation layers.
  112. */
  113. enum EBlendMode
  114. {
  115. eBlendAdditive, //! The layer "adds" its animation to layers that precede it in the stack and affect the same attributes.
  116. eBlendOverride, //! The layer "overrides" the animation of any layer that shares the same attributes and precedes it in the stack.
  117. eBlendOverridePassthrough /*!<This mode is like the eOverride but the Weight value
  118. influence how much animation from the preceding layers is
  119. allowed to pass-through. When using this mode with a Weight of
  120. 100.0, this layer is completely opaque and it masks any animation
  121. from the preceding layers for the same attribute. If the Weight
  122. is 50.0, half of this layer animation is mixed with half of the
  123. animation of the preceding layers for the same attribute. */
  124. };
  125. /** Rotation accumulation mode of animation layer.
  126. */
  127. enum ERotationAccumulationMode
  128. {
  129. eRotationByLayer, //! Rotation values are weighted per layer and the result rotation curves are calculated using concatenated quaternion values.
  130. eRotationByChannel //! Rotation values are weighted per component and the result rotation curves are calculated by adding each independent Euler XYZ value.
  131. };
  132. /** Scale accumulation mode of animation layer.
  133. */
  134. enum EScaleAccumulationMode
  135. {
  136. eScaleMultiply, //! Independent XYZ scale values per layer are calculated using the layer weight value as an exponent, and result scale curves are calculated by multiplying each independent XYZ scale value.
  137. eScaleAdditive //! Result scale curves are calculated by adding each independent XYZ value.
  138. };
  139. /**
  140. * \name CurveNode management
  141. */
  142. //@{
  143. /** Create a FbxAnimCurveNode based on the property data type.
  144. * \param pProperty The property that the created FbxAnimCurveNode will be connected to.
  145. * \return Pointer to the created FbxAnimCurveNode, or NULL if an error occurred.
  146. * \remarks This function will fail if the property FbxPropertyFlags::eAnimatable flag is not set.
  147. * \remarks This function sets the eAnimated flag of the property.
  148. * \remarks The newly created FbxAnimCurveNode is automatically connected to both
  149. * this object and the property.
  150. */
  151. FbxAnimCurveNode* CreateCurveNode(FbxProperty& pProperty);
  152. //@}
  153. /*****************************************************************************************************************************
  154. ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
  155. *****************************************************************************************************************************/
  156. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  157. protected:
  158. virtual void ConstructProperties(bool pForceSet);
  159. virtual FbxAnimLayer* GetAnimLayer();
  160. private:
  161. FbxPropertyT<FbxULongLong> mBlendModeBypass;
  162. #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
  163. };
  164. #include <fbxsdk/fbxsdk_nsend.h>
  165. #endif /* _FBXSDK_SCENE_ANIMATION_LAYER_H_ */