fbxanimstack.h 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  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 fbxanimstack.h
  9. #ifndef _FBXSDK_SCENE_ANIMATION_STACK_H_
  10. #define _FBXSDK_SCENE_ANIMATION_STACK_H_
  11. #include <fbxsdk/fbxsdk_def.h>
  12. #include <fbxsdk/core/base/fbxtime.h>
  13. #include <fbxsdk/scene/fbxcollection.h>
  14. #include <fbxsdk/fbxsdk_nsbegin.h>
  15. // these symbols are defined for backward compatibility
  16. #define FBXSDK_TAKENODE_DEFAULT_NAME "Default"
  17. #define FBXSDK_ROOTCURVE_DEFAULT_NAME "Defaults"
  18. class FbxTakeInfo;
  19. class FbxThumbnail;
  20. class FbxAnimEvaluator;
  21. /** The Animation stack is a collection of animation layers. The Fbx document can have one or
  22. * more animation stacks. Each stack can be viewed as one "take" in the previous versions of the FBX SDK.
  23. * The "stack" terminology comes from the fact that the object contains 1 to n animation layers that
  24. * are evaluated according to their blending modes to produce a resulting animation for a given attribute.
  25. * \nosubgrouping
  26. */
  27. class FBXSDK_DLL FbxAnimStack : public FbxCollection
  28. {
  29. FBXSDK_OBJECT_DECLARE(FbxAnimStack, FbxCollection);
  30. public:
  31. //////////////////////////////////////////////////////////////////////////
  32. //
  33. // Properties
  34. //
  35. //////////////////////////////////////////////////////////////////////////
  36. /** This property stores a description string of this animation stack.
  37. * This string can be used to display, in a human readable format, information
  38. * relative to this animation stack object.
  39. * Default value is "".
  40. * \remarks The applications using the FBX SDK are not required to manipulate this information.
  41. */
  42. FbxPropertyT<FbxString> Description;
  43. /** This property stores the local time span "Start" time.
  44. * This "start" time should be seen as a time marker. Typically it would represent the whole animation
  45. * starting time but its use (and update) is left to the calling application (with one exception occurring
  46. * in the BakeLayers). The FBX SDK does not use this value internally and only guarantees that it will be stored
  47. * to the FBX file and retrieved from it.
  48. *
  49. * Default value is 0.
  50. */
  51. FbxPropertyT<FbxTime> LocalStart;
  52. /** This property stores the local time span "Stop" time.
  53. * This "stop" time should be seen as a time marker. Typically it would represent the whole animation
  54. * ending time but its use (and update) is left to the calling application (with one exception occurring
  55. * in the BakeLayers). The FBX SDK does not use this value internally and only guarantees that it will be stored
  56. * to the FBX file and retrieved from it.
  57. *
  58. * Default value is 0
  59. */
  60. FbxPropertyT<FbxTime> LocalStop;
  61. /** This property stores the reference time span "Start" time.
  62. * This reference start time is another time marker that can be used by the calling application. The FBX SDK
  63. * never uses it and only guarantees that this value is stored in the FBX file and retrieved from it.
  64. *
  65. * Default value is 0
  66. */
  67. FbxPropertyT<FbxTime> ReferenceStart;
  68. /** This property stores the reference time span "Stop" time.
  69. * This reference stop time is another time marker that can be used by the calling application. The FBX SDK
  70. * never uses it and only guarantees that this value is stored in the FBX file and retrieved from it.
  71. *
  72. * Default value is 0
  73. */
  74. FbxPropertyT<FbxTime> ReferenceStop;
  75. /** Reset the object time spans either to their default values or from the pTakeInfo structure, if provided.
  76. * \param pTakeInfo The take info to be used during reset.
  77. */
  78. void Reset(const FbxTakeInfo* pTakeInfo = NULL);
  79. /**
  80. * \name Utility functions.
  81. *
  82. */
  83. //@{
  84. /** Get the LocalStart and LocalStop time properties as a FbxTimeSpan.
  85. * \return The current local time span.
  86. */
  87. FbxTimeSpan GetLocalTimeSpan() const;
  88. /** Set the LocalStart and LocalStop time properties from a FbxTimeSpan.
  89. * \param pTimeSpan The new local time span.
  90. */
  91. void SetLocalTimeSpan(FbxTimeSpan& pTimeSpan);
  92. /** Get the ReferenceStart and ReferenceStop time properties as a FbxTimeSpan.
  93. * \return The current reference time span.
  94. */
  95. FbxTimeSpan GetReferenceTimeSpan() const;
  96. /** Set the ReferenceStart and ReferenceStop time properties from a FbxTimeSpan.
  97. * \param pTimeSpan The new reference time span.
  98. */
  99. void SetReferenceTimeSpan(FbxTimeSpan& pTimeSpan);
  100. /** Bake all the animation layers on the base layer.
  101. * This function will process all the properties on every animation layer and generate a re-sampled set of
  102. * animation keys (representing the layers' evaluated result) on the base layer. Once this operation is completed
  103. * successfully, all the layers (except the base one) are destroyed. Properties that are only defined on the base
  104. * layer will remain unaffected by the re-sampling. The stack local timespan is updated with the overall animation range.
  105. *
  106. * \param pEvaluator The layer evaluator. This is the engine that evaluates the overall result of any given
  107. * property according to the layers flags.
  108. * \param pStart The start time of the re-sampling range.
  109. * \param pStop The stop time of the re-sampling range.
  110. * \param pPeriod The time increment for the re-sampling.
  111. * \return \c true if the operation was successful and \c false in case of errors.
  112. * \remarks If this AnimStack contains only one AnimLayer, the function will return false and do nothing.
  113. */
  114. bool BakeLayers(FbxAnimEvaluator* pEvaluator, FbxTime pStart, FbxTime pStop, FbxTime pPeriod);
  115. //@}
  116. /*****************************************************************************************************************************
  117. ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
  118. *****************************************************************************************************************************/
  119. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  120. protected:
  121. virtual void ConstructProperties(bool pForceSet);
  122. virtual void Destruct(bool pRecursive);
  123. #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
  124. };
  125. #include <fbxsdk/fbxsdk_nsend.h>
  126. #endif /* _FBXSDK_SCENE_ANIMATION_STACK_H_ */