Classes | Public Types | Public Member Functions | Protected Member Functions | Friends

KFbxLayerElementMaterial 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

Layer element for mapping materials (KFbxSurfaceMaterial) to a geometry.

FBX SDK 2011 and later connects materials (KFbxSurfaceMaterial) to nodes (KFbxNode). The direct array of this class is no longer used. The integer "n" in the index array of this class represents the n-th material (zero-based) connected to the node.

For example:

Mapping mode eALL_SAME and index array {0} means the whole geometry is assigned with the 0-th material connected to the node.

Mapping mode eBY_POLYGON and index array {0, 1} means the first polygon is assigned with the 0-th material and the second polygon is assigned with the 1-th material.

You can access the materials from a node by using KFbxNode::GetMaterialCount() and KFbxNode::GetMaterial(int pIndex) or the more generic calls to GetSrcObjectCount(FBX_TYPE(KFbxSurfaceMaterial)) and GetSrcObject(FBX_TYPE(KFbxSurfaceMaterial), index)

For example:

 KFbxNode* node;
 int nbMat = node->GetMaterialCount();
 int nbMat1= node->GetSrcObjectCount(FBX_TYPE(KFbxSurfaceMaterial));

 KFbxSurfaceMaterial* material;
 KFbxLayerElementMaterial* layerElement;
 if (layerElement->GetMappingMode() == KFbxLayerElement::eALL_SAME)
 {
     int index = layerElement->GetIndexArray()[0];
     material = node->GetMaterial(index);
 }
Remarks:
The DirectArray() methods still exist for legacy reasons but has been made private and should not be used.
See also:
KFbxSurfaceMaterial
KFbxNode
Examples:

ExportDocument/main.cxx, ExportScene02/main.cxx, ExportScene03/main.cxx, ImportScene/DisplayMesh.cxx, Layers/main.cxx, ProceduralTexture/main.cxx, and UIExamples/CubeCreator/SDK_Utility.cxx.

Definition at line 1425 of file kfbxlayer.h.

#include <kfbxlayer.h>

Inheritance diagram for KFbxLayerElementMaterial:
Inheritance graph
[legend]

List of all members.

Classes

class   LayerElementArrayProxy

Public Types

typedef
KFbxLayerElementTemplate
< KFbxSurfaceMaterial * > 
ParentClass

Public Member Functions

  CREATE_DECLARE (LayerElementMaterial)
  Allocation method.
virtual void  AllocateArrays ()
virtual void  SetOwner (KFbxLayerContainer *pOwner, int pInstance=0)
virtual void  SetInstance (int pInstance)

Protected Member Functions

  KFbxLayerElementMaterial ()
  ~KFbxLayerElementMaterial ()

Friends

class  KFbxLayerContainer

Member Typedef Documentation

Definition at line 1428 of file kfbxlayer.h.


Constructor & Destructor Documentation

KFbxLayerElementMaterial ( ) [protected]
~KFbxLayerElementMaterial ( ) [protected]

Member Function Documentation

CREATE_DECLARE ( LayerElementMaterial  )

Allocation method.

Returns:
A pointer to the layer element or NULL if creation fails.
virtual void AllocateArrays ( ) [virtual]
virtual void SetOwner ( KFbxLayerContainer pOwner,
int  pInstance = 0 
) [virtual]
virtual void SetInstance ( int  pInstance ) [inline, virtual]

Definition at line 1461 of file kfbxlayer.h.

{ SetOwner( mOwner, pInstance ); }

Friends And Related Function Documentation

friend class KFbxLayerContainer [friend]

Reimplemented from KFbxLayerElement.

Definition at line 1478 of file kfbxlayer.h.


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

KFbxLayerElementMaterial KFbxLayerElementMaterial KFbxLayerElementMaterial KFbxLayerElementMaterial KFbxLayerElementMaterial KFbxLayerElementMaterial KFbxLayerElementMaterial KFbxLayerElementMaterial KFbxLayerElementMaterial KFbxLayerElementMaterial
KFbxLayerElementMaterial KFbxLayerElementMaterial KFbxLayerElementMaterial KFbxLayerElementMaterial KFbxLayerElementMaterial KFbxLayerElementMaterial KFbxLayerElementMaterial KFbxLayerElementMaterial KFbxLayerElementMaterial KFbxLayerElementMaterial