fbxnode.h 99 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392
  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 fbxnode.h
  9. #ifndef _FBXSDK_SCENE_GEOMETRY_NODE_H_
  10. #define _FBXSDK_SCENE_GEOMETRY_NODE_H_
  11. #include <fbxsdk/fbxsdk_def.h>
  12. #include <fbxsdk/core/fbxobject.h>
  13. #include <fbxsdk/core/math/fbxtransforms.h>
  14. #include <fbxsdk/fbxsdk_nsbegin.h>
  15. class FbxStatus;
  16. class FbxNodeAttribute;
  17. class FbxCachedEffect;
  18. class FbxLODGroup;
  19. class FbxNull;
  20. class FbxMarker;
  21. class FbxSkeleton;
  22. class FbxGeometry;
  23. class FbxMesh;
  24. class FbxNurbs;
  25. class FbxNurbsCurve;
  26. class FbxLine;
  27. class FbxNurbsSurface;
  28. class FbxTrimNurbsSurface;
  29. class FbxPatch;
  30. class FbxCamera;
  31. class FbxCameraStereo;
  32. class FbxCameraSwitcher;
  33. class FbxLight;
  34. class FbxOpticalReference;
  35. class FbxSubDiv;
  36. class FbxCharacter;
  37. class FbxSurfaceMaterial;
  38. class FbxAnimStack;
  39. class FbxAnimCurveFilterMatrixConverter;
  40. /** Represents an element in the scene graph. A scene graph is a tree of FbxNode
  41. * objects. The tree management services are self contained in this class.
  42. *
  43. * \note The FBX SDK does not test the validity of the constructed scene graph. It
  44. * is the responsibility of the caller to make sure that it does not generate cyclic
  45. * graphs in a node hierarchy.
  46. *
  47. * Besides the tree management, this class defines all the properties required to describe
  48. * the position of the object in the scene. This information include the basic Translation,
  49. * Rotation and Scaling properties and the more advanced options for pivots, limits, and IK joints
  50. * attributes such the stiffness and dampening.
  51. *
  52. * When it is first created, the FbxNode object is "empty" (i.e: it is an object without any
  53. * graphical representation that only contains the position information). In this state, it can
  54. * be used to represent parents in the node tree structure but not much more. The normal use of
  55. * this type of objects is to add them an attribute that will specialize the node (see the
  56. * "Node Attribute Management" section).
  57. *
  58. * The node attribute is an object in itself and is connected to the the FbxNode. This also
  59. * means that the same node attribute can be shared among multiple nodes. FbxCamera, FbxLight,
  60. * FbxMesh, etc... are all node attributes and they all derive from the base class FbxNodeAttribute.
  61. *
  62. */
  63. class FBXSDK_DLL FbxNode : public FbxObject
  64. {
  65. FBXSDK_OBJECT_DECLARE(FbxNode, FbxObject);
  66. public:
  67. /**
  68. * \name Node Tree Management
  69. */
  70. //@{
  71. /** Get the parent node.
  72. * \return Pointer to parent node or \c NULL if the current node has no parent.
  73. */
  74. FbxNode* GetParent();
  75. const FbxNode* GetParent() const;
  76. /** Add a child node and its underlying node tree.
  77. * \param pNode Node we want to make child of \c this.
  78. * \return \c true on success, \c false if \e pNode is \c NULL or the system is
  79. * unable to make the connection.
  80. * \remarks If \e pNode already has a parent, first it is removed from current parent and then
  81. * added to this one.
  82. */
  83. bool AddChild(FbxNode* pNode);
  84. /** Remove the child node.
  85. * \param pNode The child node to be removed.
  86. * \return The removed child node.
  87. */
  88. FbxNode* RemoveChild(FbxNode* pNode);
  89. /** Get the number of children nodes.
  90. * \param pRecursive If \c true the method will also count all the descendant children.
  91. * \return Total number of children for this node.
  92. */
  93. int GetChildCount(bool pRecursive = false) const;
  94. /** Get child by index.
  95. * \param pIndex The child index.
  96. * \return Child node or \c NULL if \e pIndex is out of range (i.e: < 0 or > GetChildCount()).
  97. */
  98. FbxNode* GetChild(int pIndex);
  99. /** Get child by index.
  100. * \param pIndex The child index.
  101. * \return Child node or \c NULL if \e pIndex is out of range (i.e: < 0 or > GetChildCount()).
  102. */
  103. const FbxNode* GetChild(int pIndex) const;
  104. /** Finds a child node by name.
  105. * \param pName Name of the searched child node.
  106. * \param pRecursive Flag to request recursive calls.
  107. * \param pInitial If set to \c true, the search compares the initial name of
  108. * the node (see the FbxObject class)
  109. * \return Found child node or \c NULL if no child node with this name exists.
  110. */
  111. FbxNode* FindChild(const char* pName, bool pRecursive=true, bool pInitial=false);
  112. //@}
  113. /**
  114. * \name Node Target Management
  115. * The FbxNode class allows the client to set a "follow" target node. This target
  116. * forces the node to re-align itself so it points to the target. By default, the node
  117. * uses its X axis as the aiming constraint. A rotation offset can be added to change
  118. * this behavior. While the default relative orientation to the target (the X axis) is
  119. * sufficient for the FBX cameras (with a (0,0,0) rotation vector, they are aiming
  120. * along the X axis), this rotation offset becomes particularly useful with the lights
  121. * objects because their default orientation (when they have a 0,0,0 rotation vector) is to
  122. * point along the -Y axis and they need to be adjusted with a 90-degree offset on the Z axis.
  123. *
  124. * The FbxNode class also permits the use of node to define an Up-vector. By default,
  125. * the node's up vector points towards the Up node. If the Up node is not specified,
  126. * then the node's Up vector points towards the Y axis. Here too, a rotation offset can be
  127. * added to change the default behavior.
  128. *
  129. * Of course, these offsets can be applied to anything, not only the cameras and lights.
  130. *
  131. * \note Objects in the FBX SDK are always created in the right handed, Y-Up system and need
  132. * to be adjusted for any other axis system by explicitly convert them (the class
  133. * FbxAxisSystem can help in that process).
  134. *
  135. */
  136. //@{
  137. /** The target must be part of the same scene and it cannot be itself.
  138. * \param pNode The target.
  139. */
  140. void SetTarget(FbxNode* pNode);
  141. /** Get the target for this node.
  142. * \returns \c NULL if target isn't set.
  143. */
  144. FbxNode* GetTarget() const;
  145. /** Set rotation offset from default relative orientation to target.
  146. * \param pVector The rotation offset.
  147. */
  148. void SetPostTargetRotation(FbxVector4 pVector);
  149. /** Get rotation offset from default relative orientation to target.
  150. * \return The rotation offset.
  151. */
  152. FbxVector4 GetPostTargetRotation() const;
  153. /** The target up node must be part of the same scene and it cannot be itself.
  154. * \param pNode The target.
  155. */
  156. void SetTargetUp(FbxNode* pNode);
  157. /** Get the target up node.
  158. * \return \c NULL if the target up model isn't set.
  159. */
  160. FbxNode* GetTargetUp() const;
  161. /** Set up vector offset from default relative target up vector.
  162. * \param pVector The rotation offset.
  163. */
  164. void SetTargetUpVector(FbxVector4 pVector);
  165. /** Get up vector offset from default relative target up vector.
  166. * \return The up vector offset.
  167. */
  168. FbxVector4 GetTargetUpVector() const;
  169. //@}
  170. /**
  171. * \name Node Display Parameters
  172. */
  173. //@{
  174. /** Set the node Visibility value from the boolean parameter.
  175. * \param pIsVisible Node is visible in the scene if set to \c true.
  176. * \remarks This method checks for the validity of the property before attempting to
  177. * set its value. In fact, the exact same result can be achieved by the following code:
  178. * \code
  179. * if( Visibility.IsValid() )
  180. * {
  181. * Visibility.Set(FbxDouble(pIsVisible));
  182. * }
  183. * \endcode
  184. *
  185. * \see Visibility property.
  186. */
  187. void SetVisibility(bool pIsVisible);
  188. /** Get the current value of the Visibility property.
  189. * \return \c false if the Visibility property value is 0.0 and \c true for any other value.
  190. * \remarks This method expects the Visibility property to exist and to be valid. If this
  191. * condition is not met, the returned value will be \c false.
  192. */
  193. bool GetVisibility() const;
  194. /** \enum EShadingMode Shading modes.
  195. * These shading modes are not directly used by the FBX SDK but it is guaranteed that the information is
  196. * carried to and from the FBX files. The typical context of using these modes is to affect the rendering of
  197. * geometric objects (this is, of course, performed at the application level) and the possible definition
  198. * for each mode is:
  199. */
  200. enum EShadingMode
  201. {
  202. eHardShading, //!< Solid geometries rendered with smooth surfaces - using the system light.
  203. eWireFrame, //!< Geometries displayed in wire frame.
  204. eFlatShading, //!< Solid geometries rendered faceted - using the system light.
  205. eLightShading, //!< Solid geometries rendered with the scene lights.
  206. eTextureShading, //!< Solid geometries rendered with smooth textured surfaces - using system light.
  207. eFullShading //!< Solid geometries rendered with smooth textured surfaces and scene lights.
  208. };
  209. /** Set the shading mode.
  210. * \param pShadingMode The shading mode.
  211. */
  212. void SetShadingMode(EShadingMode pShadingMode);
  213. /** Get the shading mode.
  214. * \return The currently set shading mode.
  215. */
  216. EShadingMode GetShadingMode() const;
  217. //@}
  218. /**
  219. * \name Node Attribute Management
  220. */
  221. //@{
  222. /** Set the node attribute.
  223. * \param pNodeAttribute Node attribute object
  224. * \return Pointer to previous node attribute object.
  225. * \c NULL if the node didn't have a node attribute or if
  226. * the new node attribute is equal to the one currently set.
  227. * \remarks A node attribute can be shared between nodes.
  228. * \remarks If this node has more than one attribute (added via the AddAttribute() method), this call
  229. * will destroy all, but the default node attribute.
  230. */
  231. FbxNodeAttribute* SetNodeAttribute(FbxNodeAttribute* pNodeAttribute);
  232. /** Get the default node attribute.
  233. * The default node attribute is the attribute that has been set by the call to SetNodeAttribute().
  234. * \return Pointer to the default node attribute or \c NULL if the node doesn't
  235. * have a node attribute.
  236. */
  237. FbxNodeAttribute* GetNodeAttribute();
  238. /** Get the default node attribute.
  239. * The default node attribute is the attribute that has been set by the call to SetNodeAttribute(...).
  240. * \return Pointer to the default node attribute or \c NULL if the node doesn't
  241. * have a node attribute.
  242. */
  243. const FbxNodeAttribute* GetNodeAttribute() const;
  244. //! Get the number of node attribute(s) connected to this node.
  245. int GetNodeAttributeCount() const;
  246. /** Get the index, in the list of connected node attributes, of the node attribute that is set
  247. * to be the default one.
  248. * \return Index of the default node attribute or \c -1 if there is no default node attribute set.
  249. */
  250. int GetDefaultNodeAttributeIndex() const;
  251. /** Set index of the default node attribute.
  252. * \param pIndex Identifies which of the connected node attributes is becoming the default one.
  253. * This value represent the connection number of the node.
  254. * \param pStatus The FbxStatus object to hold error codes.
  255. * \return \c true if the operation succeeds or \c false if the passed index is invalid.
  256. */
  257. bool SetDefaultNodeAttributeIndex(int pIndex, FbxStatus* pStatus = NULL);
  258. /** Get the connected node attribute by specifying its index in the connection list.
  259. * \param pIndex The connection number of the node.
  260. * \return Pointer to corresponding node attribute or \c NULL if the index is out of range.
  261. */
  262. FbxNodeAttribute* GetNodeAttributeByIndex(int pIndex);
  263. /** Get the connected node attribute by specifying its index in the connection list.
  264. * \param pIndex The connection number of the node.
  265. * \return Pointer to corresponding node attribute or \c NULL if the index is out of range.
  266. */
  267. const FbxNodeAttribute* GetNodeAttributeByIndex(int pIndex) const;
  268. /** Get the connection index of the specified node attribute.
  269. * This method will do a linear search of all the connected node attributes (from the last to
  270. * the first connection) until it finds \e pNodeAttribue.
  271. * \param pNodeAttribute The pointer to the node attribute.
  272. * \param pStatus The FbxStatus object to hold error codes.
  273. * \return The connection number of the node attribute or \c -1 if pNodeAttribute is \c NULL
  274. * or not connected to this node.
  275. */
  276. int GetNodeAttributeIndex(FbxNodeAttribute* pNodeAttribute, FbxStatus* pStatus = NULL) const;
  277. /** Add the new node attribute to this node.
  278. * If no other node attribute is already set as the default one, this new node attribute is
  279. * automatically set as the default one.
  280. * \param pNodeAttribute The pointer to a node attribute.
  281. * \param pStatus The FbxStatus object to hold error codes.
  282. * \return \c true if the operation succeeded or \c false if the operation failed.
  283. * \remarks The failing conditions for this methods are:
  284. * - The received object pointer is \c NULL.
  285. * - The received object is already connected to this node.
  286. * - An internal error prevented the connection to successfully complete.
  287. */
  288. bool AddNodeAttribute(FbxNodeAttribute* pNodeAttribute, FbxStatus* pStatus = NULL);
  289. /** Remove the node attribute from the connection list of this node.
  290. * \param pNodeAttribute The pointer to a node attribute.
  291. * \return Pointer to the removed node attribute or \c NULL if the operation failed.
  292. */
  293. FbxNodeAttribute* RemoveNodeAttribute(FbxNodeAttribute* pNodeAttribute);
  294. /** Remove the node attribute, specified by the connection index, from the connection
  295. * list of this node.
  296. * \param pIndex Index of the node attribute.
  297. * \return Pointer to the removed node attribute or \c NULL if the operation failed.
  298. * \remarks If the specified node attribute is also the default one, its predecessor in
  299. * the connection list will become the new default node attribute. And if there
  300. * are no more predecessors, the node DefaultNodeAttributeIndex is reset to -1.
  301. */
  302. FbxNodeAttribute* RemoveNodeAttributeByIndex(int pIndex);
  303. /** Get the default node attribute casted to a FbxCachedEffect pointer.
  304. * \return Pointer to the cached effect object.
  305. * \remarks If the type cast failed because there is not default node attribute set or it cannot
  306. * be successfully casted, this method will return \c NULL.
  307. */
  308. FbxCachedEffect* GetCachedEffect();
  309. /** Get the default node attribute casted to a FbxLODGroup pointer.
  310. * \return Pointer to the lod group object.
  311. * \remarks If the type cast failed because there is not default node attribute set or it cannot
  312. * be successfully casted, this method will return \c NULL.
  313. */
  314. FbxLODGroup* GetLodGroup();
  315. /** Get the default node attribute casted to a FbxNull pointer.
  316. * \return Pointer to the null object.
  317. * \remarks If the type cast failed because there is not default node attribute set or it cannot
  318. * be successfully casted, this method will return \c NULL.
  319. */
  320. FbxNull* GetNull();
  321. /** Get the node attribute casted to a FbxMarker pointer.
  322. * \return Pointer to the marker object.
  323. * \remarks If the type cast failed because there is not default node attribute set or it cannot
  324. * be successfully casted, this method will return \c NULL.
  325. */
  326. FbxMarker* GetMarker();
  327. /** Get the node attribute casted to a FbxSkeleton pointer.
  328. * \return Pointer to the skeleton object.
  329. * \remarks If the type cast failed because there is not default node attribute set or it cannot
  330. * be successfully casted, this method will return \c NULL.
  331. */
  332. FbxSkeleton* GetSkeleton();
  333. /** Get the node attribute casted to a FbxGeometry pointer.
  334. * \return Pointer to the geometry object.
  335. * \remarks If the type cast failed because there is not default node attribute set or it cannot
  336. * be successfully casted, this method will return \c NULL.
  337. * \remarks For this method to succeed, the node attribute's GetAttributeType() must returns one of the
  338. * following:
  339. * - FbxNodeAttribute::eMesh
  340. * - FbxNodeAttribute::eNurbs
  341. * - FbxNodeAttribute::eNurbsSurface
  342. * - FbxNodeAttribute::ePatch
  343. * - FbxNodeAttribute::eNurbsCurve
  344. * - FbxNodeAttribute::eBoundary
  345. * - FbxNodeAttribute::eTrimNurbsSurface
  346. * - FbxNodeAttribute::eSubDiv
  347. * - FbxNodeAttribute::eLine
  348. */
  349. FbxGeometry* GetGeometry();
  350. /** Get the node attribute casted to a FbxMesh pointer.
  351. * \return Pointer to the mesh object.
  352. * \remarks This method will try to process the default node attribute first. If it cannot
  353. * find it, it will scan the list of connected node attributes and get the first
  354. * object that is a FbxNodeAttribute::eMesh.
  355. * \remarks If the above search failed to get a valid pointer or it cannot
  356. * be successfully casted, this method will return \c NULL.
  357. */
  358. FbxMesh* GetMesh();
  359. /** Get the node attribute casted to a FbxNurbs pointer.
  360. * \return Pointer to the nurb object.
  361. * \remarks This method will try to process the default node attribute first. If it cannot
  362. * find it, it will scan the list of connected node attributes and get the first
  363. * object that is a FbxNodeAttribute::eNurbs.
  364. * \remarks If the above search failed to get a valid pointer or it cannot
  365. * be successfully casted, this method will return \c NULL.
  366. */
  367. FbxNurbs* GetNurbs();
  368. /** Get the node attribute casted to a FbxNurbsSurface pointer.
  369. * \return Pointer to the nurbs surface object.
  370. * \remarks This method will try to process the default node attribute first. If it cannot
  371. * find it, it will scan the list of connected node attributes and get the first
  372. * object that is a FbxNodeAttribute::eNurbsSurface.
  373. * \remarks If the above search failed to get a valid pointer or it cannot
  374. * be successfully casted, this method will return \c NULL.
  375. */
  376. FbxNurbsSurface* GetNurbsSurface();
  377. /** Get the node attribute casted to a FbxNurbsCurve pointer.
  378. * \return Pointer to the nurbs curve object.
  379. * \remarks This method will try to process the default node attribute first. If it cannot
  380. * find it, it will scan the list of connected node attributes and get the first
  381. * object that is a FbxNodeAttribute::eNurbsCurve.
  382. * \remarks If the above search failed to get a valid pointer or it cannot
  383. * be successfully casted, this method will return \c NULL.
  384. */
  385. FbxNurbsCurve* GetNurbsCurve();
  386. /** Get the node attribute casted to a FbxLine pointer.
  387. * \return Pointer to the line object.
  388. * \remarks This method will try to process the default node attribute first. If it cannot
  389. * find it, it will scan the list of connected node attributes and get the first
  390. * object that is a FbxNodeAttribute::eLine.
  391. * \remarks If the above search failed to get a valid pointer or it cannot
  392. * be successfully casted, this method will return \c NULL.
  393. */
  394. FbxLine* GetLine();
  395. /** Get the node attribute casted to a FbxTrimNurbsSurface pointer.
  396. * \return Pointer to the trim nurbs surface object.
  397. * \remarks This method will try to process the default node attribute first. If it cannot
  398. * find it, it will scan the list of connected node attributes and get the first
  399. * object that is a FbxNodeAttribute::eTrimNurbsSurface.
  400. * \remarks If the above search failed to get a valid pointer or it cannot
  401. * be successfully casted, this method will return \c NULL.
  402. */
  403. FbxTrimNurbsSurface* GetTrimNurbsSurface();
  404. /** Get the node attribute casted to a FbxSubDiv pointer.
  405. * \return Pointer to the subdivision surface object.
  406. * \remarks This method will try to process the default node attribute first. If it cannot
  407. * find it, it will scan the list of connected node attributes and get the first
  408. * object that is a FbxNodeAttribute::eSubDiv.
  409. * \remarks If the above search failed to get a valid pointer or it cannot
  410. * be successfully casted, this method will return \c NULL.
  411. */
  412. FbxSubDiv* GetSubdiv();
  413. /** Get the node attribute casted to a FbxPatch pointer.
  414. * \return Pointer to the patch object.
  415. * \remarks This method will try to process the default node attribute first. If it cannot
  416. * find it, it will scan the list of connected node attributes and get the first
  417. * object that is a FbxNodeAttribute::ePatch.
  418. * \remarks If the above search failed to get a valid pointer or it cannot
  419. * be successfully casted, this method will return \c NULL.
  420. */
  421. FbxPatch* GetPatch();
  422. /** Get the node attribute casted to a FbxCamera pointer.
  423. * \return Pointer to the camera object.
  424. * \remarks If the type cast failed because there is not default node attribute set or it cannot
  425. * be successfully casted, this method will return \c NULL.
  426. */
  427. FbxCamera* GetCamera();
  428. const FbxCamera* GetCamera() const;
  429. /** Get the node attribute casted to a FbxCameraStereo pointer.
  430. * \return Pointer to the stereo camera object.
  431. * \remarks If the type cast failed because there is not default node attribute set or it cannot
  432. * be successfully casted, this method will return \c NULL.
  433. */
  434. FbxCameraStereo* GetCameraStereo();
  435. /** Get the node attribute casted to a FbxCameraSwitcher pointer.
  436. * \return Pointer to the camera switcher object.
  437. * \remarks If the type cast failed because there is not default node attribute set or it cannot
  438. * be successfully casted, this method will return \c NULL.
  439. */
  440. FbxCameraSwitcher* GetCameraSwitcher();
  441. /** Get the node attribute casted to a FbxLight pointer.
  442. * \return Pointer to the light object.
  443. * \remarks If the type cast failed because there is not default node attribute set or it cannot
  444. * be successfully casted, this method will return \c NULL.
  445. */
  446. FbxLight* GetLight();
  447. const FbxLight* GetLight() const;
  448. /** Get the node attribute casted to a FbxOpticalReference pointer.
  449. * \return Pointer to the optical reference object.
  450. * \remarks If the type cast failed because there is not default node attribute set or it cannot
  451. * be successfully casted, this method will return \c NULL.
  452. */
  453. FbxOpticalReference* GetOpticalReference();
  454. //@}
  455. /**
  456. * \name Transformation propagation
  457. * This set of functions provides direct access to the transformation propagations settings
  458. * of the FbxNode. These settings determine how transformations must be applied when
  459. * evaluating a node's transformation matrix. The possible values are:
  460. * - eInheritRrSs : Scaling of parent is applied in the child world after the local child rotation.
  461. * - eInheritRSrs : Scaling of parent is applied in the parent world.
  462. * - eInheritRrs : Scaling of parent does not affect the scaling of children.
  463. */
  464. //@{
  465. /** Sets how child transforms are inherited from parent transforms.
  466. * \param pInheritType One of the following values eInheritRrSs, eInheritRSrs or eInheritRrs
  467. */
  468. void SetTransformationInheritType(FbxTransform::EInheritType pInheritType);
  469. //! Get transformation inherit type.
  470. void GetTransformationInheritType(FbxTransform::EInheritType& pInheritType) const;
  471. //@}
  472. /**
  473. * \name Pivot Management
  474. * Pivots are used to specify translation, rotation and scaling centers in coordinates
  475. * relative to a node's origin.
  476. * A node has two pivot contexts defined by the EPivotSet enumeration. The node's animation
  477. * data can be converted from one pivot context to the other. Each context can be set to be
  478. * either active or passive (reference). By default the two pivot contexts are passive. They
  479. * need to be active to be processed during the evaluation of the node final transformation
  480. * matrix. In its passive state, a pivot context can still be accessed to retrieve its content
  481. * for any other required purpose. Each pivot context stores values (as FbxVector4) for:
  482. * \code
  483. * - Rotation offset (Roff)
  484. * - Rotation pivot (Rp)
  485. * - Pre-rotation (Rpre)
  486. * - Post-rotation (Rpost)
  487. * - Scaling offset (Soff)
  488. * - Scaling pivot (Sp)
  489. * - Geometric translation (Gt)
  490. * - Geometric rotation (Gr)
  491. * - Geometric scaling (Gs)
  492. *
  493. * These values combine in the matrix form to compute the World transform of the node
  494. * using the formula:
  495. *
  496. * World = ParentWorld * T * Roff * Rp * Rpre * R * Rpost * Rp-1 * Soff * Sp * S * Sp-1
  497. * \endcode
  498. *
  499. * The geometric transformation (Gt * Gr * Gs) is applied only to the node attribute and after
  500. * the node transformations. This transformation is not inherited across the node hierarchy.
  501. *
  502. * \note Please refer to the FBX SDK programmers guide for more details.
  503. *
  504. * The application of the pivots is performed by calling the method ConvertPivotAnimation(). Typically,
  505. * you set-up the eDestinationPivot context to match what your system can directly support and leave at (0,0,0) the
  506. * attributes that are not supported by your system. When the values of a specific attribute in the
  507. * two contexts (source and destination) are identical, the system considers that no adjustment is
  508. * required because the attribute is directly supported in the destination world.
  509. *
  510. * Below is an example of code that shows how the pivot information could be setup before calling ConvertPivotAnimation().
  511. * \code
  512. * FbxVector4 lZero(0,0,0);
  513. * FbxVector4 lOne(1,1,1);
  514. * pNode->SetPivotState(FbxNode::eSourcePivot, FbxNode::ePivotActive);
  515. * pNode->SetPivotState(FbxNode::eDestinationPivot, FbxNode::ePivotActive);
  516. *
  517. * EFbxRotationOrder lRotationOrder;
  518. * pNode->GetRotationOrder(FbxNode::eSourcePivot , lRotationOrder);
  519. * pNode->SetRotationOrder(FbxNode::eDestinationPivot , lRotationOrder);
  520. *
  521. * //For cameras and lights (without targets) let's compensate the postrotation.
  522. * if( pNode->GetCamera() || pNode->GetLight() )
  523. * {
  524. * if( !pNode->GetTarget() )
  525. * {
  526. * FbxVector4 lRV(90, 0, 0);
  527. * if( pNode->GetCamera() )
  528. * lRV.Set(0, 90, 0);
  529. *
  530. * FbxVector4 prV = pNode->GetPostRotation(FbxNode::eSourcePivot);
  531. * FbxAMatrix lSourceR;
  532. * FbxAMatrix lR(lZero, lRV, lOne);
  533. * FbxVector4 res = prV;
  534. *
  535. * // Rotation order don't affect post rotation, so just use the default XYZ order
  536. * FbxRotationOrder rOrder;
  537. * rOrder.V2M(lSourceR, res);
  538. *
  539. * lR = lSourceR * lR;
  540. * rOrder.M2V(res, lR);
  541. * prV = res;
  542. * pNode->SetPostRotation(FbxNode::eSourcePivot, prV);
  543. * pNode->SetRotationActive(true);
  544. * }
  545. *
  546. * // Point light do not need to be adjusted (since they radiate in all the directions).
  547. * if( pNode->GetLight() && pNode->GetLight()->LightType.Get() == FbxLight::ePoint )
  548. * {
  549. * pNode->SetPostRotation(FbxNode::eSourcePivot, FbxVector4(0,0,0,0));
  550. * }
  551. * }
  552. * // apply Pre rotations only on bones / end of chains
  553. * if( pNode->GetNodeAttribute() && pNode->GetNodeAttribute()->GetAttributeType() == FbxNodeAttribute::eSkeleton
  554. * || (pNode->GetMarker() && pNode->GetMarker()->GetType() == FbxMarker::eEffectorFK)
  555. * || (pNode->GetMarker() && pNode->GetMarker()->GetType() == FbxMarker::eEffectorIK) )
  556. * {
  557. * if( pNode->GetRotationActive() )
  558. * {
  559. * pNode->SetPreRotation(FbxNode::eDestinationPivot, pNode->GetPreRotation(FbxNode::eSourcePivot));
  560. * }
  561. *
  562. * // No pivots on bones
  563. * pNode->SetRotationPivot(FbxNode::eDestinationPivot, lZero);
  564. * pNode->SetScalingPivot(FbxNode::eDestinationPivot, lZero);
  565. * pNode->SetRotationOffset(FbxNode::eDestinationPivot,lZero);
  566. * pNode->SetScalingOffset(FbxNode::eDestinationPivot, lZero);
  567. * }
  568. * else
  569. * {
  570. * // any other type: no pre-rotation support but...
  571. * pNode->SetPreRotation(FbxNode::eDestinationPivot, lZero);
  572. *
  573. * // support for rotation and scaling pivots.
  574. * pNode->SetRotationPivot(FbxNode::eDestinationPivot, pNode->GetRotationPivot(FbxNode::eSourcePivot));
  575. * pNode->SetScalingPivot(FbxNode::eDestinationPivot, pNode->GetScalingPivot(FbxNode::eSourcePivot));
  576. * // Rotation and scaling offset are supported
  577. * pNode->SetRotationOffset(FbxNode::eDestinationPivot, pNode->GetRotationOffset(FbxNode::eSourcePivot));
  578. * pNode->SetScalingOffset(FbxNode::eDestinationPivot, pNode->GetScalingOffset(FbxNode::eSourcePivot));
  579. * //
  580. * // If we don't "support" scaling pivots, we can simply do:
  581. * // pNode->SetRotationPivot(FbxNode::eDestinationPivot, lZero);
  582. * // pNode->SetScalingPivot(FbxNode::eDestinationPivot, lZero);
  583. * }
  584. * \endcode
  585. *
  586. */
  587. //@{
  588. /** \enum EPivotSet Pivot context identifier.
  589. */
  590. enum EPivotSet
  591. {
  592. eSourcePivot, //!< The source pivot context.
  593. eDestinationPivot //!< The destination pivot context.
  594. };
  595. /** \enum EPivotState Pivot context state.
  596. */
  597. enum EPivotState
  598. {
  599. ePivotActive, //!< The pivot context with this state is affecting the node's transform computation.
  600. ePivotReference //!< The pivot context with this state is not used during the node transform computation but can be accessed for reference purposes.
  601. };
  602. /** Change the state of the pivot context.
  603. * \param pPivotSet Specify which pivot context is manipulated.
  604. * \param pPivotState The new state of the pivot context.
  605. */
  606. void SetPivotState(EPivotSet pPivotSet, EPivotState pPivotState);
  607. /** Get the pivot context state.
  608. * The returned value tells if this pivot context is used in the
  609. * evaluation of the node transform or not.
  610. * \param pPivotSet Specify which pivot context is queried.
  611. * \param pPivotState The current state of the pivot set.
  612. */
  613. void GetPivotState(EPivotSet pPivotSet, EPivotState& pPivotState) const;
  614. /** Set rotation space
  615. * Determine the rotation space (Euler or Spheric) and the rotation order.
  616. * \param pPivotSet Specify which pivot context is manipulated.
  617. * \param pRotationOrder The new value for the pivot rotation order.
  618. */
  619. void SetRotationOrder(EPivotSet pPivotSet, EFbxRotationOrder pRotationOrder);
  620. /** Get rotation order
  621. * \param pPivotSet Specify which pivot context is queried.
  622. * \param pRotationOrder The current value of the pivot rotation order.
  623. */
  624. void GetRotationOrder(EPivotSet pPivotSet, EFbxRotationOrder& pRotationOrder) const;
  625. /** Set rotation space for limit only.
  626. * \param pPivotSet Specify which pivot context is manipulated.
  627. * \param pUseForLimitOnly When set to \c true, the current rotation space
  628. * (set with SetRotationOrder) define the rotation space for
  629. * the limit only; leaving the rotation animation in
  630. * Euler XYZ space. When set to \c false, the current rotation
  631. * space defines the rotation space for both the limits and the
  632. * rotation animation data.
  633. */
  634. void SetUseRotationSpaceForLimitOnly(EPivotSet pPivotSet, bool pUseForLimitOnly);
  635. /** Get rotation space for limit only.
  636. * \param pPivotSet Specify which pivot context is queried.
  637. * \return The current rotation space limit flag value.
  638. */
  639. bool GetUseRotationSpaceForLimitOnly(EPivotSet pPivotSet) const;
  640. /** Set the RotationActive state.
  641. * \param pVal The new state of the property.
  642. * \remarks When this flag is set to false, the RotationOrder, the Pre/Post rotation values
  643. * and the rotation limits should be ignored.
  644. */
  645. void SetRotationActive(bool pVal);
  646. /** Get the RotationActive state.
  647. * \return The value of the RotationActive flag.
  648. */
  649. bool GetRotationActive() const;
  650. /** Specify which Quaternion interpolation mode is used on the pivot context.
  651. * \param pPivotSet Specify which pivot context is manipulated.
  652. * \param pQuatIterp The new value.
  653. * \remarks When the \e pPivotSet is eSourcePivot, this method also updates the value of the
  654. * QuaternionInterpolate property.
  655. */
  656. void SetQuaternionInterpolation(EPivotSet pPivotSet, EFbxQuatInterpMode pQuatIterp);
  657. /** Get the Quaternion interpolation mode of the pivot context.
  658. * \param pPivotSet Specify which pivot context is queried.
  659. * \return The current mode set on the pivot context.
  660. */
  661. EFbxQuatInterpMode GetQuaternionInterpolation(EPivotSet pPivotSet) const;
  662. /** Set the rotation stiffness.
  663. * The stiffness attribute is used by IK solvers to generate a resistance
  664. * to a joint motion. The higher the stiffness the less it will rotate.
  665. * Stiffness works in a relative sense: it determines the willingness of
  666. * this joint to rotate with respect to the other joint in the IK chain.
  667. * \param pRotationStiffness The rotation stiffness values are limited to
  668. * the range [0, 100].
  669. */
  670. void SetRotationStiffness(FbxVector4 pRotationStiffness);
  671. /** Get the rotation stiffness
  672. * \return The currently set rotation stiffness values.
  673. */
  674. FbxVector4 GetRotationStiffness() const;
  675. /** Set the minimum damp range angles.
  676. * This attributes apply resistance to a joint rotation as it approaches the
  677. * lower boundary of its rotation limits. This functionality allows joint
  678. * motion to slow down smoothly until the joint reaches its rotation limits
  679. * instead of stopping abruptly. The MinDampRange specifies when the
  680. * deceleration should start.
  681. * \param pMinDampRange Angle, in degrees, where deceleration should start
  682. */
  683. void SetMinDampRange(FbxVector4 pMinDampRange);
  684. /** Get the minimum damp range angles
  685. * \return The currently set minimum damp range angles.
  686. */
  687. FbxVector4 GetMinDampRange() const;
  688. /** Set the maximum damp range angles.
  689. * This attributes apply resistance to a joint rotation as it approaches the
  690. * upper boundary of its rotation limits. This functionality allows joint
  691. * motion to slow down smoothly until the joint reaches its rotation limits
  692. * instead of stopping abruptly. The MaxDampRange specifies when the
  693. * deceleration should start.
  694. * \param pMaxDampRange Angle, in degrees, where deceleration should start
  695. */
  696. void SetMaxDampRange(FbxVector4 pMaxDampRange);
  697. /** Get the maximum damp range angles
  698. * \return The currently set maximum damp range angles.
  699. */
  700. FbxVector4 GetMaxDampRange() const;
  701. /** Set the minimum damp strength.
  702. * This attributes apply resistance to a joint rotation as it approaches the
  703. * lower boundary of its rotation limits. This functionality allows joint
  704. * motion to slow down smoothly until the joint reaches its rotation limits
  705. * instead of stopping abruptly. The MinDampStrength defines the
  706. * rate of deceleration.
  707. * \param pMinDampStrength Values are limited to the range [0, 100].
  708. */
  709. void SetMinDampStrength(FbxVector4 pMinDampStrength);
  710. /** Get the minimum damp strength
  711. * \return The currently set minimum damp strength values.
  712. */
  713. FbxVector4 GetMinDampStrength() const;
  714. /** Set the maximum damp strength.
  715. * This attributes apply resistance to a joint rotation as it approaches the
  716. * upper boundary of its rotation limits. This functionality allows joint
  717. * motion to slow down smoothly until the joint reaches its rotation limits
  718. * instead of stopping abruptly. The MaxDampStrength defines the
  719. * rate of deceleration.
  720. * \param pMaxDampStrength Values are limited to the range [0, 100].
  721. */
  722. void SetMaxDampStrength(FbxVector4 pMaxDampStrength);
  723. /** Get the maximum damp strength
  724. * \return The currently set maximum damp strength values.
  725. */
  726. FbxVector4 GetMaxDampStrength() const;
  727. /** Set the preferred angle.
  728. * The preferredAngle attribute defines the initial joint configuration used
  729. * by a single chain IK solver to calculate the inverse kinematic solution.
  730. * \param pPreferedAngle Angle in degrees
  731. */
  732. void SetPreferedAngle(FbxVector4 pPreferedAngle);
  733. /** Get the preferred angle
  734. * \return The currently set preferred angle.
  735. */
  736. FbxVector4 GetPreferedAngle() const;
  737. /** Set a translation offset for the rotation pivot.
  738. * The translation offset is in coordinates relative to the node's origin.
  739. * \param pPivotSet Specify which pivot set to modify.
  740. * \param pVector The X,Y and Z translation values (the 4th component of the FbxVector4 is ignored).
  741. */
  742. void SetRotationOffset(EPivotSet pPivotSet, FbxVector4 pVector);
  743. /** Get the translation offset for the rotation pivot.
  744. * The translation offset is in coordinates relative to the node's origin.
  745. * \param pPivotSet Specify which pivot set to to query the value.
  746. * \return The X, Y and Z translation offset values (the 4th component of the FbxVector4 is always 1).
  747. */
  748. const FbxVector4& GetRotationOffset(EPivotSet pPivotSet) const;
  749. /** Set rotation pivot.
  750. * The rotation pivot is the center of rotation in coordinates relative to
  751. * the node's origin.
  752. * \param pPivotSet Specify which pivot set to modify.
  753. * \param pVector The new position of the rotation pivot (the 4th component of the FbxVector4 is ignored).
  754. */
  755. void SetRotationPivot(EPivotSet pPivotSet, FbxVector4 pVector);
  756. /** Get rotation pivot.
  757. * The rotation pivot is the center of rotation in coordinates relative to
  758. * the node's origin.
  759. * \param pPivotSet Specify which pivot set to query.
  760. * \return The current position of the rotation pivot (the 4th component of the FbxVector4 is always 1).
  761. */
  762. const FbxVector4& GetRotationPivot(EPivotSet pPivotSet) const;
  763. /** Set pre-rotation in Euler angles.
  764. * The pre-rotation is the rotation applied to the node before
  765. * rotation animation data.
  766. * \param pPivotSet Specify which pivot set to modify.
  767. * \param pVector The X,Y,Z rotation values to set (the 4th component of the FbxVector4 is ignored).
  768. */
  769. void SetPreRotation(EPivotSet pPivotSet, FbxVector4 pVector);
  770. /** Get pre-rotation in Euler angles.
  771. * The pre-rotation is the rotation applied to the node before
  772. * rotation animation data.
  773. * \param pPivotSet Specify which pivot set to query.
  774. * \return The X,Y and Z rotation values (the 4th component of the FbxVector4 is always 1).
  775. */
  776. const FbxVector4& GetPreRotation(EPivotSet pPivotSet) const;
  777. /** Set post-rotation in Euler angles.
  778. * The post-rotation is the rotation applied to the node after the
  779. * rotation animation data.
  780. * \param pPivotSet Specify which pivot set to modify.
  781. * \param pVector The X,Y,Z rotation values to set (the 4th component of the FbxVector4 is ignored).
  782. */
  783. void SetPostRotation(EPivotSet pPivotSet, FbxVector4 pVector);
  784. /** Get post-rotation in Euler angles.
  785. * The post-rotation is the rotation applied to the node after the
  786. * rotation animation data.
  787. * \param pPivotSet Specify which pivot set to query.
  788. * \return The X,Y and Z rotation values (the 4th component of the FbxVector4 is always 1).
  789. */
  790. const FbxVector4& GetPostRotation(EPivotSet pPivotSet) const;
  791. /** Set a translation offset for the scaling pivot.
  792. * The translation offset is in coordinates relative to the node's origin.
  793. * \param pPivotSet Specify which pivot set to modify.
  794. * \param pVector The X,Y and Z translation values (the 4th component of the FbxVector4 is ignored).
  795. */
  796. void SetScalingOffset(EPivotSet pPivotSet, FbxVector4 pVector);
  797. /** Get the translation offset for the scaling pivot.
  798. * The translation offset is in coordinates relative to the node's origin.
  799. * \param pPivotSet Specify which pivot set to query the value.
  800. * \return The X, Y and Z translation offset values (the 4th component of the FbxVector4 is always 1).
  801. */
  802. const FbxVector4& GetScalingOffset(EPivotSet pPivotSet) const;
  803. /** Set scaling pivot.
  804. * The scaling pivot is the center of scaling in coordinates relative to
  805. * the node's origin.
  806. * \param pPivotSet Specify which pivot set to modify.
  807. * \param pVector The new position of the scaling pivot (the 4th component of the FbxVector4 is ignored).
  808. */
  809. void SetScalingPivot(EPivotSet pPivotSet, FbxVector4 pVector);
  810. /** Get scaling pivot.
  811. * The scaling pivot is the center of scaling in coordinates relative to
  812. * the node's origin.
  813. * \param pPivotSet Specify which pivot set to query.
  814. * \return The current position of the rotation pivot (the 4th component of the FbxVector4 is always 1).
  815. */
  816. const FbxVector4& GetScalingPivot(EPivotSet pPivotSet) const;
  817. /** Set geometric translation
  818. * The geometric translation is a local translation that is applied
  819. * to a node attribute only. This translation is applied to the node attribute
  820. * after the node transformations. This translation is not inherited across the
  821. * node hierarchy.
  822. * \param pPivotSet Specify which pivot set to modify.
  823. * \param pVector The X, Y, and Z translation values (the 4th component of the FbxVector4 is ignored).
  824. */
  825. void SetGeometricTranslation(EPivotSet pPivotSet, FbxVector4 pVector);
  826. /** Get geometric translation
  827. * \param pPivotSet Specify which pivot set to query.
  828. * \return The current geometric translation (the 4th component of the FbxVector4 is always 1).
  829. */
  830. FbxVector4 GetGeometricTranslation(EPivotSet pPivotSet) const;
  831. /** Set geometric rotation
  832. * The geometric rotation is a local rotation that is applied
  833. * to a node attribute only. This rotation is applied to the node attribute
  834. * after the node transformations. This rotation is not inherited across the
  835. * node hierarchy.
  836. * \param pPivotSet Specify which pivot set to modify.
  837. * \param pVector The X,Y and Z rotation values (the 4th component of the FbxVector4 is ignored).
  838. */
  839. void SetGeometricRotation(EPivotSet pPivotSet, FbxVector4 pVector);
  840. /** Get geometric rotation
  841. * \param pPivotSet Specify which pivot set to query.
  842. * \return The current geometric rotation (the 4th component of the FbxVector4 is always 1).
  843. */
  844. FbxVector4 GetGeometricRotation(EPivotSet pPivotSet) const;
  845. /** Set geometric scaling
  846. * The geometric scaling is a local scaling that is applied
  847. * to a node attribute only. This scaling is applied to the node attribute
  848. * after the node transformations. This scaling is not inherited across the
  849. * node hierarchy.
  850. * \param pPivotSet Specify which pivot set to modify.
  851. * \param pVector The X,Y and Z scale values (the 4th component of the FbxVector4 is ignored).
  852. */
  853. void SetGeometricScaling(EPivotSet pPivotSet, FbxVector4 pVector);
  854. /** Get geometric scaling
  855. * \param pPivotSet Specify which pivot set to query.
  856. * \return The current geometric scaling (the 4th component of the FbxVector4 is always 1).
  857. */
  858. FbxVector4 GetGeometricScaling(EPivotSet pPivotSet) const;
  859. /** Reset a pivot set to the default pivot context.
  860. * If the node has a geometry, reset the geometry's pivot to the identity matrix.
  861. * \param pPivotSet Pivot set to reset.
  862. * \remarks The default pivot context is a context with all the vector attributes
  863. * set to (0,0,0) except the GeometricScaling attribute that is reset to (1,1,1).
  864. */
  865. void ResetPivotSet( FbxNode::EPivotSet pPivotSet );
  866. /** This version is an improved version of the ConvertPivotAnimation(). It fully supports all the
  867. * attributes defined in the pivot sets and can process animation data defined on different animation
  868. * stack.
  869. * \param pAnimStack The animation stack on which the conversion will take place. If equals \c NULL, convert the animation on all the animation stacks.
  870. * \param pConversionTarget If set to EPivotSet::eDestinationPivot,
  871. * convert animation data from the EPivotSet::eSourcePivot pivot context
  872. * to the EPivotSet::eDestinationPivot pivot context. Otherwise, the
  873. * conversion is computed the other way around.
  874. * \param pFrameRate Resampling frame rate in frames per second.
  875. * \param pKeyReduce Apply or skip key reducing filter.
  876. * \remarks Due to the intrinsic properties of the mathematical operations performed,
  877. * sometimes, it is necessary to resample animation curves to maintain the accurate
  878. * conversion. When this resampling is required, the method will use the \e pFrameRate
  879. * value to specify the number of samples. To avoid a huge number of keys in the animation
  880. * curves, a constant key reducer filter (FbxKFCurveFilterConstantKeyReducer) is
  881. * automatically applied to all the affected curves to remove as much consecutive keys
  882. * that have the same value. This filter is private and its settings cannot be changed.
  883. * It is possible that, after the filtering pass, the animations curves do not contain keys
  884. * anymore. This is a normal result and does not affect the overall results.
  885. * \note Although it is possible to call this method several times with a different
  886. * AnimStack name, users must be aware that some pivot computation can irreversibly
  887. * modify the geometric nodes with a cumulative effect of the \e GeometricTranslation,
  888. * \e GeometricRotation and \e GeometricScaling which will produce undesirable results. It is recommended
  889. * to call ConvertPivotAnimationRecursive with \p pAnimStackName = NULL and let the method convert
  890. * the animation on all the Anim stacks at once.
  891. * In the case when there are no geometric nodes in the scene tree, specifying the animation stack
  892. * is safe and somewhat faster.
  893. * If any transform limits are active, they are applied during the conversion and disabled.
  894. */
  895. void ConvertPivotAnimationRecursive(FbxAnimStack* pAnimStack, EPivotSet pConversionTarget, double pFrameRate, bool pKeyReduce=true);
  896. /** Reset all the pivot sets to the default pivot context and convert the animation.
  897. * \param pFrameRate Resampling frame rate in frames per second.
  898. * \param pKeyReduce Apply or skip key reducing filter.
  899. * \param pToNodeCenter: Reset pivots to node center if \c true, or retain pivot places if \c false.
  900. * \param pForceResetLimits If \c true, this flag will reset all the Translation, Rotation and Scaling
  901. * limits and clears the enabled flags.
  902. * \remarks The resulting animation will be visually equivalent and all the pivots will be cleared.
  903. * The conversion is performed on all animation stacks.
  904. * \remarks Will recursively convert the animation of all the children nodes.
  905. * \remarks The \e pForceResetLimits flag has a destructive behavior and should be used only in very
  906. * limited cases where the values of the limits are not required after the call to this method.
  907. * \remarks Currently, this function just works under RSrs inherit type if pToNodeCenter is set to \c false.
  908. */
  909. void ResetPivotSetAndConvertAnimation(double pFrameRate=30.0, bool pKeyReduce=false, bool pToNodeCenter=true, bool pForceResetLimits=false);
  910. /** Set rotation pivot as node center recursively
  911. * \param pParentGeometricOffset Offset vector to be applied.
  912. */
  913. void SetRotationPivotAsCenterRecursive(FbxVector4 pParentGeometricOffset=FbxVector4());
  914. //@}
  915. /**
  916. * \name Node Evaluation Functions
  917. */
  918. //@{
  919. /** Retrieve the proper animation evaluator to use for this node.
  920. * \return If the object has no scene, returns the default evaluator, otherwise the object's scene evaluator. */
  921. FbxAnimEvaluator* GetAnimationEvaluator() const;
  922. /** Returns this node's global transformation matrix at the specified time. The node's translation, rotation and scaling limits are taken into consideration.
  923. * \param pTime The time used for evaluate. If FBXSDK_TIME_INFINITE is used, this returns the default value, without animation curves evaluation.
  924. * \param pPivotSet The pivot set to take into account
  925. * \param pApplyTarget Applies the necessary transform to align into the target node
  926. * \param pForceEval Force the evaluator to refresh the evaluation state cache even if its already up-to-date.
  927. * \return The resulting global transform of the specified node at the specified time.
  928. * \remarks This function is the equivalent of calling Scene->GetEvaluator()->GetNodeGlobalTransform().
  929. */
  930. FbxAMatrix& EvaluateGlobalTransform(FbxTime pTime=FBXSDK_TIME_INFINITE, FbxNode::EPivotSet pPivotSet=FbxNode::eSourcePivot, bool pApplyTarget=false, bool pForceEval=false);
  931. /** Returns this node's local transformation matrix at the specified time. The node's translation, rotation and scaling limits are taken into consideration.
  932. * \param pTime The time used for evaluate. If FBXSDK_TIME_INFINITE is used, this returns the default value, without animation curves evaluation.
  933. * \param pPivotSet The pivot set to take into account
  934. * \param pApplyTarget Applies the necessary transform to align into the target node
  935. * \param pForceEval Force the evaluator to refresh the evaluation state cache even if its already up-to-date.
  936. * \return The resulting local transform of the specified node for the specified time.
  937. * \remarks The local transform matrix is calculated in this way: ParentGlobal.Inverse * Global, all transforms such as pre/post rotation are taken into consideration.
  938. * This will return a different value than LclTranslation, LclRotation and LclScaling at the specified time. To evaluate these properties separately
  939. * without taking pre/post rotation, pivots and offsets into consideration, please use GetNodeLocalTranslation(), GetNodeLocalRotation() and GetNodeLocalScaling().
  940. * This function is the equivalent of calling Scene->GetEvaluator()->GetNodeLocalTransform().
  941. */
  942. FbxAMatrix& EvaluateLocalTransform(FbxTime pTime=FBXSDK_TIME_INFINITE, FbxNode::EPivotSet pPivotSet=FbxNode::eSourcePivot, bool pApplyTarget=false, bool pForceEval=false);
  943. /** Returns this node's LclTranslation property at the specified time.
  944. * No pivot, offsets, or any other transform is taken into consideration. The translation limit is applied.
  945. * \param pTime The time used for evaluate. If FBXSDK_TIME_INFINITE is used, this returns the default value, without animation curves evaluation.
  946. * \param pPivotSet The pivot set to take into account
  947. * \param pApplyTarget Applies the necessary transform to align into the target node
  948. * \param pForceEval Force the evaluator to refresh the evaluation state cache even if its already up-to-date.
  949. * \return The resulting value of LclTranslation property of the specified node at the specified time.
  950. * \remarks This function is the equivalent of calling Scene->GetEvaluator()->GetNodeLocalTranslation().
  951. */
  952. FbxVector4& EvaluateLocalTranslation(FbxTime pTime=FBXSDK_TIME_INFINITE, FbxNode::EPivotSet pPivotSet=FbxNode::eSourcePivot, bool pApplyTarget=false, bool pForceEval=false);
  953. /** Returns this node's LclRotation property at the specified time.
  954. * No pre/post rotation, rotation pivot, rotation offset or any other transform is taken into consideration. The rotation limit is applied.
  955. * \param pTime The time used for evaluate. If FBXSDK_TIME_INFINITE is used, this returns the default value, without animation curves evaluation.
  956. * \param pPivotSet The pivot set to take into account
  957. * \param pApplyTarget Applies the necessary transform to align into the target node
  958. * \param pForceEval Force the evaluator to refresh the evaluation state cache even if its already up-to-date.
  959. * \return The resulting value of LclRotation property of the specified node at the specified time.
  960. * \remarks This function is the equivalent of calling Scene->GetEvaluator()->GetNodeLocalRotation().
  961. */
  962. FbxVector4& EvaluateLocalRotation(FbxTime pTime=FBXSDK_TIME_INFINITE, FbxNode::EPivotSet pPivotSet=FbxNode::eSourcePivot, bool pApplyTarget=false, bool pForceEval=false);
  963. /** Returns this node's LclScaling property at the specified time.
  964. * No scaling pivot, scaling offset or any other transform is taken into consideration. The scaling limit is applied.
  965. * \param pTime The time used for evaluate. If FBXSDK_TIME_INFINITE is used, this returns the default value, without animation curves evaluation.
  966. * \param pPivotSet The pivot set to take into account
  967. * \param pApplyTarget Applies the necessary transform to align into the target node
  968. * \param pForceEval Force the evaluator to refresh the evaluation state cache even if its already up-to-date.
  969. * \return The resulting value of LclScaling property of the specified node at the specified time.
  970. * \remarks This function is the equivalent of calling Scene->GetEvaluator()->GetNodeLocalScaling().
  971. */
  972. FbxVector4& EvaluateLocalScaling(FbxTime pTime=FBXSDK_TIME_INFINITE, FbxNode::EPivotSet pPivotSet=FbxNode::eSourcePivot, bool pApplyTarget=false, bool pForceEval=false);
  973. /** Compute the node's bounding box and its center in global coordinates.
  974. * \param pBBoxMin The minimum value of the bounding box upon successful return.
  975. * \param pBBoxMax The maximum value of the bounding box upon successful return.
  976. * \param pBBoxCenter The center value of the bounding box upon successful return.
  977. * \param pTime If different from FBXSDK_TIME_INFINITE, time used to compute the bounding box for deformed geometry.
  978. * \return \c true if successful, otherwise \c false.
  979. * \remark If geometry have been unloaded from memory, their bounding box cannot be calculated and will use any value set previously. */
  980. bool EvaluateGlobalBoundingBoxMinMaxCenter(FbxVector4& pBBoxMin, FbxVector4& pBBoxMax, FbxVector4& pBBoxCenter, const FbxTime& pTime=FBXSDK_TIME_INFINITE);
  981. /** Compute closest ray intersection point with mesh attributes of this node (triangle meshes only!).
  982. * \param pOut The closest intersection point from pRayOrigin location in pRayDir direction. Variable is unchanged if return value is \c false.
  983. * \param pRayOrigin The origin location to cast the ray from.
  984. * \param pRayDir The direction the cast ray to test mesh triangles from.
  985. * \param pCulling If \c true, only test triangles that are front facing, otherwise test both sides.
  986. * \param pTime The time to use to evaluate mesh deformations.
  987. * \return \c true if a triangle intersect with the ray, otherwise \c false.
  988. * \remark This function will automatically fail if the node's meshes are not triangulated. */
  989. bool EvaluateRayIntersectionPoint(FbxVector4& pOut, const FbxVector4& pRayOrigin, const FbxVector4& pRayDir, bool pCulling=false, const FbxTime& pTime=FBXSDK_TIME_INFINITE);
  990. //@}
  991. /**
  992. * \name Character Link
  993. */
  994. //@{
  995. /** Get number of character links.
  996. * \return The number of character links.
  997. */
  998. int GetCharacterLinkCount() const;
  999. /** Get character link at given index.
  1000. * \param pIndex Index of character link.
  1001. * \param pCharacter Pointer to receive linked character if function succeeds.
  1002. * \param pCharacterLinkType Pointer to receive character link type if function succeeds,
  1003. * cast to \c FbxCharacterLink::Type.
  1004. * \param pNodeId Pointer to receive the node ID if function succeeds. This ID should be casted
  1005. * to \c FbxCharacter::ENodeId type when the character link type is \c eCharacterLink or
  1006. * \c eControlSetLink else to the \c FbxEffector::ENodeId type if the character link type is
  1007. * \c eControlSetEffector or \c eControlSetEffectorAux.
  1008. * \param pNodeSubId For internal use.
  1009. * \return \c false if the index is out of range or any of the pointer arguments is NULL.
  1010. */
  1011. bool GetCharacterLink(int pIndex, FbxCharacter** pCharacter, int* pCharacterLinkType, int* pNodeId, int* pNodeSubId);
  1012. /** Looks if the given character link exists on this node.
  1013. * \param pCharacter Character searched.
  1014. * \param pCharacterLinkType Character link type searched. Its value must be one of
  1015. * the \c FbxCharacterLink::Type symbols..
  1016. * \param pNodeId Node ID searched. If \e pCharacterLinkType is \c eCharacterLink or \c eControlSetLink
  1017. * the \e pNodeId value is casted to the \c FbxCharacter::ENodeId type. If the \e pCharacterLinkType
  1018. * is \c eControlSetEffector or \c eControlSetEffectorAux then the \e pNodeId is casted to the
  1019. * \c FbxEffector::ENodeId type.
  1020. * \param pNodeSubId For internal use.
  1021. * \return Index of found character link if it exists, -1 otherwise.
  1022. */
  1023. int FindCharacterLink(FbxCharacter* pCharacter, int pCharacterLinkType, int pNodeId, int pNodeSubId) const;
  1024. //@}
  1025. /** Find out start and end time of the animation curves for this node (and its children).
  1026. * \param pInterval This node's animation interval.
  1027. * \param pAnimStack Animation stack where to retrieve animation curves.
  1028. * \param pAnimLayerId Specific animation layer on the animStack to use.
  1029. * \return \c true if the node (or its children) is animated, \c false otherwise.
  1030. * \remarks If pAnimStack is left NULL, the function will try to get the first AnimStack that is connected
  1031. * to the scene. \e pAnimLayerId represent the index of the connection. For example, the call:
  1032. * \code
  1033. * lNode->GetAnimationInterval(span, myStack, 3);
  1034. * \endcode
  1035. * will scan all the animation curves of this node, and it's children, that are defined on the third
  1036. * animation layer of \c myStack.
  1037. */
  1038. bool GetAnimationInterval(FbxTimeSpan& pInterval, FbxAnimStack* pAnimStack=NULL, int pAnimLayerId=0);
  1039. /**
  1040. * \name Material Management
  1041. */
  1042. //@{
  1043. /** Add a material to this node.
  1044. * \param pMaterial The material to add.
  1045. * \return non-negative index of added material, or -1 on error.
  1046. */
  1047. int AddMaterial(FbxSurfaceMaterial* pMaterial);
  1048. /** Remove a material from this node.
  1049. * \param pMaterial The material to remove.
  1050. * \return true on success, false otherwise
  1051. */
  1052. bool RemoveMaterial(FbxSurfaceMaterial* pMaterial);
  1053. /**
  1054. * \return The number of materials applied to this node.
  1055. * \remarks If this node has an instanced node attribute, it is possible
  1056. * to have a material applied to this node more than once. The material
  1057. * count may not reflect the distinct material count.
  1058. */
  1059. int GetMaterialCount() const;
  1060. /** Access a material on this node.
  1061. * \param pIndex Valid range is [0, GetMaterialCount() - 1]
  1062. * \return The pIndex-th material, or NULL if pIndex is invalid.
  1063. */
  1064. FbxSurfaceMaterial* GetMaterial(int pIndex) const;
  1065. /** Remove all materials applied to this node.
  1066. */
  1067. void RemoveAllMaterials();
  1068. /** Find an applied material with the given name.
  1069. * \param pName The requested name
  1070. * \return an index to a material, or -1 if no applied material
  1071. * has the requested name.
  1072. */
  1073. int GetMaterialIndex(const char* pName) const;
  1074. //@}
  1075. /**
  1076. * \name Public and fast access Properties
  1077. */
  1078. //@{
  1079. /** This property contains the translation information of the node
  1080. *
  1081. * To access this property do: LclTranslation.Get().
  1082. * To set this property do: LclTranslation.Set(FbxDouble3).
  1083. *
  1084. * Default value is 0.,0.,0.
  1085. */
  1086. FbxPropertyT<FbxDouble3> LclTranslation;
  1087. /** This property contains the rotation information of the node
  1088. *
  1089. * To access this property do: LclRotation.Get().
  1090. * To set this property do: LclRotation.Set(FbxDouble3).
  1091. *
  1092. * Default value is 0.,0.,0.
  1093. */
  1094. FbxPropertyT<FbxDouble3> LclRotation;
  1095. /** This property contains the scaling information of the node
  1096. *
  1097. * To access this property do: LclScaling.Get().
  1098. * To set this property do: LclScaling.Set(FbxDouble3).
  1099. *
  1100. * Default value is 1.,1.,1.
  1101. */
  1102. FbxPropertyT<FbxDouble3> LclScaling;
  1103. /** This property contains the visibility information of the node.
  1104. * The assumed behavior of this property is to affect the visibility of the node, all the
  1105. * nodes attributes connected to it as well as all its descendants. This property can be
  1106. * animated.
  1107. *
  1108. * To access this property do: Visibility.Get().
  1109. * To set this property do: Visibility.Set(FbxDouble).
  1110. *
  1111. * Default value is 1.
  1112. * \remarks \li This property holds values ranging from 0.0 to 1.0 where the value 0.0 means
  1113. * a totally invisible object, the value 1.0, a full visible object and anything inbetween, a
  1114. * percentage degree of visibility.\n
  1115. *
  1116. * \li Since not all the applications may support a degree of visibility, it is agreed that
  1117. * a value of 0.0 means invisible and anything else means visible.
  1118. *
  1119. * \see Show property.
  1120. */
  1121. FbxPropertyT<FbxDouble> Visibility;
  1122. /** This property contains the visibility inheritance flag that allow applications to modify
  1123. * the Visibility property interpretation. By default, this value is set to \c true because it is
  1124. * assumed (as explained in the Visibility property description) that the node visibility is inherited
  1125. * from its parent. In other words, applications should always process the Visibility property of the
  1126. * node and, depending on its value, decide whether or not the node has to be displayed. After
  1127. * this first assessment, check the node VisibilityInheritance flag. If its value is set to \c false then
  1128. * move to the next object, else use the parent's Visibility value and modify this node display state
  1129. * by performing the logical AND operation between this node Visibility property and its parent's.
  1130. *
  1131. * To access this property do: VisibilityInheritance.Get().
  1132. * To set this property do: VisibilityInheritance.Set(FbxBool).
  1133. *
  1134. * Default value is \c true.
  1135. * \remarks This property is non-animatable and is not used inside the FBX SDK but it is guaranteed
  1136. * to exist in FBX files with version 7.2 and above.
  1137. * \see Visibility property.
  1138. */
  1139. FbxPropertyT<FbxBool> VisibilityInheritance;
  1140. /** This property contains the quaternion interpolate flag of the node
  1141. *
  1142. * To access this property do: QuaternionInterpolate.Get().
  1143. * To set this property do: QuaternionInterpolate.Set(EFbxQuatInterpMode).
  1144. *
  1145. * Default value is eQuatInterpOff.
  1146. */
  1147. FbxPropertyT<EFbxQuatInterpMode> QuaternionInterpolate;
  1148. /** This property contains the rotation offset information of the node
  1149. *
  1150. * To access this property do: RotationOffset.Get().
  1151. * To set this property do: RotationOffset.Set(FbxDouble3).
  1152. *
  1153. * Default value is 0.,0.,0.
  1154. */
  1155. FbxPropertyT<FbxDouble3> RotationOffset;
  1156. /** This property contains the rotation pivot information of the node
  1157. *
  1158. * To access this property do: RotationPivot.Get().
  1159. * To set this property do: RotationPivot.Set(FbxDouble3).
  1160. *
  1161. * Default value is 0.,0.,0.
  1162. */
  1163. FbxPropertyT<FbxDouble3> RotationPivot;
  1164. /** This property contains the scaling offset information of the node
  1165. *
  1166. * To access this property do: ScalingOffset.Get().
  1167. * To set this property do: ScalingOffset.Set(FbxDouble3).
  1168. *
  1169. * Default value is 0.,0.,0.
  1170. */
  1171. FbxPropertyT<FbxDouble3> ScalingOffset;
  1172. /** This property contains the scaling pivot information of the node
  1173. *
  1174. * To access this property do: ScalingPivot.Get().
  1175. * To set this property do: ScalingPivot.Set(FbxDouble3).
  1176. *
  1177. * Default value is 0.,0.,0.
  1178. */
  1179. FbxPropertyT<FbxDouble3> ScalingPivot;
  1180. /** This property enables or disables the limit on translation.
  1181. * When set to \c false the object can translate in any direction without limitations.
  1182. * Else the
  1183. * \ref TranslationMinX, \ref TranslationMinY, \ref TranslationMinZ,
  1184. * \ref TranslationMaxX, \ref TranslationMaxY and \ref TranslationMaxZ flags are used to
  1185. * limit the translation on each individual axis.
  1186. *
  1187. * To access this property do: TranslationActive.Get().
  1188. * To set this property do: TranslationActive.Set(FbxBool).
  1189. *
  1190. * Default value is false.
  1191. */
  1192. FbxPropertyT<FbxBool> TranslationActive;
  1193. /** This property sets the minimum translation values the object can occupy on each individual axis.
  1194. *
  1195. * To access this property do: TranslationMin.Get().
  1196. * To set this property do: TranslationMin.Set(FbxDouble3).
  1197. * Default value is 0.,0.,0.
  1198. *
  1199. */
  1200. FbxPropertyT<FbxDouble3> TranslationMin;
  1201. /** This property sets the maximum translation values the object can occupy on each individual axis.
  1202. *
  1203. * To access this property do: TranslationMax.Get().
  1204. * To set this property do: TranslationMax.Set(FbxDouble3).
  1205. * Default value is 0.,0.,0.
  1206. *
  1207. */
  1208. FbxPropertyT<FbxDouble3> TranslationMax;
  1209. /** This property enables or disables the limit on translation X.
  1210. * When set to \c true, the object translation is constrained by the value of \ref TranslationMin.
  1211. *
  1212. * To access this property do: TranslationMinX.Get().
  1213. * To set this property do: TranslationMinX.Set(FbxBool).
  1214. *
  1215. * Default value is false.
  1216. */
  1217. FbxPropertyT<FbxBool> TranslationMinX;
  1218. /** This property enables or disables the limit on translation Y.
  1219. * When set to \c true, the object translation is constrained by the value of \ref TranslationMin.
  1220. *
  1221. * To access this property do: TranslationMinY.Get().
  1222. * To set this property do: TranslationMinY.Set(FbxBool).
  1223. *
  1224. * Default value is false.
  1225. */
  1226. FbxPropertyT<FbxBool> TranslationMinY;
  1227. /** This property enables or disables the limit on translation Z.
  1228. * When set to \c true, the object translation is constrained by the value of \ref TranslationMin.
  1229. *
  1230. * To access this property do: TranslationMinZ.Get().
  1231. * To set this property do: TranslationMinZ.Set(FbxBool).
  1232. *
  1233. * Default value is false.
  1234. */
  1235. FbxPropertyT<FbxBool> TranslationMinZ;
  1236. /** This property enables or disables the limit on translation X.
  1237. * When set to \c true, the object translation is constrained by the value of \ref TranslationMax.
  1238. *
  1239. * To access this property do: TranslationMaxX.Get().
  1240. * To set this property do: TranslationMaxX.Set(FbxBool).
  1241. *
  1242. * Default value is false.
  1243. */
  1244. FbxPropertyT<FbxBool> TranslationMaxX;
  1245. /** This property enables or disables the limit on translation Y.
  1246. * When set to \c true, the object translation is constrained by the value of \ref TranslationMax.
  1247. *
  1248. * To access this property do: TranslationMaxY.Get().
  1249. * To set this property do: TranslationMaxY.Set(FbxBool).
  1250. *
  1251. * Default value is false.
  1252. */
  1253. FbxPropertyT<FbxBool> TranslationMaxY;
  1254. /** This property enables or disables the limit on translation Z.
  1255. * When set to \c true, the object translation is constrained by the value of \ref TranslationMax.
  1256. *
  1257. * To access this property do: TranslationMaxZ.Get().
  1258. * To set this property do: TranslationMaxZ.Set(FbxBool).
  1259. *
  1260. * Default value is false.
  1261. */
  1262. FbxPropertyT<FbxBool> TranslationMaxZ;
  1263. /** This property contains the rotation order information of the node
  1264. *
  1265. * To access this property do: RotationOrder.Get().
  1266. * To set this property do: RotationOrder.Set(EFbxRotationOrder).
  1267. * Default value is eEulerXYZ.
  1268. *
  1269. */
  1270. FbxPropertyT<EFbxRotationOrder> RotationOrder;
  1271. /** This property contains the rotation space for limit only flag of the node.
  1272. * When set to \c true, the Rotation space is applied only on the limit data (provided the \ref RotationActive is
  1273. * also \c true).
  1274. *
  1275. * To access this property do: RotationSpaceForLimitOnly.Get().
  1276. * To set this property do: RotationSpaceForLimitOnly.Set(FbxBool).
  1277. *
  1278. * Default value is false.
  1279. */
  1280. FbxPropertyT<FbxBool> RotationSpaceForLimitOnly;
  1281. /** This property contains the x value of the rotation stiffness of the node
  1282. *
  1283. * To access this property do: RotationStiffnessX.Get().
  1284. * To set this property do: RotationStiffnessX.Set(FbxDouble).
  1285. *
  1286. * Default value is 0.
  1287. */
  1288. FbxPropertyT<FbxDouble> RotationStiffnessX;
  1289. /** This property contains the y value of the rotation stiffness of the node
  1290. *
  1291. * To access this property do: RotationStiffnessY.Get().
  1292. * To set this property do: RotationStiffnessY.Set(FbxDouble).
  1293. *
  1294. * Default value is 0.
  1295. */
  1296. FbxPropertyT<FbxDouble> RotationStiffnessY;
  1297. /** This property contains the z value of the rotation stiffness of the node
  1298. *
  1299. * To access this property do: RotationStiffnessZ.Get().
  1300. * To set this property do: RotationStiffnessZ.Set(FbxDouble).
  1301. *
  1302. * Default value is 0.
  1303. */
  1304. FbxPropertyT<FbxDouble> RotationStiffnessZ;
  1305. /** This property contains axis length information of the node
  1306. *
  1307. * To access this property do: AxisLen.Get().
  1308. * To set this property do: AxisLen.Set(FbxDouble).
  1309. *
  1310. * Default value is 10.
  1311. */
  1312. FbxPropertyT<FbxDouble> AxisLen;
  1313. /** This property contains pre-rotation information of the node
  1314. *
  1315. * To access this property do: PreRotation.Get().
  1316. * To set this property do: PreRotation.Set(FbxDouble3).
  1317. *
  1318. * Default value is 0.,0.,0.
  1319. */
  1320. FbxPropertyT<FbxDouble3> PreRotation;
  1321. /** This property contains post-rotation information of the node
  1322. *
  1323. * To access this property do: PostRotation.Get().
  1324. * To set this property do: PostRotation.Set(FbxDouble3).
  1325. *
  1326. * Default value is 0.,0.,0.
  1327. */
  1328. FbxPropertyT<FbxDouble3> PostRotation;
  1329. /** This property enables or disables the limit on rotation.
  1330. * When set to \c false the object can rotate in any direction without limitations.
  1331. * Else the
  1332. * \ref RotationMinX, \ref RotationMinY, \ref RotationMinZ,
  1333. * \ref RotationMaxX, \ref RotationMaxY and \ref RotationMaxZ flags are used to
  1334. * limit the rotation on each individual axis.
  1335. * \remarks The PreRotation value is applied before the limit, while the PostRotation is applied
  1336. * after the limit.
  1337. *
  1338. * To access this property do: RotationActive.Get().
  1339. * To set this property do: RotationActive.Set(FbxBool).
  1340. *
  1341. * Default value is false.
  1342. */
  1343. FbxPropertyT<FbxBool> RotationActive;
  1344. /** This property sets the minimum rotation values the object can occupy on each individual axis.
  1345. *
  1346. * To access this property do: RotationMin.Get().
  1347. * To set this property do: RotationMin.Set(FbxDouble3).
  1348. *
  1349. * Default value is 0.,0.,0.
  1350. */
  1351. FbxPropertyT<FbxDouble3> RotationMin;
  1352. /** This property sets the maximum rotation values the object can occupy on each individual axis.
  1353. *
  1354. * To access this property do: RotationMax.Get().
  1355. * To set this property do: RotationMax.Set(FbxDouble3).
  1356. *
  1357. * Default value is 0.,0.,0.
  1358. */
  1359. FbxPropertyT<FbxDouble3> RotationMax;
  1360. /** This property enables or disables the limit on rotation X.
  1361. * When set to \c true, the object rotation is constrained by the value of \ref RotationMin.
  1362. *
  1363. * To access this property do: RotationMinX.Get().
  1364. * To set this property do: RotationMinX.Set(FbxBool).
  1365. *
  1366. * Default value is false.
  1367. */
  1368. FbxPropertyT<FbxBool> RotationMinX;
  1369. /** This property enables or disables the limit on rotation Y.
  1370. * When set to \c true, the object rotation is constrained by the value of \ref RotationMin.
  1371. *
  1372. * To access this property do: RotationMinY.Get().
  1373. * To set this property do: RotationMinY.Set(FbxBool).
  1374. *
  1375. * Default value is false.
  1376. */
  1377. FbxPropertyT<FbxBool> RotationMinY;
  1378. /** This property enables or disables the limit on rotation Z.
  1379. * When set to \c true, the object rotation is constrained by the value of \ref RotationMin.
  1380. *
  1381. * To access this property do: RotationMinZ.Get().
  1382. * To set this property do: RotationMinZ.Set(FbxBool).
  1383. *
  1384. * Default value is false.
  1385. */
  1386. FbxPropertyT<FbxBool> RotationMinZ;
  1387. /** This property enables or disables the limit on rotation X.
  1388. * When set to \c true, the object rotation is constrained by the value of \ref RotationMax.
  1389. *
  1390. * To access this property do: RotationMaxX.Get().
  1391. * To set this property do: RotationMaxX.Set(FbxBool).
  1392. *
  1393. * Default value is false.
  1394. */
  1395. FbxPropertyT<FbxBool> RotationMaxX;
  1396. /** This property enables or disables the limit on rotation Y.
  1397. * When set to \c true, the object rotation is constrained by the value of \ref RotationMax.
  1398. *
  1399. * To access this property do: RotationMaxY.Get().
  1400. * To set this property do: RotationMaxY.Set(FbxBool).
  1401. *
  1402. * Default value is false.
  1403. */
  1404. FbxPropertyT<FbxBool> RotationMaxY;
  1405. /** This property enables or disables the limit on rotation Z.
  1406. * When set to \c true, the object rotation is constrained by the value of \ref RotationMax.
  1407. *
  1408. * To access this property do: RotationMaxZ.Get().
  1409. * To set this property do: RotationMaxZ.Set(FbxBool).
  1410. *
  1411. * Default value is false.
  1412. */
  1413. FbxPropertyT<FbxBool> RotationMaxZ;
  1414. /** This property contains inherit type information of the node
  1415. *
  1416. * To access this property do: InheritType.Get().
  1417. * To set this property do: InheritType.Set(FbxTransform::EInheritType).
  1418. *
  1419. * Default value is eInheritRrSs.
  1420. */
  1421. FbxPropertyT<FbxTransform::EInheritType> InheritType;
  1422. /** This property enables or disables the limit on scaling.
  1423. * When set to \c false the object can scale in any direction without limitations.
  1424. * Else the
  1425. * \ref ScalingMinX, \ref ScalingMinY, \ref ScalingMinZ,
  1426. * \ref ScalingMaxX, \ref ScalingMaxY and \ref ScalingMaxZ flags are used to
  1427. * limit the scaling on each individual axis.
  1428. *
  1429. * To access this property do: ScalingActive.Get().
  1430. * To set this property do: ScalingActive.Set(FbxBool).
  1431. *
  1432. * Default value is false.
  1433. */
  1434. FbxPropertyT<FbxBool> ScalingActive;
  1435. /** This property sets the minimum scaling values the object can occupy on each individual axis.
  1436. *
  1437. * To access this property do: ScalingMin.Get().
  1438. * To set this property do: ScalingMin.Set(FbxDouble3).
  1439. *
  1440. * Default value is 0.,0.,0.
  1441. */
  1442. FbxPropertyT<FbxDouble3> ScalingMin;
  1443. /** This property sets the maximum scaling values the object can occupy on each individual axis.
  1444. *
  1445. * To access this property do: ScalingMax.Get().
  1446. * To set this property do: ScalingMax.Set(FbxDouble3).
  1447. *
  1448. * Default value is 1.,1.,1.
  1449. */
  1450. FbxPropertyT<FbxDouble3> ScalingMax;
  1451. /** This property activates or disables the limit on scaling X. When active, the object scaling
  1452. * is constrained by the value of \ref ScalingMin.
  1453. *
  1454. * To access this property do: ScalingMinX.Get().
  1455. * To set this property do: ScalingMinX.Set(FbxBool).
  1456. *
  1457. * Default value is false.
  1458. */
  1459. FbxPropertyT<FbxBool> ScalingMinX;
  1460. /** This property enables or disables the limit on scaling Y.
  1461. * When set to \c true, the object scaling is constrained by the value of \ref ScalingMin.
  1462. *
  1463. * To access this property do: ScalingMinY.Get().
  1464. * To set this property do: ScalingMinY.Set(FbxBool).
  1465. *
  1466. * Default value is false.
  1467. */
  1468. FbxPropertyT<FbxBool> ScalingMinY;
  1469. /** This property enables or disables the limit on scaling Z.
  1470. * When set to \c true, the object scaling is constrained by the value of \ref ScalingMin.
  1471. *
  1472. * To access this property do: ScalingMinZ.Get().
  1473. * To set this property do: ScalingMinZ.Set(FbxBool).
  1474. *
  1475. * Default value is false.
  1476. */
  1477. FbxPropertyT<FbxBool> ScalingMinZ;
  1478. /** This property enables or disables the limit on scaling X.
  1479. * When set to \c true, the object scaling is constrained by the value of \ref ScalingMax.
  1480. *
  1481. * To access this property do: ScalingMaxX.Get().
  1482. * To set this property do: ScalingMaxX.Set(FbxBool).
  1483. *
  1484. * Default value is false.
  1485. */
  1486. FbxPropertyT<FbxBool> ScalingMaxX;
  1487. /** This property enables or disables the limit on scaling Y.
  1488. * When set to \c true, the object scaling is constrained by the value of \ref ScalingMax.
  1489. *
  1490. * To access this property do: ScalingMaxY.Get().
  1491. * To set this property do: ScalingMaxY.Set(FbxBool).
  1492. *
  1493. * Default value is false.
  1494. */
  1495. FbxPropertyT<FbxBool> ScalingMaxY;
  1496. /** This property enables or disables the limit on scaling Z.
  1497. * When set to \c true, the object scaling is constrained by the value of \ref ScalingMax.
  1498. *
  1499. * To access this property do: ScalingMaxZ.Get().
  1500. * To set this property do: ScalingMaxZ.Set(FbxBool).
  1501. *
  1502. * Default value is false.
  1503. */
  1504. FbxPropertyT<FbxBool> ScalingMaxZ;
  1505. /** This property contains geometric translation information of the node
  1506. *
  1507. * To access this property do: GeometricTranslation.Get().
  1508. * To set this property do: GeometricTranslation.Set(FbxDouble3).
  1509. *
  1510. * Default value is 0.,0.,0.
  1511. */
  1512. FbxPropertyT<FbxDouble3> GeometricTranslation;
  1513. /** This property contains geometric rotation information of the node
  1514. *
  1515. * To access this property do: GeometricRotation.Get().
  1516. * To set this property do: GeometricRotation.Set(FbxDouble3).
  1517. *
  1518. * Default value is 0.,0.,0.
  1519. */
  1520. FbxPropertyT<FbxDouble3> GeometricRotation;
  1521. /** This property contains geometric scaling information of the node
  1522. *
  1523. * To access this property do: GeometricScaling.Get().
  1524. * To set this property do: GeometricScaling.Set(FbxDouble3).
  1525. *
  1526. * Default value is 1.,1.,1.
  1527. */
  1528. FbxPropertyT<FbxDouble3> GeometricScaling;
  1529. // IK Settings
  1530. //////////////////////////////////////////////////////////
  1531. /** This property contains the x component of the minimum damp range angles of the node
  1532. *
  1533. * To access this property do: MinDampRangeX.Get().
  1534. * To set this property do: MinDampRangeX.Set(FbxDouble).
  1535. *
  1536. * Default value is 0.
  1537. */
  1538. FbxPropertyT<FbxDouble> MinDampRangeX;
  1539. /** This property contains the y component of the minimum damp range angles of the node
  1540. *
  1541. * To access this property do: MinDampRangeY.Get().
  1542. * To set this property do: MinDampRangeY.Set(FbxDouble).
  1543. *
  1544. * Default value is 0.
  1545. */
  1546. FbxPropertyT<FbxDouble> MinDampRangeY;
  1547. /** This property contains the z component of the minimum damp range angles of the node
  1548. *
  1549. * To access this property do: MinDampRangeZ.Get().
  1550. * To set this property do: MinDampRangeZ.Set(FbxDouble).
  1551. *
  1552. * Default value is 0.
  1553. */
  1554. FbxPropertyT<FbxDouble> MinDampRangeZ;
  1555. /** This property contains the x component of the maximum damp range angles of the node
  1556. *
  1557. * To access this property do: MaxDampRangeX.Get().
  1558. * To set this property do: MaxDampRangeX.Set(FbxDouble).
  1559. *
  1560. * Default value is 0.
  1561. */
  1562. FbxPropertyT<FbxDouble> MaxDampRangeX;
  1563. /** This property contains the y component of the maximum damp range angles of the node
  1564. *
  1565. * To access this property do: MaxDampRangeY.Get().
  1566. * To set this property do: MaxDampRangeY.Set(FbxDouble).
  1567. *
  1568. * Default value is 0.
  1569. */
  1570. FbxPropertyT<FbxDouble> MaxDampRangeY;
  1571. /** This property contains the z component of the maximum damp range angles of the node
  1572. *
  1573. * To access this property do: MaxDampRangeZ.Get().
  1574. * To set this property do: MaxDampRangeZ.Set(FbxDouble).
  1575. *
  1576. * Default value is 0.
  1577. */
  1578. FbxPropertyT<FbxDouble> MaxDampRangeZ;
  1579. /** This property contains the x component of the minimum damp strength of the node
  1580. *
  1581. * To access this property do: MinDampStrengthX.Get().
  1582. * To set this property do: MinDampStrengthX.Set(FbxDouble).
  1583. *
  1584. * Default value is 0.
  1585. */
  1586. FbxPropertyT<FbxDouble> MinDampStrengthX;
  1587. /** This property contains the y component of the minimum damp strength of the node
  1588. *
  1589. * To access this property do: MinDampStrengthY.Get().
  1590. * To set this property do: MinDampStrengthY.Set(FbxDouble).
  1591. *
  1592. * Default value is 0.
  1593. */
  1594. FbxPropertyT<FbxDouble> MinDampStrengthY;
  1595. /** This property contains the z component of the minimum damp strength of the node
  1596. *
  1597. * To access this property do: MinDampStrengthZ.Get().
  1598. * To set this property do: MinDampStrengthZ.Set(FbxDouble).
  1599. *
  1600. * Default value is 0.
  1601. */
  1602. FbxPropertyT<FbxDouble> MinDampStrengthZ;
  1603. /** This property contains the x component of the maximum damp strength of the node
  1604. *
  1605. * To access this property do: MaxDampStrengthX.Get().
  1606. * To set this property do: MaxDampStrengthX.Set(FbxDouble).
  1607. *
  1608. * Default value is 0.
  1609. */
  1610. FbxPropertyT<FbxDouble> MaxDampStrengthX;
  1611. /** This property contains the y component of the maximum damp strength of the node
  1612. *
  1613. * To access this property do: MaxDampStrengthY.Get().
  1614. * To set this property do: MaxDampStrengthY.Set(FbxDouble).
  1615. *
  1616. * Default value is 0.
  1617. */
  1618. FbxPropertyT<FbxDouble> MaxDampStrengthY;
  1619. /** This property contains the z component of the maximum damp strength of the node
  1620. *
  1621. * To access this property do: MaxDampStrengthZ.Get().
  1622. * To set this property do: MaxDampStrengthZ.Set(FbxDouble).
  1623. *
  1624. * Default value is 0.
  1625. */
  1626. FbxPropertyT<FbxDouble> MaxDampStrengthZ;
  1627. /** This property contains the x component of the preferred angle of the node
  1628. *
  1629. * To access this property do: PreferedAngleX.Get().
  1630. * To set this property do: PreferedAngleX.Set(FbxDouble).
  1631. *
  1632. * Default value is 0.
  1633. */
  1634. FbxPropertyT<FbxDouble> PreferedAngleX;
  1635. /** This property contains the y component of the preferred angle of the node
  1636. *
  1637. * To access this property do: PreferedAngleY.Get().
  1638. * To set this property do: PreferedAngleY.Set(FbxDouble).
  1639. *
  1640. * Default value is 0.
  1641. */
  1642. FbxPropertyT<FbxDouble> PreferedAngleY;
  1643. /** This property contains the z component of the preferred angle of the node
  1644. *
  1645. * To access this property do: PreferedAngleZ.Get().
  1646. * To set this property do: PreferedAngleZ.Set(FbxDouble).
  1647. *
  1648. * Default value is 0.
  1649. */
  1650. FbxPropertyT<FbxDouble> PreferedAngleZ;
  1651. ///////////////////////////////////////////////////////
  1652. /** This property contains lookat property of the node
  1653. *
  1654. * To access this property do: LookAtProperty.Get().
  1655. * To set this property do: LookAtProperty.Set(FbxReference).
  1656. *
  1657. */
  1658. FbxPropertyT<FbxReference> LookAtProperty;
  1659. /** This property contains the up vector property of the node
  1660. *
  1661. * To access this property do: UpVectorProperty.Get().
  1662. * To set this property do: UpVectorProperty.Set(FbxReference).
  1663. *
  1664. */
  1665. FbxPropertyT<FbxReference> UpVectorProperty;
  1666. /** This property contains the show information of the node.
  1667. * As opposed to the Visibility property, this one cannot be animated. The assumed behavior of
  1668. * this property is to represent the show/hide state of all the nodes attributes connected to this
  1669. * node only.
  1670. *
  1671. * To access this property do: Show.Get().
  1672. * To set this property do: Show.Set(FbxBool).
  1673. *
  1674. * Default value is true.
  1675. *
  1676. * \remarks \li Because node attributes can be shared by multiple nodes (instances), the FBX SDK provides an utility
  1677. * function FbxScene::SyncShowPropertyForInstance() to propagates the same Show value across all the nodes
  1678. * referencing the node attribute. The applied logic is that as soon as one of these nodes has the Show
  1679. * property set to \c false, all will be set to \c false (basically it is an AND operation on all the
  1680. * Show flags).
  1681. *
  1682. * \li Depending on the support of the Show and Visibility properties that applications will implement, there
  1683. * may be conflicts with these two states. In this case, it is suggested that the Visibility property
  1684. * always overrides the Show.
  1685. *
  1686. * \see Visibility property.
  1687. */
  1688. FbxPropertyT<FbxBool> Show;
  1689. /** This property contains negative percent shape support information of the node
  1690. *
  1691. * To access this property do: NegativePercentShapeSupport.Get().
  1692. * To set this property do: NegativePercentShapeSupport.Set(FbxBool).
  1693. *
  1694. * Default value is true.
  1695. */
  1696. FbxPropertyT<FbxBool> NegativePercentShapeSupport;
  1697. /** This property contains default attribute index information of the node
  1698. *
  1699. * To access this property do: DefaultAttributeIndex.Get().
  1700. * To set this property do: DefaultAttributeIndex.Set(FbxInt).
  1701. *
  1702. * Default value is -1.
  1703. */
  1704. FbxPropertyT<FbxInt> DefaultAttributeIndex;
  1705. /** This property contains manipulation state information of the node
  1706. *
  1707. * To access this property do: Freeze.Get().
  1708. * To set this property do: Freeze.Set(FbxBool).
  1709. *
  1710. * Default value is false.
  1711. */
  1712. FbxPropertyT<FbxBool> Freeze;
  1713. /** This property contains level of detail mode information of the node
  1714. *
  1715. * To access this property do: LODBox.Get().
  1716. * To set this property do: LODBox.Set(FbxBool).
  1717. *
  1718. * True: Bounding box
  1719. * False: Geometry object is displayed.
  1720. * Default value is false.
  1721. */
  1722. FbxPropertyT<FbxBool> LODBox;
  1723. //@}
  1724. /*****************************************************************************************************************************
  1725. ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
  1726. *****************************************************************************************************************************/
  1727. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  1728. class FBXSDK_DLL Pivot
  1729. {
  1730. public:
  1731. static const FbxVector4 sZeroVector;
  1732. static const FbxVector4 sOneVector;
  1733. Pivot()
  1734. {
  1735. mRotationOffset = NULL;
  1736. mRotationPivot = NULL;
  1737. mPreRotation = NULL;
  1738. mPostRotation = NULL;
  1739. mScalingOffset = NULL;
  1740. mScalingPivot = NULL;
  1741. mGeometricTranslation = NULL;
  1742. mGeometricRotation = NULL;
  1743. mGeometricScaling = NULL;
  1744. Reset();
  1745. }
  1746. ~Pivot() { Reset(); }
  1747. void Reset()
  1748. {
  1749. FBX_SAFE_DELETE(mRotationOffset);
  1750. FBX_SAFE_DELETE(mRotationPivot);
  1751. FBX_SAFE_DELETE(mPreRotation);
  1752. FBX_SAFE_DELETE(mPostRotation);
  1753. FBX_SAFE_DELETE(mScalingOffset);
  1754. FBX_SAFE_DELETE(mScalingPivot);
  1755. FBX_SAFE_DELETE(mGeometricTranslation);
  1756. FBX_SAFE_DELETE(mGeometricRotation);
  1757. FBX_SAFE_DELETE(mGeometricScaling);
  1758. mRotationOrder = eEulerXYZ;
  1759. mRotationSpaceForLimitOnly = false;
  1760. mPivotState = FbxNode::ePivotReference;
  1761. mQuaternionInterpolate = eQuatInterpOff;
  1762. }
  1763. inline const FbxVector4& GetRotationOffset() const { return (mRotationOffset) ? *mRotationOffset : sZeroVector; }
  1764. inline void SetRotationOffset(const FbxVector4& pV)
  1765. {
  1766. if( !mRotationOffset )
  1767. {
  1768. #if defined(__GNUC__) && (__GNUC__ < 4)
  1769. mRotationOffset = FbxNew< FbxVector4 >((FbxVector4&)pV);
  1770. #else
  1771. mRotationOffset = FbxNew< FbxVector4 >(pV);
  1772. #endif
  1773. }
  1774. else
  1775. {
  1776. *mRotationOffset = pV;
  1777. }
  1778. }
  1779. inline const FbxVector4& GetRotationPivot() const { return (mRotationPivot) ? *mRotationPivot : sZeroVector; }
  1780. inline void SetRotationPivot(const FbxVector4& pV)
  1781. {
  1782. if( !mRotationPivot )
  1783. {
  1784. #if defined(__GNUC__) && (__GNUC__ < 4)
  1785. mRotationPivot = FbxNew< FbxVector4 >((FbxVector4&)pV);
  1786. #else
  1787. mRotationPivot = FbxNew< FbxVector4 >(pV);
  1788. #endif
  1789. }
  1790. else
  1791. {
  1792. *mRotationPivot = pV;
  1793. }
  1794. }
  1795. inline const FbxVector4& GetPreRotation() const { return (mPreRotation) ? *mPreRotation : sZeroVector; }
  1796. inline void SetPreRotation(const FbxVector4& pV)
  1797. {
  1798. if( !mPreRotation )
  1799. {
  1800. #if defined(__GNUC__) && (__GNUC__ < 4)
  1801. mPreRotation = FbxNew< FbxVector4 >((FbxVector4&)pV);
  1802. #else
  1803. mPreRotation = FbxNew< FbxVector4 >(pV);
  1804. #endif
  1805. }
  1806. else
  1807. {
  1808. *mPreRotation = pV;
  1809. }
  1810. }
  1811. inline const FbxVector4& GetPostRotation() const { return (mPostRotation) ? *mPostRotation : sZeroVector; }
  1812. inline void SetPostRotation(const FbxVector4& pV)
  1813. {
  1814. if( !mPostRotation )
  1815. {
  1816. #if defined(__GNUC__) && (__GNUC__ < 4)
  1817. mPostRotation = FbxNew< FbxVector4 >((FbxVector4&)pV);
  1818. #else
  1819. mPostRotation = FbxNew< FbxVector4 >(pV);
  1820. #endif
  1821. }
  1822. else
  1823. {
  1824. *mPostRotation = pV;
  1825. }
  1826. }
  1827. inline const FbxVector4& GetScalingOffset() const { return (mScalingOffset) ? *mScalingOffset : sZeroVector; }
  1828. inline void SetScalingOffset(const FbxVector4& pV)
  1829. {
  1830. if( !mScalingOffset )
  1831. {
  1832. #if defined(__GNUC__) && (__GNUC__ < 4)
  1833. mScalingOffset = FbxNew< FbxVector4 >((FbxVector4&)pV);
  1834. #else
  1835. mScalingOffset = FbxNew< FbxVector4 >(pV);
  1836. #endif
  1837. }
  1838. else
  1839. {
  1840. *mScalingOffset = pV;
  1841. }
  1842. }
  1843. inline const FbxVector4& GetScalingPivot() const { return (mScalingPivot) ? *mScalingPivot : sZeroVector; }
  1844. inline void SetScalingPivot(const FbxVector4& pV)
  1845. {
  1846. if( !mScalingPivot )
  1847. {
  1848. #if defined(__GNUC__) && (__GNUC__ < 4)
  1849. mScalingPivot = FbxNew< FbxVector4 >((FbxVector4&)pV);
  1850. #else
  1851. mScalingPivot = FbxNew< FbxVector4 >(pV);
  1852. #endif
  1853. }
  1854. else
  1855. {
  1856. *mScalingPivot = pV;
  1857. }
  1858. }
  1859. inline const FbxVector4& GetGeometricTranslation() const { return (mGeometricTranslation) ? *mGeometricTranslation : sZeroVector; }
  1860. inline void SetGeometricTranslation(const FbxVector4& pV)
  1861. {
  1862. if( !mGeometricTranslation )
  1863. {
  1864. #if defined(__GNUC__) && (__GNUC__ < 4)
  1865. mGeometricTranslation = FbxNew< FbxVector4 >((FbxVector4&)pV);
  1866. #else
  1867. mGeometricTranslation = FbxNew< FbxVector4 >(pV);
  1868. #endif
  1869. }
  1870. else
  1871. {
  1872. *mGeometricTranslation = pV;
  1873. }
  1874. }
  1875. inline const FbxVector4& GetGeometricRotation() const { return (mGeometricRotation) ? *mGeometricRotation : sZeroVector; }
  1876. inline void SetGeometricRotation(const FbxVector4& pV)
  1877. {
  1878. if( !mGeometricRotation )
  1879. {
  1880. #if defined(__GNUC__) && (__GNUC__ < 4)
  1881. mGeometricRotation = FbxNew< FbxVector4 >((FbxVector4&)pV);
  1882. #else
  1883. mGeometricRotation = FbxNew< FbxVector4 >(pV);
  1884. #endif
  1885. }
  1886. else
  1887. {
  1888. *mGeometricRotation = pV;
  1889. }
  1890. }
  1891. inline const FbxVector4& GetGeometricScaling() const { return (mGeometricScaling) ? *mGeometricScaling : sOneVector; }
  1892. inline void SetGeometricScaling(const FbxVector4& pV)
  1893. {
  1894. if( !mGeometricScaling )
  1895. {
  1896. #if defined(__GNUC__) && (__GNUC__ < 4)
  1897. mGeometricScaling = FbxNew< FbxVector4 >((FbxVector4&)pV);
  1898. #else
  1899. mGeometricScaling = FbxNew< FbxVector4 >(pV);
  1900. #endif
  1901. }
  1902. else
  1903. {
  1904. *mGeometricScaling = pV;
  1905. }
  1906. }
  1907. inline EFbxRotationOrder GetRotationOrder() const { return mRotationOrder; }
  1908. inline void SetRotationOrder(EFbxRotationOrder pROrder) { mRotationOrder = pROrder; }
  1909. inline bool GetRotationSpaceForLimitOnly() const { return mRotationSpaceForLimitOnly; }
  1910. inline void SetRotationSpaceForLimitOnly(bool pVal) { mRotationSpaceForLimitOnly = pVal; }
  1911. inline EFbxQuatInterpMode GetQuaternionInterpolate() const { return mQuaternionInterpolate; }
  1912. inline void SetQuaternionInterpolate(EFbxQuatInterpMode pVal) { mQuaternionInterpolate = pVal; }
  1913. inline FbxNode::EPivotState GetPivotState() const { return mPivotState; }
  1914. inline void SetPivotState(FbxNode::EPivotState pVal) { mPivotState = pVal; }
  1915. private:
  1916. FbxVector4* mRotationOffset;
  1917. FbxVector4* mRotationPivot;
  1918. FbxVector4* mPreRotation;
  1919. FbxVector4* mPostRotation;
  1920. FbxVector4* mScalingOffset;
  1921. FbxVector4* mScalingPivot;
  1922. FbxVector4* mGeometricTranslation;
  1923. FbxVector4* mGeometricRotation;
  1924. FbxVector4* mGeometricScaling;
  1925. EFbxRotationOrder mRotationOrder;
  1926. bool mRotationSpaceForLimitOnly;
  1927. EFbxQuatInterpMode mQuaternionInterpolate;
  1928. FbxNode::EPivotState mPivotState;
  1929. };
  1930. class FBXSDK_DLL Pivots
  1931. {
  1932. public:
  1933. Pivots()
  1934. {
  1935. for( int i = 0; i < 2; i++ )
  1936. {
  1937. mIsDefault[i] = true;
  1938. mPivotState[i] = FbxNode::ePivotReference;
  1939. mPivot[i] = NULL;
  1940. }
  1941. }
  1942. ~Pivots()
  1943. {
  1944. FbxDelete(mPivot[0]);
  1945. FbxDelete(mPivot[1]);
  1946. }
  1947. Pivot& Get(int id)
  1948. {
  1949. FBX_ASSERT(id == 0 || id == 1);
  1950. if (mPivot[id] == NULL && mIsDefault[id])
  1951. {
  1952. smDefaultPivot.SetPivotState(mPivotState[id]);
  1953. return smDefaultPivot;
  1954. }
  1955. if (!mPivot[id])
  1956. mPivot[id] = FbxNew< Pivot >();
  1957. FBX_ASSERT(mPivot[id] != NULL);
  1958. if (mPivot[id])
  1959. mPivot[id]->SetPivotState(mPivotState[id]);
  1960. return *mPivot[id];
  1961. }
  1962. #define MACRO_PIVOT_VECTOR_FCTS(name, defVect) \
  1963. inline const FbxVector4& Get##name(int id) const \
  1964. {\
  1965. FBX_ASSERT(id == 0 || id == 1); \
  1966. Pivot* p = mPivot[id]; \
  1967. if (p == NULL) p = &smDefaultPivot; \
  1968. return p->Get##name(); \
  1969. }\
  1970. inline void Set##name(int id, const FbxVector4& pV) \
  1971. {\
  1972. FBX_ASSERT(id == 0 || id == 1); \
  1973. if (mIsDefault[id] && pV[0] == defVect[0] && pV[1] == defVect[1] && pV[2] == defVect[2]) return; \
  1974. mIsDefault[id] = false; \
  1975. Get(id).Set##name(pV); \
  1976. }
  1977. MACRO_PIVOT_VECTOR_FCTS(RotationOffset, Pivot::sZeroVector);
  1978. MACRO_PIVOT_VECTOR_FCTS(RotationPivot, Pivot::sZeroVector);
  1979. MACRO_PIVOT_VECTOR_FCTS(PreRotation, Pivot::sZeroVector);
  1980. MACRO_PIVOT_VECTOR_FCTS(PostRotation, Pivot::sZeroVector);
  1981. MACRO_PIVOT_VECTOR_FCTS(ScalingOffset, Pivot::sZeroVector);
  1982. MACRO_PIVOT_VECTOR_FCTS(ScalingPivot, Pivot::sZeroVector);
  1983. MACRO_PIVOT_VECTOR_FCTS(GeometricTranslation, Pivot::sZeroVector);
  1984. MACRO_PIVOT_VECTOR_FCTS(GeometricRotation, Pivot::sZeroVector);
  1985. MACRO_PIVOT_VECTOR_FCTS(GeometricScaling, Pivot::sOneVector);
  1986. #define MACRO_PIVOT_BOOL_FCTS(name) \
  1987. inline bool Get##name(int id) const \
  1988. {\
  1989. FBX_ASSERT(id == 0 || id == 1); \
  1990. Pivot* p = mPivot[id]; \
  1991. if (p == NULL) p = &smDefaultPivot; \
  1992. return p->Get##name(); \
  1993. }\
  1994. inline void Set##name(int id, bool pV) \
  1995. {\
  1996. FBX_ASSERT(id == 0 || id == 1); \
  1997. mIsDefault[id] = false; \
  1998. Get(id).Set##name(pV); \
  1999. }
  2000. MACRO_PIVOT_BOOL_FCTS(RotationSpaceForLimitOnly);
  2001. inline EFbxQuatInterpMode GetQuaternionInterpolate(int id) const
  2002. {
  2003. FBX_ASSERT(id == 0 || id == 1);
  2004. Pivot* p = mPivot[id];
  2005. if (p == NULL) p = &smDefaultPivot;
  2006. return p->GetQuaternionInterpolate();
  2007. }
  2008. inline void SetQuaternionInterpolate(int id, EFbxQuatInterpMode pV)
  2009. {
  2010. FBX_ASSERT(id == 0 || id == 1);
  2011. // If pivot has default values, and we want to set default eQuatInterpOff,
  2012. // return to avoid allocating memory for the pivot (in Get(id).)
  2013. if (mIsDefault[id] && pV == eQuatInterpOff) return;
  2014. mIsDefault[id] = false;
  2015. Get(id).SetQuaternionInterpolate(pV);
  2016. }
  2017. inline EFbxRotationOrder GetRotationOrder(int id) const
  2018. {
  2019. FBX_ASSERT(id == 0 || id == 1);
  2020. Pivot* p = mPivot[id];
  2021. if (p == NULL) p = &smDefaultPivot;
  2022. return p->GetRotationOrder();
  2023. }
  2024. inline void SetRotationOrder(int id, EFbxRotationOrder pROrder)
  2025. {
  2026. FBX_ASSERT(id == 0 || id == 1);
  2027. // If pivot has default values, and we want to set default rotation order eEulerXYZ,
  2028. // return to avoid allocating memory for the pivot (in Get(id).)
  2029. if (mIsDefault[id] && pROrder == eEulerXYZ) return;
  2030. mIsDefault[id] = false;
  2031. Get(id).SetRotationOrder(pROrder);
  2032. }
  2033. inline FbxNode::EPivotState GetPivotState(int id) const
  2034. {
  2035. FBX_ASSERT(id == 0 || id == 1);
  2036. return mPivotState[id];
  2037. }
  2038. inline void SetPivotState(int id, FbxNode::EPivotState pVal)
  2039. {
  2040. FBX_ASSERT(id == 0 || id == 1);
  2041. if (pVal == FbxNode::ePivotReference) return;
  2042. mPivotState[id] = pVal;
  2043. if (mPivot[id])
  2044. mPivot[id]->SetPivotState(pVal);
  2045. }
  2046. #undef MACRO_PIVOT_VECTOR_FCTS
  2047. #undef MACRO_PIVOT_BOOL_FCTS
  2048. void Reset()
  2049. {
  2050. smDefaultPivot.Reset();
  2051. for (int i = 0; i < 2; i++)
  2052. {
  2053. mIsDefault[i] = true;
  2054. mPivotState[i] = FbxNode::ePivotReference;
  2055. if (mPivot[i]) mPivot[i]->Reset();
  2056. }
  2057. }
  2058. private:
  2059. Pivot* mPivot[2];
  2060. FbxNode::EPivotState mPivotState[2];
  2061. bool mIsDefault[2];
  2062. static Pivot smDefaultPivot;
  2063. };
  2064. class FBXSDK_DLL LinkToCharacter
  2065. {
  2066. public:
  2067. bool operator==(LinkToCharacter& pLinkToCharacter)
  2068. {
  2069. if (mCharacter == pLinkToCharacter.mCharacter &&
  2070. mType == pLinkToCharacter.mType &&
  2071. mIndex == pLinkToCharacter.mIndex &&
  2072. mSubIndex == pLinkToCharacter.mSubIndex)
  2073. {
  2074. return true;
  2075. }
  2076. else return false;
  2077. }
  2078. FbxCharacter* mCharacter;
  2079. int mType;
  2080. int mIndex;
  2081. int mSubIndex;
  2082. };
  2083. void AddChildName(char* pChildName);
  2084. char* GetChildName(FbxUInt pIndex) const;
  2085. FbxUInt GetChildNameCount() const;
  2086. FbxTransform& GetTransform();
  2087. FbxLimits& GetTranslationLimits();
  2088. FbxLimits& GetRotationLimits();
  2089. FbxLimits& GetScalingLimits();
  2090. Pivots& GetPivots();
  2091. void UpdatePivotsAndLimitsFromProperties();
  2092. void UpdatePropertiesFromPivotsAndLimits();
  2093. void SetRotationActiveProperty(bool pVal);
  2094. void PivotSetToMBTransform(EPivotSet pPivotSet);
  2095. int AddCharacterLink(FbxCharacter* pCharacter, int pCharacterLinkType, int pNodeId, int pNodeSubId);
  2096. int RemoveCharacterLink(FbxCharacter* pCharacter, int pCharacterLinkType, int pNodeId, int pNodeSubId);
  2097. // Duplicate this node as well as all its node attributes and the Target and UpTarget objects.
  2098. FbxNode* DeepCloneWithNodeAttributes();
  2099. virtual FbxObject& Copy(const FbxObject& pObject);
  2100. virtual const char* GetTypeName() const;
  2101. virtual FbxStringList GetTypeFlags() const;
  2102. virtual bool PropertyNotify(EPropertyNotifyType pType, FbxProperty& pProperty);
  2103. enum ECullingType
  2104. {
  2105. eCullingOff,
  2106. eCullingOnCCW,
  2107. eCullingOnCW
  2108. };
  2109. ECullingType mCullingType;
  2110. bool mCorrectInheritType;
  2111. protected:
  2112. virtual void Construct(const FbxObject* pFrom);
  2113. virtual void ConstructProperties(bool pForceSet);
  2114. virtual void Destruct(bool pRecursive);
  2115. void Reset();
  2116. bool GetAnimationIntervalRecursive(FbxTimeSpan& pTimeInterval, FbxAnimLayer* pAnimLayer);
  2117. private:
  2118. typedef FbxSet<FbxHandle> GeomInstSet;
  2119. void ResetLimitsRecursive(FbxNode* pNode);
  2120. void ConvertPivotAnimationRecurseLoop(FbxAnimStack* pAnimStack, const EPivotSet pConversionTarget, const double pFrameRate, const bool pKeyReduce, GeomInstSet& pGeomInstSet);
  2121. void ConvertPivotAnimation(FbxAnimStack* pAnimStack, const EPivotSet pConversionTarget, const double pFrameRate, const bool pKeyReduce, GeomInstSet& pGeomInstSet);
  2122. bool ConvertPivotAnimation_SetupMatrixConverter(FbxAnimCurveFilterMatrixConverter& pConverter, const EPivotSet& pSrcSet, const EPivotSet& pDstSet, const double pFrameRate, const bool pKeyReduce, GeomInstSet& pGeomInstSet);
  2123. void ConvertPivotAnimation_ApplyGeometryPivot(const EPivotSet& pSrcSet, const EPivotSet& pDstSet, GeomInstSet& pGeomInstSet);
  2124. FbxTransform mTransform;
  2125. Pivots mPivots;
  2126. FbxObject* mAnimCurveNodeContainer;
  2127. FbxArray<FbxString*> mChildrenNameList;
  2128. FbxVector4 mPostTargetRotation;
  2129. FbxVector4 mTargetUpVector;
  2130. FbxNode::EShadingMode mShadingMode;
  2131. FbxArray<LinkToCharacter> mLinkToCharacter;
  2132. #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
  2133. };
  2134. inline EFbxType FbxTypeOf(const EFbxRotationOrder&){ return eFbxEnum; }
  2135. inline EFbxType FbxTypeOf(const FbxTransform::EInheritType&){ return eFbxEnum; }
  2136. inline EFbxType FbxTypeOf(const EFbxQuatInterpMode&){ return eFbxEnum; }
  2137. #include <fbxsdk/fbxsdk_nsend.h>
  2138. #endif /* _FBXSDK_SCENE_GEOMETRY_NODE_H_ */