Public Member Functions | Friends

KFbxLayer Class Reference

This reference page is linked to from the following overview topics: Layered Textures, List of Python FBX classes.


Search for all occurrences

Detailed Description

KFbxLayer class provides a base for the layering mechanism.

A layer can contain one or more of the following layer elements:

A typical layer for a Mesh contains Normals, UVs and Materials. A typical layer for NURBS contains only Materials. In the case of the NURBS, the NURBS' parameterization is used for the UVs; no UVs should be specified.

In most cases, you only need a single layer to describe a geometry. Many applications only support what is defined on the first layer. Take this into account when you fill the layer. For example, it is legal to define the Layer 0 with the UVs and then define the model's Normals on layer 1. However if you construct a file this way, it may not be imported correctly in other applications. Store the Normals in Layer 0 to avoid problems.

Since FBX SDK 2011, Textures are connected to the properties of KFbxSurfaceMaterial derived classes. KFbxLayerElementTexture is no longer used. See the code example in KFbxLayerElementTexture for how to connect a texture.

Since FBX SDK 2011, texture layering is achieved by KFbxLayeredTexture. See the code example in KFbxLayeredTexture for how to blend textures.

Normally, you can access layer from KFbxLayerContainer like KFbxGeometry. For example,

 KFbxMesh* mesh;
 KFbxLayer* layer0 = mesh->GetLayer(0);
 KFbxLayerElementNormal* normals = layer0->GetNormals();
See also:
KFbxLayerElement
KFbxLayerElementNormal
KFbxLayerElementBinormal
KFbxLayerElementTangent
KFbxLayerElementMaterial
KFbxLayerElementPolygonGroup
KFbxLayerElementUV
KFbxLayerElementVertexColor
KFbxLayerElementSmoothing
KFbxLayerElementCrease
KFbxLayerElementUserData
KFbxLayerElementHole
KFbxLayerElementVisibility
Examples:

Instances/main.cxx.

Definition at line 2443 of file kfbxlayer.h.

#include <kfbxlayer.h>

List of all members.

Public Member Functions

virtual int  MemoryUsage () const

Friends

class  KFbxLayerContainer

Layer Element Management

KFbxLayerElementNormal GetNormals ()
  Returns this layer's Normals description .
KFbxLayerElementNormal const *  GetNormals () const
  Returns this layer's Normals description .
KFbxLayerElementTangent GetTangents ()
  Returns this layer's Tangents description.
KFbxLayerElementTangent const *  GetTangents () const
  Returns this layer's Tangents description.
KFbxLayerElementBinormal GetBinormals ()
  Returns this layer's Binormals description.
KFbxLayerElementBinormal const *  GetBinormals () const
  Returns this layer's Binormals description.
KFbxLayerElementMaterial GetMaterials ()
  Returns this layer's Materials description.
KFbxLayerElementMaterial const *  GetMaterials () const
  Returns this layer's Materials description.
KFbxLayerElementPolygonGroup GetPolygonGroups ()
  Returns this layer's Polygon Groups description.
KFbxLayerElementPolygonGroup
const * 
GetPolygonGroups () const
  Returns this layer's Polygon Groups description.
KFbxLayerElementUV GetUVs (KFbxLayerElement::ELayerElementType pTypeIdentifier=KFbxLayerElement::eDIFFUSE_TEXTURES)
  Returns this layer's UV description.
KFbxLayerElementUV const *  GetUVs (KFbxLayerElement::ELayerElementType pTypeIdentifier=KFbxLayerElement::eDIFFUSE_TEXTURES) const
  Returns this layer's UV description.
int  GetUVSetCount () const
  Returns the number of different UV sets in this layer.
KArrayTemplate
< KFbxLayerElement::ELayerElementType
GetUVSetChannels () const
  Returns an array that describes which UV sets are in this layer.
KArrayTemplate
< KFbxLayerElementUV const * > 
GetUVSets () const
  Returns an array of UV sets in this layer.
