Show
Ignore:
Timestamp:
03/19/10 21:12:19 (3 years ago)
Author:
mplatings
Message:

Workaround for files exported from SoftImage? that don't tag skeleton nodes correctly.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgPlugins/fbx/fbxRMesh.cpp

    r11154 r11262  
    293293    const char* szName, 
    294294    BindMatrixMap& boneBindMatrices, 
     295    const std::set<const KFbxNode*>& fbxSkeletons, 
    295296    std::map<KFbxNode*, osgAnimation::Skeleton*>& skeletonMap) 
    296297{ 
     
    300301    pGeode->setName(szName); 
    301302 
    302     const KFbxLayer* pFbxLayer = 0; 
     303    const KFbxLayer* pFbxLayer = fbxMesh->GetLayer(0); 
    303304    const KFbxLayerElementNormal* pFbxNormals = 0; 
    304305    const KFbxLayerElementUV* pFbxUVs = 0; 
     
    308309    const KFbxVector4* pFbxVertices = fbxMesh->GetControlPoints(); 
    309310 
    310     if (pFbxLayer = fbxMesh->GetLayer(0)) 
     311    if (pFbxLayer) 
    311312    { 
    312313        pFbxNormals = pFbxLayer->GetNormals(); 
     
    615616        if (pSkin->GetClusterCount()) 
    616617        { 
    617             osgAnimation::Skeleton* pSkeleton = getSkeleton(pSkin->GetCluster(0)->GetLink(), skeletonMap); 
     618            osgAnimation::Skeleton* pSkeleton = getSkeleton( 
     619                pSkin->GetCluster(0)->GetLink(), fbxSkeletons, skeletonMap); 
    618620            pSkeleton->addChild(pResult); 
    619621            return osgDB::ReaderWriter::ReadResult::FILE_LOADED; 
     
    629631    std::vector<StateSetContent>& stateSetList, 
    630632    BindMatrixMap& boneBindMatrices, 
     633    const std::set<const KFbxNode*>& fbxSkeletons, 
    631634    std::map<KFbxNode*, osgAnimation::Skeleton*>& skeletonMap) 
    632635{ 
     
    639642 
    640643    return readMesh(pSdkManager, pNode, lMesh, pAnimationManager, stateSetList, 
    641         pNode->GetName(), boneBindMatrices, skeletonMap); 
    642 } 
     644        pNode->GetName(), boneBindMatrices, fbxSkeletons, skeletonMap); 
     645}