fbxsdk/utils/fbxmaterialconverter.h Source File

fbxmaterialconverter.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_UTILS_MATERIAL_CONVERTER_H_
14 #define _FBXSDK_UTILS_MATERIAL_CONVERTER_H_
15 
16 #include <fbxsdk/fbxsdk_def.h>
17 
19 
20 #include <fbxsdk/fbxsdk_nsbegin.h>
21 
22 class LayerConfig;
23 class FbxMaterialConverter_Impl;
24 
32 {
33 public:
34  FbxMaterialConverter( FbxManager& mManager, FbxSurfaceMaterial* pDefaultMaterial = NULL);
36 
43  bool ConnectTexturesToMaterials( FbxScene& pScene );
44 
51  bool ConnectTexturesToMaterials( FbxNode* pNode );
52 
60  bool AssignTexturesToLayerElements( FbxScene& pScene );
61 
62 /*****************************************************************************************************************************
63 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
64 *****************************************************************************************************************************/
65 #ifndef DOXYGEN_SHOULD_SKIP_THIS
66 private:
68 
69  FbxMaterialConverter& operator=(const FbxMaterialConverter&);
70 
71  FbxManager& mManager;
72  FbxSurfaceMaterial* mDefaultMaterial;
73  FbxMaterialConverter_Impl* mImpl;
74 
75 
76  void GetTextures( int pComponent, FbxLayer* pLayer, LayerConfig& pLayerConfig ) const;
77  FbxSurfaceMaterial* GetMaterial( int pComponent, FbxLayer* pLayer, FbxNode* pNode, bool pLookOnNode );
78  int GetMaterialOrder( int pComponent, FbxLayer* pLayer, FbxNode* pNode, bool pLookOnNode );
79 
80  bool HasGoodMappingModes( FbxNode* pNode, FbxGeometry* pGeom ) const;
81  void ConnectTextures( FbxSurfaceMaterial* pMat, FbxObject* pTexture, int pTextureType ) const;
82  bool HasPerFaceMaterialMapping( FbxGeometry* pGeom ) const;
83  void SetTextureUVSets( FbxGeometry* pGeom ) const;
84  bool HasTextures( FbxGeometry* pGeom ) const;
85 
86  void GetTextureList( FbxArray<TexData>& pTextures, FbxLayeredTexture* pTex ) const;
87 
88  FbxLayer* FindLayerForTexture( FbxTexture* pTex,
89  FbxLayerElement::EType pTexType,
91  FbxGeometry* pGeom,
92  int lComponentIndex,
93  int lStartIndex = 0 ) const;
94 
95  void InitTextureElement( FbxLayerElementTexture* pTexElm, int pComponentCount,
97 
98  bool AssignTexturesToLayerElements( FbxNode* pNode);
99 
100  bool HasTextureLayerElements( FbxGeometry& pGeom ) const;
101 
102  void ConvertToPerFaceMapping( FbxMesh* pGeom ) const;
103 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
104 };
105 
106 #include <fbxsdk/fbxsdk_nsend.h>
107 
108 #endif /* _FBXSDK_UTILS_MATERIAL_CONVERTER_H_ */
FBX SDK environment definition.
FbxLayer class provides a base for the layering mechanism.
Definition: fbxlayer.h:2362
SDK object manager.
Definition: fbxmanager.h:56
#define NULL
Definition: fbxarch.h:210
This class contains material settings.
This class provides functions to restructure the material and textures applied to geometries from FBX...
This class is the base class for textures, ie classes FbxFileTexture, FbxLayeredTexture and FbxProced...
Definition: fbxtexture.h:26
The base class of most FBX objects.
Definition: fbxobject.h:157
Represents an element in the scene graph.
Definition: fbxnode.h:72
This class template holds a pair of objects.
Definition: fbxpair.h:22
This class contains the description of a 3D scene.
Definition: fbxscene.h:61
Layer element for mapping Textures to a geometry.
Definition: fbxlayer.h:2172
EType
Layer Element type identifier.
Definition: fbxlayer.h:75
FbxLayeredTexture is a combination of multiple textures(FbxTexture) blended sequentially.
#define FBXSDK_DLL
Definition: fbxarch.h:173
The base class of geometric objects that support control point deformations (e.g. ...
Definition: fbxgeometry.h:45
EBlendMode
Lets you control how textures are combined when you apply multiple layers of texture to a surface...
Definition: fbxlayer.h:2214
Class for array of basic elements such as pointers and basic types.
Definition: fbxarray.h:23
A mesh is a geometry made of polygons.
Definition: fbxmesh.h:32