KFbxLayerElementVertexColor GetVertexColors ()
  Returns this layer's Vertex Colors description.
KFbxLayerElementVertexColor const *  GetVertexColors () const
  Returns this layer's Vertex Colors description.
KFbxLayerElementSmoothing GetSmoothing ()
  Returns this layer's Smoothing description.
KFbxLayerElementSmoothing const *  GetSmoothing () const
  Returns this layer's Smoothing description.
KFbxLayerElementCrease GetVertexCrease ()
  Returns this layer's vertex crease description.
KFbxLayerElementCrease const *  GetVertexCrease () const
  Returns this layer's vertex crease description.
KFbxLayerElementCrease GetEdgeCrease ()
  Returns this layer's edge crease description.
KFbxLayerElementCrease const *  GetEdgeCrease () const
  Returns this layer's edge crease description.
KFbxLayerElementHole GetHole ()
  Returns this layer's Hole description.
KFbxLayerElementHole const *  GetHole () const
  Returns this layer's Hole description.
KFbxLayerElementUserData GetUserData ()
  Returns this layer's User Data.
KFbxLayerElementUserData const *  GetUserData () const
  Returns this layer's User Data.
KFbxLayerElementVisibility GetVisibility ()
  Returns this layer's visibility.
KFbxLayerElementVisibility const *  GetVisibility () const
  Returns this layer's visibility.
KFbxLayerElementTexture GetTextures (KFbxLayerElement::ELayerElementType pType)
  Returns this layer's Textures description.
KFbxLayerElementTexture const *  GetTextures (KFbxLayerElement::ELayerElementType pType) const
  Returns this layer's Textures description.
void  SetTextures (KFbxLayerElement::ELayerElementType pType, KFbxLayerElementTexture *pTextures)
  Sets this layer's Textures description.
KFbxLayerElement GetLayerElementOfType (KFbxLayerElement::ELayerElementType pType, bool pIsUV=false)
  Returns the specified type of layer element description for this layer.
KFbxLayerElement const *  GetLayerElementOfType (KFbxLayerElement::ELayerElementType pType, bool pIsUV=false) const
  Returns the specified type of layer element description for this layer.
void  SetNormals (KFbxLayerElementNormal *pNormals)
  Sets this layer's Normals description.
void  SetBinormals (KFbxLayerElementBinormal *pBinormals)
  Sets this layer's Binormals description.
void  SetTangents (KFbxLayerElementTangent *pTangents)
  Sets this layer's Tangents description.
void  SetMaterials (KFbxLayerElementMaterial *pMaterials)
  Sets this layer's Materials description.
void  SetPolygonGroups (KFbxLayerElementPolygonGroup *pPolygonGroups)
  Sets this layer's Polygon Groups description.
void  SetUVs (KFbxLayerElementUV *pUVs, KFbxLayerElement::ELayerElementType pTypeIdentifier=KFbxLayerElement::eDIFFUSE_TEXTURES)
  Sets this layer's UVs description.
void  SetVertexColors (KFbxLayerElementVertexColor *pVertexColors)
  Sets this layer's Vertex Colors description.
void  SetSmoothing (KFbxLayerElementSmoothing *pSmoothing)
  Sets this layer's Smoothing description.
void  SetVertexCrease (KFbxLayerElementCrease *pCrease)
  Sets this layer's Vertex Crease description.
void  SetEdgeCrease (KFbxLayerElementCrease *pCrease)
  Sets this layer's Edge Crease description.
void  SetHole (KFbxLayerElementHole *pHole)
  Sets this layer's Hole description.
void  SetUserData (KFbxLayerElementUserData *pUserData)
  Sets this layer's User Data.
void  SetVisibility (KFbxLayerElementVisibility *pVisibility)
  Sets this layer's the visibility.
void  SetLayerElementOfType (KFbxLayerElement *pLayerElement, KFbxLayerElement::ELayerElementType pType, bool pIsUV=false)
  Sets the specified type of layer element description for this layer.
