Interface: FileResolutionManager

Interfaces> Core Interfaces > FileResolutionManager

 

   

Core Interfaces - Quick Navigation

The FileResolutionManager Core Interface exposes the new system introduced in 3ds Max 2010 which is used internally by plug-ins to resolve the paths of their file assets.

   

In releases prior to 3ds Max 2010, the resolution of asset files was performed either locally in the plug-in code, or through one of several methods provided by 3ds Max.

Since 3ds Max 2010, all resolutions of asset files must be performed through the AssetUser object that uses the new Asset File Resolution Manager. The File Resolution Manager can also be used for resolutions of Assets. All other resolution methods have been removed, and plug-ins should not implement their rules for resolving paths to a file asset. File resolution is based on the asset file name, asset type,and the file path to a scene that depends on the asset.

The File Resolution Manager also implements a path caching mechanism. A set of methods has been exposed to allow plug-ins and scripts to control the cache enabled/disabled state, cache duration and also to provide a way to bypass the cache when getting the resolved path.

   

Methods:

<bool>FileResolutionManager.getFullFilePath <&TSTR>filePath <enum>assetType byPassCache:<bool> 	 

filePath is In and Out parameter 	 
assetType enums: {#Other | #Bitmap | #XRef | #Photometric | #Animation | #VideoPost | #BatchRender | #ExternalLink | #RenderOutput | #PreRenderScript | #PostRenderScript | #Sound | #Container} 	 
byPassCache default value: false

Returns the full file path by modifying the first argument passed by-reference. The second argument determines the asset type the file belongs to.

If byPassCache: is passed as true, the cache will not be used. If it is passed as false or not specified, the cache will be used.

EXAMPLE:

theFilename = "Simple_Stone_Mtl_Marble_bump.jpg"
--> "Simple_Stone_Mtl_Marble_bump.jpg"
 
FileResolutionManager.getFullFilePath &theFilename #Bitmap
--> true
 
theFilename
--> "C:\Program Files\Autodesk\3ds Max 2010\Maps\adskMtl\Simple_Stone_Mtl_Marble_bump.jpg"

   

<bool>FileResolutionManager.getFullFilePath_assetID <TSTR>assetID <&TSTR>filePath byPassCache:<bool> 

filePath is In and Out parameter 
byPassCache default value: false 

Returns the full file path by modifying the second argument passed by-reference. The first argument defines the assetID to search for.

If byPassCache: is passed as true, the cache will not be used. If it is passed as false or not specified, the cache will be used.

EXAMPLE:

theID = AssetManager.GetAssetID "Simple_Stone_Mtl_Marble_bump.jpg" #Bitmap
--> "{7477A3A4-0304-47AC-8427-6B490673231A}"
 
FileResolutionManager.getFullFilePath_assetID theID &filePath
--> true
 
filePath
--> "C:\Program Files\Autodesk\3ds Max 2010\Maps\adskMtl\Simple_Stone_Mtl_Marble_bump.jpg"

   

<void>FileResolutionManager.doGetUniversalFileName <&TSTR>aFullFilePath 

aFullFilePath is In and Out parameter 

Returns the universal file name by modifying the by-reference argument.

   

<integer>FileResolutionManager.GetNumAssetTypes() 

Returns the number of asset types.

Available in 3ds Max 2011 and higher.

   

<string>FileResolutionManager.GetAssetTypeString <enum>assetType 

assetType enums: {#Other | #Bitmap | #XRef | #Photometric | #Animation | #VideoPost | #BatchRender | #ExternalLink | #RenderOutput | #PreRenderScript | #PostRenderScript | #Sound | #Container} 

Returns the asset type string corresponding to the provided asset type name.

Available in 3ds Max 2011 and higher.

   

Cache

File Resolution results are being cached, but the cached results expire after a specified maximum cache duration period.

<void>FileResolutionManager.EnableCaching() 

Turns the cache on.

The cache is on by default.

File resolutions will be cached and the cached results returns if the same file has to be resolved again sooner than the maximum cache duration (see below).

   

<void>FileResolutionManager.DisableCaching() 

Turns the cache off.

Files will always be resolved without using the cache at all.

   

<bool>FileResolutionManager.IsCachingEnabled() 

Returns true if the cache is on, false if it is off.

The cache is on by default.

   

<DWORD>FileResolutionManager.GetMaximumCacheDuration() 

Returns the maximum cache duration in milliseconds. Default is 1000.

If a resolution has been cached and a new resolution of the same file is requested later than the time of the previous resolution plus the maximum cache duration, the cache result will be ignored and a new resolution will be performed.

If the time passed since the last resolution is less than the maximum cache duration, the cached result will be returned.

   

<void>FileResolutionManager.SetMaximumCacheDuration <DWORD>newMaxDuration 

Sets the maximum cache duration.

   

<INT64>FileResolutionManager.GetNumCacheHit() 

Returns the number of cache hits.

   

See Also