Asset File Path Resolution
 
 
 

All resolutions of asset files are performed through the MaxSDK::AssetManagement::AssetUser object which uses IFileResolutionManager. The IFileResolutionManager can also be used for resolutions of assets. File resolution is based on the asset file name and the asset type.

In order to use the asset file resolution manager your project needs to link to the assetmanagement.lib library. Below is an example of how to get a pointer to the file resolution manager and invoke a function defined in its interface.

#include "path.h"
#include "AssetType.h"
#include " IFileResolutionManager.h"
 
IFileResolutionManager* pFRM = IFileResolutionManager::GetInstance();
MaxSDK::Util::Path path(_M("myBitmap.bmp"));
if (pFRM->GetFullFilePath(path, MaxSDK::AssetManagement::kBitmapAsset))
{
  // path now holds a fully qualified path
}
else
{
  // the bitmap file could not be found using 3ds Max asset
  // resolution rules. The value of path is left unchanged
}

IFileResolutionManager also provides methods for a plug-in to query, enable, and disable caching of resolved file paths, as well as to control the cache duration. When the cache is enabled and still valid, IFileResolutionManager::GetFullFilePath() will return the last path resolved without trying to resolve it again.

To resolve XRef'd asset files using IFileResolutionManager::GetFullFilePath() set the assetType parameter to AssetType::kXRefAsset.

To resolve externally referenced files using IFileResolutionManager::GetFullFilePath() set the assetType parameter to MaxSDK::AssetManagement::AssetType::kXRefAsset.

For more information on the asset file resolution manager see the header file maxsdk\include\IFileResolutionManager.h.