KFbxLayerElement CreateLayerElementOfType (KFbxLayerElement::ELayerElementType pType, bool pIsUV=false)
  Creates the specified type of layer element description for this layer.
void  Clone (KFbxLayer const &pSrcLayer, KFbxSdkManager *pSdkManager)
  Clone function.
KFbxLayer operator= (KFbxLayer const &pSrcLayer)
  Assignment operator.

Serialization section

bool  ContentWriteTo (KFbxStream &pStream) const
bool  ContentReadFrom (const KFbxStream &pStream)

Member Function Documentation

KFbxLayerElementNormal* GetNormals ( )

Returns this layer's Normals description .

Returns:
A pointer to the Normals layer element, or NULL if no Normals layer element is defined in this layer.
Remarks:
KFbxNurb or KFbxPatch geometry should not have Normals defined.
KFbxLayerElementNormal const* GetNormals ( ) const

Returns this layer's Normals description .

Returns:
A pointer to the Normals layer element, or NULL if no Normals layer element is defined in this layer.
Remarks:
KFbxNurb or KFbxPatch geometry should not have Normals defined.
KFbxLayerElementTangent* GetTangents ( )

Returns this layer's Tangents description.

Returns:
A pointer to the Tangents layer element, or NULL if no Tangents layer element is defined in this layer.
Remarks:
KFbxNurb or KFbxPatch geometry should not have Tangents defined.
KFbxLayerElementTangent const* GetTangents ( ) const

Returns this layer's Tangents description.

Returns:
A pointer to the Tangents layer element, or NULL if no Tangents layer element is defined in this layer.
Remarks:
KFbxNurb or KFbxPatch geometry should not have Tangents defined.
KFbxLayerElementBinormal* GetBinormals ( )

Returns this layer's Binormals description.

Returns:
A pointer to the Binormals layer element, or NULL if no Binormals layer element is defined in this layer.
Remarks:
KFbxNurb or KFbxPatch geometry should not have Binormals defined.
KFbxLayerElementBinormal const* GetBinormals ( ) const

Returns this layer's Binormals description.

Returns:
A pointer to the Binormals layer element, or NULL if no Binormals layer element is defined in this layer.
Remarks:
KFbxNurb or KFbxPatch geometry should not have Binormals defined.
KFbxLayerElementMaterial* GetMaterials ( )

Returns this layer's Materials description.

Returns:
A pointer to the Materials layer element, or NULL if no Materials layer element is defined in this layer.
KFbxLayerElementMaterial const* GetMaterials ( ) const

Returns this layer's Materials description.

Returns:
A pointer to the Materials layer element, or NULL if no Materials layer element is defined in this layer.
KFbxLayerElementPolygonGroup* GetPolygonGroups ( )

Returns this layer's Polygon Groups description.

Returns:
A pointer to the Polygon Groups layer element, or NULL if no Polygon Groups layer element is defined in this layer.
KFbxLayerElementPolygonGroup const* GetPolygonGroups ( ) const

Returns this layer's Polygon Groups description.

Returns:
A pointer to the Polygon Groups layer element, or NULL if no Polygon Groups layer element is defined in this layer.
KFbxLayerElementUV* GetUVs ( KFbxLayerElement::ELayerElementType  pTypeIdentifier = KFbxLayerElement::eDIFFUSE_TEXTURES )

Returns this layer's UV description.

Parameters:
pTypeIdentifier Layer element type identifier, should be a texture type identifier.
Returns:
A pointer to the UVs layer element, or NULL if no UV is defined in this layer.
Remarks:
KFbxNurb or KFbxPatch geometry should not have UVs defined. The NURBS/Patch parameterization is used as UV parameters to map a texture.
KFbxLayerElementUV const* GetUVs ( KFbxLayerElement::ELayerElementType  pTypeIdentifier = KFbxLayerElement::eDIFFUSE_TEXTURES ) const

