00001
00004 #ifndef FBXFILESDK_KFBXCHARACTER_KFBXCONTROLSET_H
00005 #define FBXFILESDK_KFBXCHARACTER_KFBXCONTROLSET_H
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 #include <fbxfilesdk/fbxfilesdk_def.h>
00042
00043 #include <fbxfilesdk/kfbxcharacter/kfbxcharacter.h>
00044 #include <fbxfilesdk/kfbxmath/kfbxxmatrix.h>
00045 #include <fbxfilesdk/components/kbaselib/klib/kstring.h>
00046
00047 #include <fbxfilesdk/fbxfilesdk_nsbegin.h>
00048
00049 class KFbxNode;
00050 class KFbxSdkManager;
00051 class KFbxControlSetPlug;
00052 class KFbxControlSetPlug_internal;
00053
00054 typedef enum
00055 {
00056 eEffectorHips = 0,
00057 eEffectorLeftAnkle,
00058 eEffectorRightAnkle,
00059 eEffectorLeftWrist,
00060 eEffectorRightWrist,
00061 eEffectorLeftKnee,
00062 eEffectorRightKnee,
00063 eEffectorLeftElbow,
00064 eEffectorRightElbow,
00065 eEffectorChestOrigin,
00066 eEffectorChestEnd,
00067 eEffectorLeftFoot,
00068 eEffectorRightFoot,
00069 eEffectorLeftShoulder,
00070 eEffectorRightShoulder,
00071 eEffectorHead,
00072 eEffectorLeftHip,
00073 eEffectorRightHip,
00074
00075
00076
00077 eEffectorLeftHand,
00078 eEffectorRightHand,
00079
00080 eEffectorLeftHandThumb,
00081 eEffectorLeftHandIndex,
00082 eEffectorLeftHandMiddle,
00083 eEffectorLeftHandRing,
00084 eEffectorLeftHandPinky,
00085 eEffectorLeftHandExtraFinger,
00086
00087 eEffectorRightHandThumb,
00088 eEffectorRightHandIndex,
00089 eEffectorRightHandMiddle,
00090 eEffectorRightHandRing,
00091 eEffectorRightHandPinky,
00092 eEffectorRightHandExtraFinger,
00093
00094 eEffectorLeftFootThumb,
00095 eEffectorLeftFootIndex,
00096 eEffectorLeftFootMiddle,
00097 eEffectorLeftFootRing,
00098 eEffectorLeftFootPinky,
00099 eEffectorLeftFootExtraFinger,
00100
00101 eEffectorRightFootThumb,
00102 eEffectorRightFootIndex,
00103 eEffectorRightFootMiddle,
00104 eEffectorRightFootRing,
00105 eEffectorRightFootPinky,
00106 eEffectorRightFootExtraFinger,
00107
00108 eEffectorLastNodeId
00109 } EEffectorNodeId;
00110
00111 typedef enum
00112 {
00113 eEffectorSetDefault = 0,
00114 eEffectorSetAux1,
00115 eEffectorSetAux2,
00116 eEffectorSetAux3,
00117 eEffectorSetAux4,
00118 eEffectorSetAux5,
00119 eEffectorSetAux6,
00120 eEffectorSetAux7,
00121 eEffectorSetAux8,
00122 eEffectorSetAux9,
00123 eEffectorSetAux10,
00124 eEffectorSetAux11,
00125 eEffectorSetAux12,
00126 eEffectorSetAux13,
00127 eEffectorSetAux14,
00128 eLastEffectorSetId
00129 } EEffectorSetId;
00130
00131
00137 class KFBX_DLL KFbxControlSetLink
00138 {
00139
00140 public:
00141
00143 KFbxControlSetLink();
00144
00148 KFbxControlSetLink(const KFbxControlSetLink& pControlSetLink);
00152 KFbxControlSetLink& operator=(const KFbxControlSetLink& pControlSetLink);
00153
00158 void Reset();
00159
00161 KFbxNode* mNode;
00162
00165 KString mTemplateName;
00166 };
00167
00174 class KFBX_DLL KFbxEffector
00175 {
00176
00177 public:
00178
00180 KFbxEffector();
00184 KFbxEffector& operator=(KFbxEffector& pEffector);
00185
00190 void Reset();
00191
00193 KFbxNode* mNode;
00194
00196 bool mShow;
00197
00198
00199 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00200 bool mTActive;
00201 bool mRActive;
00202 bool mCandidateTActive;
00203 bool mCandidateRActive;
00204 #endif
00205 };
00206
00224 class KFBX_DLL KFbxControlSet
00225 {
00226
00227 public:
00228 KFBXNEW_DECLARE_FRIEND
00232 void Reset();
00233
00239 enum EType
00240 {
00241 eNone,
00242 eFkIk,
00243 eIkOnly
00244 };
00245
00249 void SetType(EType pType);
00250
00254 EType GetType() const;
00255
00259 void SetUseAxis(bool pUseAxis);
00260
00264 bool GetUseAxis() const;
00265
00269 void SetLockTransform(bool pLockTransform);
00270
00274 bool GetLockTransform()const;
00275
00279 void SetLock3DPick(bool pLock3DPick);
00280
00284 bool GetLock3DPick() const;
00285
00295 bool SetControlSetLink(ECharacterNodeId pCharacterNodeId, const KFbxControlSetLink& pControlSetLink);
00296
00306 bool GetControlSetLink(ECharacterNodeId pCharacterNodeId, KFbxControlSetLink* pControlSetLink = NULL) const;
00307
00313 bool SetEffector(EEffectorNodeId pEffectorNodeId, KFbxEffector pEffector);
00314
00320 bool GetEffector(EEffectorNodeId pEffectorNodeId, KFbxEffector* pEffector = NULL);
00321
00328 bool SetEffectorAux(EEffectorNodeId pEffectorNodeId, KFbxNode* pNode,EEffectorSetId pEffectorSetId = eEffectorSetAux1);
00329
00336 bool GetEffectorAux(EEffectorNodeId pEffectorNodeId, KFbxNode** pNode = NULL,EEffectorSetId pEffectorSetId = eEffectorSetAux1) const;
00337
00342 static char* GetEffectorNodeName(EEffectorNodeId pEffectorNodeId);
00343
00349 static EEffectorNodeId GetEffectorNodeId(char* pEffectorNodeName);
00350
00351
00353
00354
00355
00356
00357
00358
00360
00361 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00362
00363 private:
00364
00365 KFbxControlSet();
00366 ~KFbxControlSet();
00367
00368 KFbxCharacter* mCharacter;
00369 EType mType;
00370 bool mUseAxis;
00371 bool mLockTransform;
00372 bool mLock3DPick;
00373 KFbxControlSetLink mControlSetLink[eCharacterLastNodeId];
00374 KFbxEffector mEffector[eEffectorLastNodeId];
00375 KFbxNode* mEffectorAux[eEffectorLastNodeId][eLastEffectorSetId-1];
00376
00377 friend class KFbxCharacter;
00378 friend class KFbxNode;
00379
00380 public:
00381
00382 void FromPlug(KFbxControlSetPlug *pPlug);
00383 void ToPlug(KFbxControlSetPlug *pPlug);
00384
00385 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
00386
00387 };
00388
00392 class KFBX_DLL KFbxControlSetPlug : public KFbxObject
00393 {
00394 KFBXOBJECT_DECLARE(KFbxControlSetPlug,KFbxObject);
00395 public:
00396
00398 KFbxTypedProperty<KFbxControlSet::EType> ControlSetType;
00400 KFbxTypedProperty<bool> UseAxis;
00402 KFbxTypedProperty<fbxReference*> Character;
00403
00409
00413 KError& GetError();
00414
00416 typedef enum
00417 {
00418 eERROR,
00419 eERROR_COUNT
00420 } EError;
00421
00425 EError GetLastErrorID() const;
00426
00430 const char* GetLastErrorString() const;
00431
00433
00439 virtual KFbxObject* Clone(KFbxObject* pContainer, KFbxObject::ECloneType pCloneType) const;
00440
00441 protected:
00442 KFbxControlSetPlug(KFbxSdkManager& pManager, char const* pName);
00443
00444 virtual void Construct(const KFbxControlSetPlug* pFrom);
00445
00446 public:
00447 virtual KString GetTypeName() const;
00448 virtual KStringList GetTypeFlags() const;
00449
00450 protected:
00451 KArrayTemplate<KFbxProperty> mFKBuf;
00452 KArrayTemplate<KFbxProperty> mIKBuf;
00453
00454 KError mError;
00455
00456 friend class KFbxScene;
00457 friend class KFbxControlSet;
00458 };
00459
00460 typedef KFbxControlSetPlug* HKFbxControlSetPlug;
00461 inline EFbxType FbxTypeOf( KFbxControlSet::EType const &pItem ) { return eENUM; }
00462
00463 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00464
00465 #endif // FBXFILESDK_KFBXCHARACTER_KFBXCONTROLSET_H
00466