FBX Textures Problem

Started by
2 comments, last by wforl 14 years, 11 months ago
Im using th efollowing code, to try and retrieve texture data from a mesh object that definatly has a diffuse texture.

void DisplayMesh(KFbxNode* pNode)
{

 KFbxMesh* lMesh = (KFbxMesh*) pNode->GetNodeAttribute ();

    int lLayerCount = lMesh->GetLayerCount();
    if(lLayerCount){
        KFbxLayer* lLayer = lMesh->GetLayer(0);
        if(lLayer){
            KFbxLayerElementTexture* lLayerElementTexture = lLayer->GetDiffuseTextures();
            if(lLayerElementTexture){
                std::cout << lLayerElementTexture->GetDirectArray().GetAt(0)->GetFileName();
            }else cout << "No Diffuse Textures \n";
        }else cout << "No layer 0 \n";
    }else cout << "No Layers \n";
}

but the following line:

KFbxLayerElementTexture* lLayerElementTexture = lLayer->GetDiffuseTextures();

..always returns a NULL pointer. Am i doing something wrong?
Advertisement
anyone?
How do you know what it has a diffuse texture?
Perhaps the export went wrong?
Or it could be a path problem.

if everything fails get the fbx sdk source (assuming it's open?) and step through what GetDiffuseTextures() does.
____________________________Bjarni Arnasonbjarni.us
Quote: How do you know what it has a diffuse texture?
Perhaps the export went wrong?
Or it could be a path problem.

if everything fails get the fbx sdk source (assuming it's open?) and step through what GetDiffuseTextures() does.



I know it has a diffuse texture path because using the file in a 3d app works fine. Also viewing the file in ascii mode shows there to be a texture connection and the correct path.

Its not open source, so i cant step through it. Im just wondering if anyone with experienece with FBX could take a look to see what im oing wrong

This topic is closed to new replies.

Advertisement