FBX C++ API Reference
fbxscene.h
Go to the documentation of this file.
1 /****************************************************************************************
2 
3  Copyright (C) 2015 Autodesk, Inc.
4  All rights reserved.
5 
6  Use of this software is subject to the terms of the Autodesk license agreement
7  provided at the time of installation or download, or which otherwise accompanies
8  this software in either electronic or hard copy form.
9 
10 ****************************************************************************************/
11 
13 #ifndef _FBXSDK_SCENE_H_
14 #define _FBXSDK_SCENE_H_
15 
16 #include <fbxsdk/fbxsdk_def.h>
17 
26 
27 #include <fbxsdk/fbxsdk_nsbegin.h>
28 
29 class FbxGeometry;
30 class FbxTexture;
31 class FbxSurfaceMaterial;
32 class FbxCharacter;
33 class FbxControlSetPlug;
34 class FbxGenericNode;
35 class FbxPose;
36 class FbxCharacterPose;
37 class FbxVideo;
40 
62 {
64 
65 public:
67 
68  void Clear();
70 
74  FbxNode* GetRootNode() const;
76 
78 
79 
81  void FillTextureArray(FbxArray<FbxTexture*>& pTextureArray);
82 
85  void FillMaterialArray(FbxArray<FbxSurfaceMaterial*>& pMaterialArray);
87 
89 
90 
92  int GetGenericNodeCount() const;
93 
98  FbxGenericNode* GetGenericNode(int pIndex);
99 
104  FbxGenericNode* GetGenericNode(char* pName);
105 
109  bool AddGenericNode(FbxGenericNode* pGenericNode);
110 
115  bool RemoveGenericNode(FbxGenericNode* pGenericNode);
117 
118 
120 
121 
123  int GetCharacterCount() const;
124 
128  FbxCharacter* GetCharacter(int pIndex);
129 
133  int CreateCharacter(const char* pName);
134 
137  void DestroyCharacter(int pIndex);
139 
141 
142 
144  int GetControlSetPlugCount() const;
145 
149  FbxControlSetPlug* GetControlSetPlug(int pIndex);
150 
154  int CreateControlSetPlug(char* pName);
155 
158  void DestroyControlSetPlug(int pIndex);
160 
162 
163 
166  int GetCharacterPoseCount() const;
167 
171  FbxCharacterPose* GetCharacterPose(int pIndex);
172 
176  int CreateCharacterPose(char* pName);
177 
180  void DestroyCharacterPose(int pIndex);
182 
184 
185 
188  int GetPoseCount() const;
189 
193  FbxPose* GetPose(int pIndex);
194 
198  bool AddPose(FbxPose* pPose);
199 
203  bool RemovePose(FbxPose* pPose);
204 
208  bool RemovePose(int pIndex);
210 
212 
213 
216 
219  void SetSceneInfo(FbxDocumentInfo* pSceneInfo) { SetDocumentInfo(pSceneInfo); }
221 
223 
224 
226  FbxGlobalSettings& GetGlobalSettings();
227 
230  const FbxGlobalSettings& GetGlobalSettings() const;
232 
250  void SetCurrentAnimationStack(FbxAnimStack* pAnimStack);
251 
254  FbxAnimStack* GetCurrentAnimationStack();
255 
258  void SetAnimationEvaluator(FbxAnimEvaluator* pEvaluator);
259 
263  FbxAnimEvaluator* GetAnimationEvaluator();
265 
268  void FillPoseArray(FbxArray<FbxPose*>& pPoseArray);
269 
271 
272 
274  int GetMaterialCount() const;
275 
280  FbxSurfaceMaterial* GetMaterial(int pIndex);
281 
285  FbxSurfaceMaterial* GetMaterial(char* pName);
286 
290  bool AddMaterial(FbxSurfaceMaterial* pMaterial);
291 
295  bool RemoveMaterial(FbxSurfaceMaterial* pMaterial);
297 
299 
300 
308  int GetTextureCount() const;
309 
319  FbxTexture* GetTexture(int pIndex);
320 
324  FbxTexture* GetTexture(char* pName);
325 
329  bool AddTexture(FbxTexture* pTexture);
330 
334  bool RemoveTexture(FbxTexture* pTexture);
336 
338 
339 
341  int GetNodeCount() const;
342 
347  FbxNode* GetNode(int pIndex);
348 
352  bool AddNode(FbxNode* pNode);
353 
357  bool RemoveNode(FbxNode* pNode);
358 
362  int GetCurveOnSurfaceCount();
363 
367  FbxNode* FindNodeByName(const FbxString& pName);
369 
371 
372 
374  int GetGeometryCount() const;
375 
380  FbxGeometry* GetGeometry(int pIndex);
381 
385  bool AddGeometry(FbxGeometry* pGeometry);
386 
390  bool RemoveGeometry(FbxGeometry* pGeometry);
392 
394 
395 
397  int GetVideoCount() const;
398 
403  FbxVideo* GetVideo(int pIndex);
404 
408  bool AddVideo(FbxVideo* pVideo);
409 
413  bool RemoveVideo(FbxVideo* pVideo);
415 
423  void SyncShowPropertyForInstance();
424 
433  bool ComputeBoundingBoxMinMaxCenter(FbxVector4& pBBoxMin, FbxVector4& pBBoxMax, FbxVector4& pBBoxCenter, bool pSelected=false, const FbxTime& pTime=FBXSDK_TIME_INFINITE);
435 
436 /*****************************************************************************************************************************
437 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
438 *****************************************************************************************************************************/
439 #ifndef DOXYGEN_SHOULD_SKIP_THIS
440  void ConvertNurbsSurfaceToNurbs();
441  void ConvertMeshNormals();
442  void ConvertNurbsCurvesToNulls();
443  void ConnectTextures();
444  void BuildTextureLayersDirectArray();
445  void FixInheritType(FbxNode *pNode);
446 
447  void UpdateScaleCompensate(FbxNode *pNode, FbxIOSettings& pIOS);
448 
449  FbxClassId ConvertAttributeTypeToClassID(FbxNodeAttribute::EType pAttributeType);
450 
451  // These data structures are only used for legacy FBX files (version 6.x and earlier). The
452  // validity of their content is not guaranteed with the most recent versions.
453  FbxGlobalLightSettings& GlobalLightSettings() { return *mGlobalLightSettings; }
454  FbxGlobalCameraSettings& GlobalCameraSettings() { return *mGlobalCameraSettings; }
455 
456  // Clone this scene object (and everything else it contains if clone type is eDeepClone)
457  virtual FbxObject* Clone(FbxObject::ECloneType pCloneType=eDeepClone, FbxObject* pContainer=NULL, void* pSet = NULL) const;
458  virtual FbxObject& Copy(const FbxObject& pObject);
459 
460  void ConnectMaterials();
461 
462  void BuildMaterialLayersDirectArray();
463  void ReindexMaterialConnections(); // called to make sure that eIndex is remapped to eIndexToDirect
464 
465  FbxMultiMap* AddTakeTimeWarpSet(char *pTakeName);
466  FbxMultiMap* GetTakeTimeWarpSet(char *pTakeName);
467 
468  // This function will destroy the scene (and all the objects directly connected to it) without sending
469  // the Connect notifications nor trying to disconnect the objects first. This is a bypass of the intended
470  // workflow and should be used with care.
471  void ForceKill();
472 
473 private:
474  virtual void Construct(const FbxObject* pFrom);
475  virtual void Destruct(bool pRecursive);
476 
477  void ConnectTextureLayerElement(FbxLayerContainer* pLayerContainer, FbxLayerElement::EType pLayerType, FbxNode* pParentNode);
478  void BuildTextureLayersDirectArrayForLayerType(FbxLayerContainer* pLayerContainer, FbxLayerElement::EType pLayerType);
479 
480  FbxNode* mRootNode;
481  FbxGlobalLightSettings* mGlobalLightSettings;
482  FbxGlobalCameraSettings* mGlobalCameraSettings;
483  FbxAnimEvaluator* mAnimationEvaluator;
484  FbxAnimStack* mCurrentAnimationStack;
485  FbxCharPtrSet mTakeTimeWarpSet;
486 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
487 };
488 
489 #include <fbxsdk/fbxsdk_nsend.h>
490 
491 #endif /* _FBXSDK_SCENE_H_ */
#define FBXSDK_OBJECT_DECLARE(Class, Parent)
Macro used to declare a new class derived from FbxObject.
Definition: fbxobject.h:61
FBX SDK environment definition.
The Animation stack is a collection of animation layers.
Definition: fbxanimstack.h:37
FBX SDK video class.
Definition: fbxvideo.h:25
#define NULL
Definition: fbxarch.h:210
virtual FbxObject & Copy(const FbxObject &pObject)
Copy an object content into this object.
ECloneType
Types of clones that can be created for FbxObject.
Definition: fbxobject.h:239
This class contains material settings.
Utility class to manipulate strings.
Definition: fbxstring.h:66
FbxDocument is a base class for FbxScene and FbxLibrary classes.
Definition: fbxdocument.h:46
Contains a collection of FbxLayer objects.
FbxDocumentInfo * GetSceneInfo()
Get the scene information.
Definition: fbxscene.h:215
FbxDocumentInfo * GetDocumentInfo() const
Get the document information.
This class contains functions for accessing global light settings.
This class is the base class for textures, ie classes FbxFileTexture, FbxLayeredTexture and FbxProced...
Definition: fbxtexture.h:26
EType
Node attribute types.
FbxIOSettings is a collection of properties, arranged as a tree, that can be used by FBX file readers...
Plug class for control set.
This class contains scene thumbnails and user-defined summary data.
This class contains functions for accessing global settings.
Empty node containing properties.
#define FBXSDK_TIME_INFINITE
Definition: fbxtime.h:23
A character pose is a character and an associated hierarchy of nodes.
Class to encapsulate time units.
Definition: fbxtime.h:44
The base class of most FBX objects.
Definition: fbxobject.h:157
Represents an element in the scene graph.
Definition: fbxnode.h:72
This class contains the description of a 3D scene.
Definition: fbxscene.h:61
This class contains the description of a Pose and provide some methods to access Pose info in one FBX...
Definition: fbxpose.h:96
This class contains the data structure support for char pointer set.
Definition: fbxcharptrset.h:22
virtual void Construct(const FbxObject *pFrom)
Optional constructor override, automatically called by default constructor.
void SetSceneInfo(FbxDocumentInfo *pSceneInfo)
Set the scene information.
Definition: fbxscene.h:219
The principal interface for animation evaluators.
Internal class used to differentiate objects during run-time.
Definition: fbxclassid.h:39
EType
Layer Element type identifier.
Definition: fbxlayer.h:75
A four double mathematic vector class.
Definition: fbxvector4.h:25
virtual FbxObject * Clone(FbxObject::ECloneType pCloneType=eDeepClone, FbxObject *pContainer=((void *) 0), void *pSet=((void *) 0)) const
Creates a clone of this object.
#define FBXSDK_DLL
Definition: fbxarch.h:173
A Character is a person or animal with pre-defined skeleton system.
Definition: fbxcharacter.h:91
The base class of geometric objects that support control point deformations (e.g. ...
Definition: fbxgeometry.h:45
virtual void Destruct(bool pRecursive)
Optional destructor override, automatically called by default destructor.
Class to manipulate a map that can contain multiple times the same key.
Definition: fbxmultimap.h:22
This class contains the global camera settings.
virtual void Clear()
Remove document members and restore default settings.
void SetDocumentInfo(FbxDocumentInfo *pSceneInfo)
Set the document information.
Class for array of basic elements such as pointers and basic types.
Definition: fbxarray.h:23