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 / Obtaining textures attached to materials
  RSS 2.0 ATOM  

Obtaining textures attached to materials
Rate this thread
 
50614
 
Permlink of this thread  
avatar
  • Scribe
  • Posted: 19 December 2010 08:23 AM
  • Total Posts: 11
  • Joined: 14 March 2010 07:15 PM

Hi guys,

I’ve managed to successfully retrieve and apply a material to my converted models, and so I’m moving on to textures. After I’ve retrieved my material I’m wishing to obtain a single diffuse texture with the below code:

// Retrieve a diffuse texture for this material if one was used and store the texture name
KFbxProperty lProperty = (node->GetMaterial))->FindPropertyKFbxSurfaceMaterial::sDiffuse );

 if( 
lProperty.GetSrcObjectCountKFbxTexture::ClassId ) > )
 
{
 KFbxTexture
texture KFbxCast <KFbxTexture> (lProperty.GetSrcObjectKFbxTexture::ClassId));
 
}

However, lProperty.GetSrcObjectCount( KFbxTexture::ClassId );, is always returning 0 even though I can confirm a texture has been applied to this Phong material in Maya under Colour.

Any ideas what factors may prevent this from detecting the texture?

Many thanks

NOTE: Never mind, it was because I used a built in maya texture and not a texture from a file.



Replies: 0
avatar
  • nian.wu
  • Posted: 19 December 2010 01:16 PM

Released FBX version only support File texture.
The Maya build-in texture must lost when export to FBX. You can test it by reimport the FBX file to Maya.



Nian Wu
AutoDesk FBX Team

Replies: 1
/userdata/avatar/3yvwf23us_doug100x100.png

Hopefully, one day the exporter will bake them into a texture and save to a file.  That would be a step closer to “platform-independent 3D Data Interchange Technology”.

Author: Doug Rogers

Replied: 19 December 2010 01:32 PM