Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® FBX® / FBX SDK / not all control points (vertices) in a mesh are assigned to a cluster (bone) ?
  RSS 2.0 ATOM  

not all control points (vertices) in a mesh are assigned to a cluster (bone) ?
Rate this thread
 
61780
 
Permlink of this thread  
avatar
  • johnhp
  • Posted: 08 November 2011 05:42 AM
  • Total Posts: 1
  • Joined: 08 November 2011 04:36 AM

I’m trying to load FBX models into Ogre, and so far I have no problem with static meshes, however I haven’t been able to handle skeletal animation yet.

Ogre requires that every vertex in a skinned mesh must be assigned to a bone, however the information that I’m getting from the FBX file doesn’t work out that way.

My question is this:  is it OK (in terms of FBX loading) for a skinned mesh to have vertices which are not assigned to any cluster?

The code below shows how I’m accessing vertex bone assignments, and the output when I run the program.

int numVertAssignments 0;
    
int numClusters 0;
    
int numDeformers 0;

    
assertgMesh );
    
numDeformers gMesh->GetDeformerCount();
    for( 
int i 0gMesh->GetDeformerCount(); ++)
    
{
        KFbxSkin 
*skin = (KFbxSkin*)mesh->GetDeformeriKFbxDeformer::eSKIN );
        
assertskin );

        
numClusters skin->GetClusterCount();
        for( 
int j 0skin->GetClusterCount(); ++)
        
{
            KFbxCluster 
*cluster = (KFbxCluster*)skin->GetCluster);
            
assertcluster );

            
int numIndices cluster->GetControlPointIndicesCount();

            
numVertAssignments += numIndices;
        
}
    }
    
    AV_LOG_INFOL
("number of deformers: " << numDeformers);
    
AV_LOG_INFOL("number of clusters: " << numClusters);
    
AV_LOG_INFOL("number of vertex assignments: " << numVertAssignments);
    
AV_LOG_INFOL("number of vertices in mesh: " << gMesh->GetPolygonVertexCount());
infonumber of vertices in mesh400980
info
number of deformers1
info
number of clusters64
info
number of vertex assignments98673


Replies: 1
/img/forum/dark/default_avatar.png

I see a couple of issues here. One is that GetPolygonVertexCount is not guaranteed to be (and usually won’t be) the same result as GetControlPointsCount. Cluster weights correspond to control points and not polygon vertices directly. The second issue is that you’re not getting an accurate count of how many vertices are actually weighted, because clusters are likely to reference a single vert more than once in the event that the vert has multiple joint influences.

The appropriate way to handle skinning with deform clusters can be seen in examples\ViewScene\DrawScene.cxx. ComputeLinearDeformation is a good function to start with.

Author: RichWhitehouse

Replied: 10 November 2011 02:07 AM