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 fbxsubdeformer.h |
13 | #ifndef _FBXSDK_SCENE_GEOMETRY_SUB_DEFORMER_H_ |
14 | #define _FBXSDK_SCENE_GEOMETRY_SUB_DEFORMER_H_ |
15 | |
16 | #include <fbxsdk/fbxsdk_def.h> |
17 | |
18 | #include <fbxsdk/core/fbxobject.h> |
19 | |
20 | #include <fbxsdk/fbxsdk_nsbegin.h> |
21 | |
22 | /** Base class for cluster sub-deformer( FbxCluster) and blend shape channel sub-deformer( FbxBlendShapeChannel) |
23 | * |
24 | * The corresponding sub-deformer types are FbxSubDeformer::eCluster and FbxSubDeformer::eBlendShapeChannel. |
25 | * |
26 | * A cluster, or link, is an entity acting on a geometry (FbxGeometry). |
27 | * More precisely, the cluster acts on a subset of the geometry's control points. |
28 | * For each control point that the cluster acts on, the intensity of the cluster's |
29 | * action is modulated by a weight. The link mode (ELinkMode) specifies how |
30 | * the weights are taken into account. |
31 | * The cluster's link node specifies the node (FbxNode) that influences the |
32 | * control points of the cluster. If the node is animated, the control points |
33 | * will move accordingly. |
34 | * A cluster is usually part of a skin (see FbxDeformer, FbxSkin). For example, |
35 | * imagine a mesh representing a humanoid, and imagine a skeleton made of bones. |
36 | * Each bone is represented by a node in FBX. |
37 | * To bind the geometry to the nodes, |
38 | * we create a skin (FbxSkin). The skin has many clusters, each one corresponding |
39 | * to a bone. |
40 | * Each node influences some control |
41 | * points of the mesh. A node has a high influence on some of the points (high weight) |
42 | * and lower influence on some other points (low weight). Some points of the mesh |
43 | * are not affected at all by the bone, so they would not be part of the corresponding |
44 | * cluster. |
45 | * |
46 | * A blend shape channel is a sub-deformer to help blend shape deformer to organize the target shapes. |
47 | * One blend shape deformer can have multiple blend shape channels in parallel, and each of them can |
48 | * control one or multiple target shapes. If there are multiple target shapes connected to one channel, |
49 | * and each target shape could have its own full deformation percentage, for example, one channel could have 3 target shapes, |
50 | * whose full deform percentage are 30, to 80 to 100, then when the percent change from 0 to 100, the base geometry will |
51 | * deform from the first target shape to the last one, this is called In-Between blend-shapes. |
52 | * The blend shape channel also control the deform percent of each target shape or In-Between blend shape on it. |
53 | * \nosubgrouping |
54 | */ |
55 | class FBXSDK_DLL FbxSubDeformer : public FbxObject |
56 | { |
57 | FBXSDK_OBJECT_DECLARE(FbxSubDeformer, FbxObject); |
58 | public: |
59 | |
60 | /** Set multi layer state flag. |
61 | * \param pMultiLayer If \c true, multi-layering is enabled. |
62 | */ |
63 | void SetMultiLayer(bool pMultiLayer); |
64 | |
65 | /** Get multilayer state. |
66 | * \return The state of the multi-layer flag. |
67 | */ |
68 | bool GetMultiLayer() const; |
69 | |
70 | |
71 | /** \enum EType Sub-deformer type |
72 | */ |
73 | enum EType |
74 | { |
75 | eUnknown, //!< Untyped sub-deformer |
76 | eCluster, //!< Type FbxCluster |
77 | eBlendShapeChannel //!< Type FbxBlendShapeChannel |
78 | }; |
79 | |
80 | /** Get the type of the sub-deformer. |
81 | * \return SubDeformer type identifier. |
82 | */ |
83 | virtual EType GetSubDeformerType() const { return eUnknown; } |
84 | |
85 | /***************************************************************************************************************************** |
86 | ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! ** |
87 | *****************************************************************************************************************************/ |
88 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
89 | protected: |
90 | virtual void Construct(const FbxObject* pFrom); |
91 | virtual FbxStringList GetTypeFlags() const { return FbxStringList(); } |
92 | |
93 | // Local |
94 | bool mMultiLayer; |
95 | #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/ |
96 | }; |
97 | |
98 | #include <fbxsdk/fbxsdk_nsend.h> |
99 | |
100 | #endif /* _FBXSDK_SCENE_GEOMETRY_SUB_DEFORMER_H_ */ |
101 | |