Jump to content
  • Advertisement
Sign in to follow this  
wforl

FBX Textures Problem

This topic is 3427 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!