Index: OpenSceneGraph/trunk/src/osgPlugins/fbx/fbxRMesh.cpp
===================================================================
--- OpenSceneGraph/trunk/src/osgPlugins/fbx/fbxRMesh.cpp (revision 11154)
+++ OpenSceneGraph/trunk/src/osgPlugins/fbx/fbxRMesh.cpp (revision 11262)
@@ -293,4 +293,5 @@
     const char* szName,
     BindMatrixMap& boneBindMatrices,
+    const std::set<const KFbxNode*>& fbxSkeletons,
     std::map<KFbxNode*, osgAnimation::Skeleton*>& skeletonMap)
 {
@@ -300,5 +301,5 @@
     pGeode->setName(szName);
 
-    const KFbxLayer* pFbxLayer = 0;
+    const KFbxLayer* pFbxLayer = fbxMesh->GetLayer(0);
     const KFbxLayerElementNormal* pFbxNormals = 0;
     const KFbxLayerElementUV* pFbxUVs = 0;
@@ -308,5 +309,5 @@
     const KFbxVector4* pFbxVertices = fbxMesh->GetControlPoints();
 
-    if (pFbxLayer = fbxMesh->GetLayer(0))
+    if (pFbxLayer)
     {
         pFbxNormals = pFbxLayer->GetNormals();
@@ -615,5 +616,6 @@
         if (pSkin->GetClusterCount())
         {
-            osgAnimation::Skeleton* pSkeleton = getSkeleton(pSkin->GetCluster(0)->GetLink(), skeletonMap);
+            osgAnimation::Skeleton* pSkeleton = getSkeleton(
+                pSkin->GetCluster(0)->GetLink(), fbxSkeletons, skeletonMap);
             pSkeleton->addChild(pResult);
             return osgDB::ReaderWriter::ReadResult::FILE_LOADED;
@@ -629,4 +631,5 @@
     std::vector<StateSetContent>& stateSetList,
     BindMatrixMap& boneBindMatrices,
+    const std::set<const KFbxNode*>& fbxSkeletons,
     std::map<KFbxNode*, osgAnimation::Skeleton*>& skeletonMap)
 {
@@ -639,4 +642,4 @@
 
     return readMesh(pSdkManager, pNode, lMesh, pAnimationManager, stateSetList,
-        pNode->GetName(), boneBindMatrices, skeletonMap);
-}
+        pNode->GetName(), boneBindMatrices, fbxSkeletons, skeletonMap);
+}