Returns this layer's UV description.

Parameters:
pTypeIdentifier Layer element type identifier, should be a texture type identifier.
Returns:
A pointer to the UVs layer element, or NULL if no UV is defined in this layer.
Remarks:
KFbxNurb or KFbxPatch geometry should not have UVs defined. The NURBS/Patch parameterization is used as UV parameters to map a texture.
int GetUVSetCount ( ) const

Returns the number of different UV sets in this layer.

Returns an array that describes which UV sets are in this layer.

KArrayTemplate<KFbxLayerElementUV const*> GetUVSets ( ) const

Returns an array of UV sets in this layer.

KFbxLayerElementVertexColor* GetVertexColors ( )

Returns this layer's Vertex Colors description.

Returns:
A pointer to the Vertex Colors layer element, or NULL if no Vertex Color layer element is defined in this layer.
Remarks:
KFbxNurb or KFbxPatch geometry should not have Vertex Colors defined, since no vertex exists.
KFbxLayerElementVertexColor const* GetVertexColors ( ) const

Returns this layer's Vertex Colors description.

Returns:
A pointer to the Vertex Colors layer element, or NULL if no Vertex Color layer element is defined in this layer.
Remarks:
KFbxNurb or KFbxPatch geometry should not have Vertex Colors defined, since no vertex exists.
KFbxLayerElementSmoothing* GetSmoothing ( )

Returns this layer's Smoothing description.

Returns:
A pointer to the Smoothing layer element, or NULL if no Smoothing layer element is defined in this layer.
Remarks:
KFbxNurb or KFbxPatch geometry should not have Smoothing defined.
KFbxLayerElementSmoothing const* GetSmoothing ( ) const

Returns this layer's Smoothing description.

Returns:
A pointer to the Smoothing layer element, or NULL if no Smoothing layer element is defined in this layer.
Remarks:
KFbxNurb or KFbxPatch geometry should not have Smoothing defined.
KFbxLayerElementCrease* GetVertexCrease ( )

Returns this layer's vertex crease description.

Returns:
A pointer to the Crease layer element, or NULL if no Crease layer element is defined in this layer.
Remarks:
Crease info should only be defined when the geometry is KFbxSubdiv.
KFbxLayerElementCrease const* GetVertexCrease ( ) const

Returns this layer's vertex crease description.

Returns:
A pointer to the Crease layer element, or NULL if no Crease layer element is defined in this layer.
Remarks:
Crease info should only be defined when the geometry is KFbxSubdiv.
KFbxLayerElementCrease* GetEdgeCrease ( )

Returns this layer's edge crease description.

Returns:
A pointer to the Crease layer element, or NULL if no Crease layer element is defined in this layer.
Remarks:
Crease info should only be defined when the geometry is KFbxSubdiv.
KFbxLayerElementCrease const* GetEdgeCrease ( ) const

Returns this layer's edge crease description.

Returns:
A pointer to the Crease layer element, or NULL if no Crease layer element is defined in this layer.
Remarks:
Crease info should only be defined when the geometry is KFbxSubdiv.
KFbxLayerElementHole* GetHole ( )

Returns this layer's Hole description.

Returns:
A pointer to the Hole layer element, or NULL if no Hole layer element is defined in this layer.
Remarks:
Hole info should only be defined when the geometry is KFbxMesh.
KFbxLayerElementHole const* GetHole ( ) const

Returns this layer's Hole description.

Returns:
A pointer to the Hole layer element, or NULL if no Hole layer element is defined in this layer.
Remarks:
Hole info should only be defined when the geometry is KFbxMesh.
KFbxLayerElementUserData* GetUserData ( )

Returns this layer's User Data.

Returns:
A pointer to the User Data layer element, or NULL if no User Data layer element is defined in this layer.
KFbxLayerElementUserData const* GetUserData ( ) const

Returns this layer's User Data.

