Referencing Media
 
 
 

Referencing Embedded Media

When a binary FBX file containing embedded media is imported, the media will be extracted from the file and copied into a subdirectory. This subdirectory will be created at the location of the FBX file with the same name as the file, with the extension .fbm. For example, the embedded media contained in the file <path>\MyScene.fbx will be extracted into the subdirectory <path>\MyScene.fbm\.

Referencing Non-Embedded Media

The FBX SDK uses the following steps to locate non-embedded media files for ASCII FBX files, or any other file format which does not contain embedded media.

  1. It first checks for the existence of the media file at the absolute path specified by the program which exported the scene to the file. In the following code sample, the texture's filename is specified using KFbxFileTexture::SetFileName().
    // The resource file is in the application's directory.
    KString lTexPath = gAppPath + "\\Crate.jpg";
    
    // Create a texture object.
    KFbxFileTexture* lTexture = KFbxFileTexture::Create(pScene,"Crate Texture");
    
    // Set the texture's absolute file path.
    lTexture->SetFileName(lTexPath.Buffer())
  2. If the media file does not exist at the absolute path, the FBX SDK uses the relative path to the file, which is stored automatically in the FBX file when the scene is exported.