FBGeometry regroups all geometry-related elements across several the subclasses FBMesh, FBSurface, FBNurbs and FBPatch. The property MaterialMappingMode can be one of three values. Depending on which is the current values there are different ways of getting the current material.
By default, models created with the GUI or the SDK use the mapping mode kFBMappingModeUnique. Calling FBGeometry::VertexMaterialIdSet() (with valid vertex Id and material Id) changse the mapping mode to kFBMappingModeVertex. The equivalent is true when calling the method FBMesh::PolygonMaterialIdSet().
From a handle to the model, it is possible to get a mesh object to manipulate the way the model is displayed. This is shown in the following snippet. By creating a mesh object with its constructor, the actual object is then associated to a model. From there, it is possible to add and remove materials and textures, change colors, etc.
HFBModel lModel = new
FBModel(“Model”);
FBMesh lMesh ( lModel );
HFBMaterial lMat = new
FBMaterial(“Material”);
// Setup lMat ...
lMesh.Materials.Add( lMat );