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