FBX C++ API Reference
fbxtexture.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_SHADING_TEXTURE_H_
14 #define _FBXSDK_SCENE_SHADING_TEXTURE_H_
15 
16 #include <fbxsdk/fbxsdk_def.h>
17 
18 #include <fbxsdk/core/fbxobject.h>
19 
20 #include <fbxsdk/fbxsdk_nsbegin.h>
21 
27 {
29 
30 public:
41  {
53  };
54 
60  {
66  eTEXTURE_USE_6_BUMP_NORMAL_MAP
67  };
68 
72  enum EWrapMode
73  {
75  eClamp
76  };
77 
81  {
86  eOver
87  };
88 
92  {
95  eTop,
96  eBottom
97  };
98 
102  {
103  eU,
104  eV,
105  eW
106  };
107 
108  // Type description
109 
114 
119 
120 
121  // Mapping information
122 
127 
132 
137 
143 
149 
150  // Texture positioning
151 
156 
161 
166 
171 
176 
177  // Blend mode
182 
183  // UV set to use.
188 
193  static const char* sVectorSpace ;
194  static const char* sVectorSpaceWorld ;
195  static const char* sVectorSpaceObject ;
196  static const char* sVectorSpaceTangent ;
197 
202  static const char* sVectorEncoding ;
203  static const char* sVectorEncodingFP ;
204  static const char* sVectorEncodingSE ;
205 
206 
209  virtual void Reset();
210 
215  void SetSwapUV(bool pSwapUV);
216 
221  bool GetSwapUV() const;
222 
227  void SetPremultiplyAlpha(bool pPremultiplyAlpha);
228 
233  bool GetPremultiplyAlpha() const;
234 
238  {
241  eBlack
242  };
243 
247  void SetAlphaSource(EAlphaSource pAlphaSource);
248 
252  EAlphaSource GetAlphaSource() const;
253 
263  void SetCropping(int pLeft, int pTop, int pRight, int pBottom);
264 
268  int GetCroppingLeft() const;
269 
273  int GetCroppingTop() const;
274 
278  int GetCroppingRight() const;
279 
283  int GetCroppingBottom() const;
284 
288  {
295  eUV,
296  eEnvironment
297  };
298 
302  void SetMappingType(EMappingType pMappingType);
303 
307  EMappingType GetMappingType() const;
308 
312  {
315  ePlanarNormalZ
316  };
317 
321  void SetPlanarMappingNormal(EPlanarMappingNormal pPlanarMappingNormal);
322 
326  EPlanarMappingNormal GetPlanarMappingNormal() const;
327 
331  {
337  eBumpNormalMap
338  };
339 
343  void SetTextureUse(ETextureUse pTextureUse);
344 
348  ETextureUse GetTextureUse() const;
349 
350 
355  void SetWrapMode(EWrapMode pWrapU, EWrapMode pWrapV);
356 
360  EWrapMode GetWrapModeU() const;
361 
365  EWrapMode GetWrapModeV() const;
366 
367 
371  void SetBlendMode(EBlendMode pBlendMode);
372 
376  EBlendMode GetBlendMode() const;
377 
379 
385 
395  inline void SetDefaultT(const FbxVector4& pT) { Translation.Set( pT ); }
396 
407  FbxVector4& GetDefaultT(FbxVector4& pT) const;
408 
417  inline void SetDefaultR(const FbxVector4& pR) { Rotation.Set( FbxDouble3(pR[0],pR[1],pR[2]) ); }
418 
428  FbxVector4& GetDefaultR(FbxVector4& pR) const;
429 
437  inline void SetDefaultS(const FbxVector4& pS) { Scaling.Set( FbxDouble3(pS[0],pS[1],pS[2]) ); }
438 
446  FbxVector4& GetDefaultS(FbxVector4& pS) const;
447 
449 
454 
458  void SetDefaultAlpha(double pAlpha);
459 
463  double GetDefaultAlpha() const;
464 
466 
474 
481  void SetTranslation(double pU,double pV);
482 
487  double GetTranslationU() const;
488 
493  double GetTranslationV() const;
494 
502  void SetRotation(double pU, double pV, double pW = 0.0);
503 
505  double GetRotationU() const;
506 
508  double GetRotationV() const;
509 
511  double GetRotationW() const;
512 
519  void SetScale(double pU,double pV);
520 
525  double GetScaleU() const;
526 
531  double GetScaleV() const;
533 
534 /*****************************************************************************************************************************
535 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
536 *****************************************************************************************************************************/
537 #ifndef DOXYGEN_SHOULD_SKIP_THIS
538  virtual FbxObject& Copy(const FbxObject& pObject);
539 
540  bool operator==(FbxTexture const& pTexture) const;
541 
542  void SetUVTranslation(FbxVector2& pT);
543  FbxVector2& GetUVTranslation();
544  void SetUVScaling(FbxVector2& pS);
545  FbxVector2& GetUVScaling();
546 
547  FbxString GetTextureType();
548 
549 protected:
550  virtual void Construct(const FbxObject* pFrom);
551  virtual void ConstructProperties(bool pForceSet);
552 
553  virtual bool PropertyNotify(EPropertyNotifyType pType, FbxProperty& pProperty);
554 
555  void Init();
556 
557  int mCropping[4]; // not a prop
558 
559  EAlphaSource mAlphaSource; // now unused in MB (always set to None); not a prop
560  EMappingType mMappingType; // CurrentMappingType
561  EPlanarMappingNormal mPlanarMappingNormal; // CurrentMappingType
562 
563  // Unsupported parameters in the FBX SDK, these are declared but not accessible.
564  // They are used to keep imported and exported data identical.
565  FbxVector2 mUVScaling; // not a prop
566  FbxVector2 mUVTranslation; // not a prop
567 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
568 };
569 
574 
575 #include <fbxsdk/fbxsdk_nsend.h>
576 
577 #endif /* _FBXSDK_SCENE_SHADING_TEXTURE_H_ */
FbxPropertyT< FbxBool > UVSwap
This property handles the swap UV flag.
Definition: fbxtexture.h:142
static const char * sVectorSpaceWorld
Definition: fbxtexture.h:194
#define FBXSDK_OBJECT_DECLARE(Class, Parent)
Macro used to declare a new class derived from FbxObject.
Definition: fbxobject.h:61
No texture mapping defined.
Definition: fbxtexture.h:290
Spherical reflection map: Object reflects the contents of the scene.
Definition: fbxtexture.h:336
EPlanarMappingNormal
Planar mapping normal orientations.
Definition: fbxtexture.h:311
ECoordinates
Texture coordinates.
Definition: fbxtexture.h:101
FBX SDK environment definition.
Left cropping.
Definition: fbxtexture.h:94
Right cropping.
Definition: fbxtexture.h:95
FbxPropertyT & Set(const T &pValue)
Assignment function.
Definition: fbxproperty.h:1137
FbxPropertyT< EWrapMode > WrapModeV
This property handles the texture wrap modes in V.
Definition: fbxtexture.h:136
FbxPropertyT< EBlendMode > CurrentTextureBlendMode
This property handles the texture blend mode.
Definition: fbxtexture.h:181
FbxVectorTemplate3< FbxDouble > FbxDouble3
Definition: fbxtypes.h:258
Maps to EMappingType::eCylindrical.
Definition: fbxtexture.h:48
Maps to EMappingType::ePlanar and EPlanarMappingNormal::ePlanarNormalY.
Definition: fbxtexture.h:46
EWrapMode
Wrap modes.
Definition: fbxtexture.h:72
FbxPropertyT< FbxString > UVSet
This property handles the use of UV sets.
Definition: fbxtexture.h:187
virtual FbxObject & Copy(const FbxObject &pObject)
Copy an object content into this object.
Utility class to manipulate strings.
Definition: fbxstring.h:66
Apply texture to the model viewed as a plane.
Definition: fbxtexture.h:291
Maps to EMappingType::eSpherical.
Definition: fbxtexture.h:47
FbxPropertyT< EUnifiedMappingType > CurrentMappingType
This property handles the texture mapping types.
Definition: fbxtexture.h:126
FbxPropertyT< FbxDouble3 > ScalingPivot
This property handles the scaling pivot vector.
Definition: fbxtexture.h:175
void SetDefaultR(const FbxVector4 &pR)
Sets the default rotation vector.
Definition: fbxtexture.h:417
Wrap texture around the model as if it was a sphere.
Definition: fbxtexture.h:292
Maps to ETextureUse::eSphereReflectionMap.
Definition: fbxtexture.h:64
This class is the base class for textures, ie classes FbxFileTexture, FbxLayeredTexture and FbxProced...
Definition: fbxtexture.h:26
Maps to EMappingType::eEnvironment.
Definition: fbxtexture.h:49
FbxPropertyT< ETextureUse6 > TextureTypeUse
This property handles the use of textures.
Definition: fbxtexture.h:113
Maps to ETextureUse::eShadowMap.
Definition: fbxtexture.h:65
FbxPropertyT< EWrapMode > WrapModeU
This property handles the texture wrap modes in U.
Definition: fbxtexture.h:131
FbxPropertyT< FbxDouble3 > Translation
This property handles the default translation vector.
Definition: fbxtexture.h:155
Maps to ETextureUse::eStandard.
Definition: fbxtexture.h:62
EFbxType
Type identifier constants.
Wrap texture around the model as if it was a cylinder.
Definition: fbxtexture.h:293
The base class of most FBX objects.
Definition: fbxobject.h:157
static const char * sVectorEncoding
This property only used by Vector Displacement Texture so it is not added to FbxTexture.
Definition: fbxtexture.h:202
FbxPropertyT< FbxDouble3 > Scaling
This property handles the default scale vector.
Definition: fbxtexture.h:165
U axis.
Definition: fbxtexture.h:104
Maps to EMappingType::ePlanar and EPlanarMappingNormal::ePlanarNormalZ.
Definition: fbxtexture.h:44
The color value of the texture is multiplied by the color values of all previous layers of texture...
Definition: fbxtexture.h:85
static const char * sVectorSpaceObject
Definition: fbxtexture.h:195
DEPRECATED! Maps to EMappingType::eFace.
Definition: fbxtexture.h:52
virtual void Construct(const FbxObject *pFrom)
Optional constructor override, automatically called by default constructor.
EFbxType FbxTypeOf(const FbxTexture::EUnifiedMappingType &)
Definition: fbxtexture.h:570
void SetDefaultT(const FbxVector4 &pT)
Sets the default translation vector.
Definition: fbxtexture.h:395
FbxPropertyT< FbxDouble3 > RotationPivot
This property handles the rotation pivot vector.
Definition: fbxtexture.h:170
static const char * sVectorSpace
This property only used by Vector Displacement Texture so it is not added to FbxTexture.
Definition: fbxtexture.h:193
Enumeration.
EBlendMode
Blend modes.
Definition: fbxtexture.h:80
Class to hold user properties.
Definition: fbxproperty.h:37
FbxPropertyT< FbxDouble3 > Rotation
This property handles the default rotation vector.
Definition: fbxtexture.h:160
EAlignMode
Align indices for cropping.
Definition: fbxtexture.h:91
Apply texture to the model viewed as a face.
Definition: fbxtexture.h:295
ETextureUse6
Internal enum for texture usage.
Definition: fbxtexture.h:59
static const char * sVectorEncodingFP
Definition: fbxtexture.h:203
static const char * sVectorSpaceTangent
Definition: fbxtexture.h:196
DEPRECATED! Maps to EMappingType::eBox.
Definition: fbxtexture.h:51
A four double mathematic vector class.
Definition: fbxvector4.h:25
Maps to EMappingType::eUV.
Definition: fbxtexture.h:43
Maps to ETextureUse::eSphericalReflectionMap.
Definition: fbxtexture.h:63
EUnifiedMappingType
Internal enum for texture mapping types.
Definition: fbxtexture.h:40
FbxPropertyT< FbxDouble > Alpha
This property handles the default alpha value for textures.
Definition: fbxtexture.h:118
Normals are in the direction of the X axis, mapping plan is in the YZ axis.
Definition: fbxtexture.h:314
#define FBXSDK_DLL
Definition: fbxarch.h:173
EMappingType
Texture mapping types.
Definition: fbxtexture.h:287
ETextureUse
Texture uses.
Definition: fbxtexture.h:330
A two double mathematic vector class.
Definition: fbxvector2.h:23
Maps to EMappingType::ePlanar and EPlanarMappingNormal::ePlanarNormalX.
Definition: fbxtexture.h:45
FbxPropertyT< FbxBool > PremultiplyAlpha
This property handles the PremultiplyAlpha flag.
Definition: fbxtexture.h:148
Wrap texture around the model as if it was a box.
Definition: fbxtexture.h:294
void SetDefaultS(const FbxVector4 &pS)
Sets the default scale vector.
Definition: fbxtexture.h:437
EAlphaSource
Controls if the Alpha computation of the current texture comes from the Alpha channel, RGB Intensity channel, or if there is No Alpha.
Definition: fbxtexture.h:237
The texture is transparent, depending on the Alpha settings.
Definition: fbxtexture.h:83
virtual void ConstructProperties(bool pForceSet)
Optional property constructor override, automatically called by default constructor.
static const char * sVectorEncodingSE
Definition: fbxtexture.h:204
The color of the texture is added to the previous texture.
Definition: fbxtexture.h:84
Standard texture use (ex. image)
Definition: fbxtexture.h:333