Returns:
A pointer to the User Data layer element, or NULL if no User Data layer element is defined in this layer.
KFbxLayerElementVisibility* GetVisibility ( )

Returns this layer's visibility.

Returns:
A pointer to the visibility layer element, or NULL if no visibility layer element is defined in this layer.
KFbxLayerElementVisibility const* GetVisibility ( ) const

Returns this layer's visibility.

Returns:
A pointer to the visibility layer element, or NULL if no visibility layer element is defined in this layer.

Returns this layer's Textures description.

Parameters:
pType Layer element type, should be a texture type identifier.
Returns:
A pointer to the Textures layer element, or NULL if no Textures layer element is defined in this layer.
KFbxLayerElementTexture const* GetTextures ( KFbxLayerElement::ELayerElementType  pType ) const

Returns this layer's Textures description.

Parameters:
pType Layer element type, should be a texture type identifier.
Returns:
A pointer to the Textures layer element, or NULL if no Textures layer element is defined in this layer.
void SetTextures ( KFbxLayerElement::ELayerElementType  pType,
KFbxLayerElementTexture pTextures 
)

Sets this layer's Textures description.

Parameters:
pType Texture type identifier.
pTextures A pointer to the Textures layer element, or NULL to remove the Textures definition.
KFbxLayerElement* GetLayerElementOfType ( KFbxLayerElement::ELayerElementType  pType,
bool  pIsUV = false 
)

Returns the specified type of layer element description for this layer.

Parameters:
pType The required Layer element type.
pIsUV If true, requests the UV layer element that corresponds with the specified texture type.
Returns:
A pointer to the requested layer element, or NULL if the layer element is not defined in this layer.
KFbxLayerElement const* GetLayerElementOfType ( KFbxLayerElement::ELayerElementType  pType,
bool  pIsUV = false 
) const

Returns the specified type of layer element description for this layer.

Parameters:
pType The required Layer element type.
pIsUV If true, requests the UV layer element that corresponds with the specified texture type.
Returns:
A pointer to the requested layer element, or NULL if the layer element is not defined in this layer.
void SetNormals ( KFbxLayerElementNormal pNormals )

Sets this layer's Normals description.

Parameters:
pNormals A pointer to the Normals layer element, or NULL to remove the Normals definition.
Remarks:
KFbxNurb or KFbxPatch geometry should not have Normals defined.
Examples:
Instances/main.cxx.
void SetBinormals ( KFbxLayerElementBinormal pBinormals )

Sets this layer's Binormals description.

Parameters:
pBinormals A pointer to the Binormals layer element, or NULL to remove the Binormals definition.
Remarks:
KFbxNurb or KFbxPatch geometry should not have Binormals defined.
void SetTangents ( KFbxLayerElementTangent pTangents )

Sets this layer's Tangents description.

Parameters:
pTangents A pointer to the Tangents layer element, or NULL to remove the Tangents definition.
Remarks:
KFbxNurb or KFbxPatch geometry should not have Tangents defined.
void SetMaterials ( KFbxLayerElementMaterial pMaterials )

Sets this layer's Materials description.

Parameters:
pMaterials A pointer to the Materials layer element, or NULL to remove the Material definition.
void SetPolygonGroups ( KFbxLayerElementPolygonGroup pPolygonGroups )

Sets this layer's Polygon Groups description.

Parameters:
pPolygonGroups A pointer to the Polygon Groups layer element, or NULL to remove the Polygon Group definition.
void SetUVs ( KFbxLayerElementUV pUVs,
KFbxLayerElement::ELayerElementType  pTypeIdentifier = KFbxLayerElement::eDIFFUSE_TEXTURES 
)

Sets this layer's UVs description.

Parameters:
pUVs A pointer to the UVs layer element, or NULL to remove the UV definition.
pTypeIdentifier Layer element type, should be texture type.
Remarks:
KFbxNurb or KFbxPatch geometry should not have UVs defined. The NURBS/Patch parameterization is used as UV parameters to map a texture.
Examples:
Instances/main.cxx.
void SetVertexColors ( KFbxLayerElementVertexColor pVertexColors )

Sets this layer's Vertex Colors description.

Parameters:
pVertexColors A pointer to the Vertex Colors layer element, or NULL to remove the Vertex Color definition.
Remarks:
KFbxNurb or KFbxPatch geometry should not have Vertex Colors defined, since no vertex exists.
void SetSmoothing ( KFbxLayerElementSmoothing pSmoothing )

Sets this layer's Smoothing description.

Parameters:
pSmoothing A pointer to the Smoothing layer element, or NULL to remove the Smoothing definition.
Remarks:
KFbxNurb or KFbxPatch geometry should not have Smoothing defined.
void SetVertexCrease ( KFbxLayerElementCrease pCrease )

Sets this layer's Vertex Crease description.

Parameters:
pCrease A pointer to the Vertex Crease layer element, or NULL to remove the Crease definition.
Remarks:
Crease should only be defined when the geometry is KFbxSubdiv.
void SetEdgeCrease ( KFbxLayerElementCrease pCrease )

Sets this layer's Edge Crease description.

Parameters:
pCrease A pointer to the Edge Crease layer element, or NULL to remove the Crease definition.
Remarks:
Crease should only be defined when the geometry is KFbxSubdiv.
void SetHole ( KFbxLayerElementHole pHole )

Sets this layer's Hole description.

Parameters:
pHole A pointer to the Hole layer element, or NULL to remove the Hole definition.
Remarks:
Hole should only be defined when the geometry is KFbxMesh.
void SetUserData ( KFbxLayerElementUserData pUserData )

Sets this layer's User Data.

Parameters:
pUserData A pointer to the User Data layer element, or NULL to remove the User Data.
void SetVisibility ( KFbxLayerElementVisibility pVisibility )

Sets this layer's the visibility.

Parameters:
pVisibility A pointer to the visibility layer element, or NULL to remove the visibility.
void SetLayerElementOfType ( KFbxLayerElement pLayerElement,
KFbxLayerElement::ELayerElementType  pType,
bool  pIsUV = false 
)

Sets the specified type of layer element description for this layer.

Parameters:
pLayerElement A pointer to the layer element, or NULL to remove the layer element.
pType The required Layer element type.
pIsUV If true, requests the UV layer element that corresponds with the specified texture type.
KFbxLayerElement* CreateLayerElementOfType ( KFbxLayerElement::ELayerElementType  pType,
bool  pIsUV = false 
)

Creates the specified type of layer element description for this layer.

Parameters:
pType The required Layer element type.
pIsUV When true, requests the UV LayerElement that corresponds with the specified Layer Element type (only applies to TEXTURE type layer elements).
Returns:
A pointer to the newly created layer element, or NULL if the layer element has not been created for this layer.
void Clone ( KFbxLayer const &  pSrcLayer,
KFbxSdkManager pSdkManager 
)

Clone function.

Parameters:
pSrcLayer The source layer to be cloned.
pSdkManager
KFbxLayer& operator= ( KFbxLayer const &  pSrcLayer ) [protected]

Assignment operator.

bool ContentWriteTo ( KFbxStream pStream ) const
bool ContentReadFrom ( const KFbxStream pStream )
virtual int MemoryUsage ( ) const [virtual]

Friends And Related Function Documentation

friend class KFbxLayerContainer [friend]

Definition at line 2816 of file kfbxlayer.h.


The documentation for this class was generated from the following file:

KFbxLayer KFbxLayer KFbxLayer KFbxLayer KFbxLayer KFbxLayer KFbxLayer KFbxLayer KFbxLayer KFbxLayer
KFbxLayer KFbxLayer KFbxLayer KFbxLayer KFbxLayer KFbxLayer KFbxLayer KFbxLayer KFbxLayer KFbxLayer