IAssetManager Class Reference

This reference page is linked to from the following overview topics: Saving and Loading Assets.


#include <iassetmanager.h>

Inheritance diagram for IAssetManager:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual AssetUser  GetAsset (const MaxSDK::Util::Path &filename, AssetType type, bool autoAcquire=true)=0
  Return an AssetUser object given a file name and an asset type.
virtual AssetUser  GetAsset (const MCHAR *filename, AssetType type, bool autoAcquire=true)=0
  Return an AssetUser object given a file name and an asset type.
virtual AssetUser  GetAsset (const MSTR &filename, AssetType type, bool autoAcquire=true)=0
  Return an AssetUser object given a file name and an asset type.
virtual AssetUser  GetAsset (const AssetId &assetId) const =0
  Return an AssetUser object pointing to the id passed Automatically adds a reference to the asset identified by the AssetId, this reference will be removed at the destruction of the AssetUser.
virtual bool  ReleaseReference (const AssetId &assetid)=0
  Release the reference to the asset identified by the AssetId If the asset doesn't have any other reference it will be removed from the asset manager.
virtual bool  ReleaseReference (const MCHAR *guid_string)=0
  Release the reference to the asset identified by the AssetId string.
virtual bool  AddReference (const AssetId &assetid)=0
  Add a reference to the asset identified by the AssetId.
virtual bool  AddReference (const MCHAR *guid_string)=0
  Add a reference to the asset identified by the AssetId string.
virtual MSTR  AssetIdToString (const AssetId &assetId) const =0
  Convert an AssetId object to a string.
virtual bool  StringToAssetId (const MSTR &string, AssetId &assetId) const =0
  Try to convert an a string to an AssetId.
virtual IOResult  LoadAsset (ILoad *iload, AssetUser &assetUser)=0
  Load an asset from the scene file.
virtual void  RemapLoadedAssetID (AssetId &assetId)=0
  Remaps asset id loaded from scene file to new asset id for the asset.
virtual void  RegisterAssetMetaData (const AssetId &assetId, const MSTR &filename, AssetType type)=0
  Called by system while loading the 3ds Max file.
virtual IOResult  Save (ISave *isave)=0
  Called by system to save the metadata for the active assets to the 3ds Max file.
virtual IOResult  Load (ILoad *iload)=0
  Called by system to load the metadata for all assets from the 3ds Max file.
virtual void  PreSave (ISave *isave)=0
  Called by system before saving to the 3ds Max file.
virtual void  PreLoad (ILoad *iload)=0
  Called by system before loading a 3ds Max file.
virtual void  PostLoad (ILoad *iload)=0
  Called by system after loading the 3ds Max file.

Static Public Member Functions

static AssetMgmntExport
IAssetManager
GetInstance ()
  Returns the only instance of this manager.

Member Function Documentation

virtual AssetUser GetAsset ( const MaxSDK::Util::Path filename,
AssetType  type,
bool  autoAcquire = true 
) [pure virtual]

Return an AssetUser object given a file name and an asset type.

Automatically adds a reference to the asset identified by the AssetId, this reference will be removed at the destruction of the AssetUser.

Parameters:
[in] filename A file name which can be either a full path ("C:\bitmaps\a.bmp"), a relative path("..\bitmaps\a.bmp"), or just a filename("a.bmp").
[in] type The asset type, see AssetType.
[in] autoAcquire if true, if an asset corresponding to the parameters does not exist, a new asset will be created. If false, a new asset will not be created.
Returns:
returns AssetUser instance created.
virtual AssetUser GetAsset ( const MCHAR *  filename,
AssetType  type,
bool  autoAcquire = true 
) [pure virtual]

Return an AssetUser object given a file name and an asset type.

Automatically adds a reference to the asset identified by the AssetId, this reference will be removed at the destruction of the AssetUser.

Parameters:
[in] filename A file name which can be either a full path ("C:\bitmaps\a.bmp"), a relative path("..\bitmaps\a.bmp"), or just a filename("a.bmp").
[in] type The asset type, see AssetType.
[in] autoAcquire if true, if an asset corresponding to the parameters does not exist, a new asset will be created. If false, a new asset will not be created.
Returns:
returns AssetUser instance created.
virtual AssetUser GetAsset ( const MSTR filename,
AssetType  type,
bool  autoAcquire = true 
) [pure virtual]

Return an AssetUser object given a file name and an asset type.

Automatically adds a reference to the asset identified by the AssetId, this reference will be removed at the destruction of the AssetUser.

Parameters:
[in] filename A file name which can be either a full path ("C:\bitmaps\a.bmp"), a relative path("..\bitmaps\a.bmp"), or just a filename("a.bmp").
[in] type The asset type, see AssetType.
[in] autoAcquire if true, if an asset corresponding to the parameters does not exist, a new asset will be created. If false, a new asset will not be created.
Returns:
returns AssetUser instance created.
virtual AssetUser GetAsset ( const AssetId assetId ) const [pure virtual]

Return an AssetUser object pointing to the id passed Automatically adds a reference to the asset identified by the AssetId, this reference will be removed at the destruction of the AssetUser.

Parameters:
[in] assetId the asset of the asset
Returns:
returns AssetUser instance created.
virtual bool ReleaseReference ( const AssetId assetid ) [pure virtual]

Release the reference to the asset identified by the AssetId If the asset doesn't have any other reference it will be removed from the asset manager.

Parameters:
[in] assetId asset id to be released
Returns:
true if the asset was successfully found and released.
virtual bool ReleaseReference ( const MCHAR *  guid_string ) [pure virtual]

Release the reference to the asset identified by the AssetId string.

Parameters:
[in] guid_string the asset id string to be released
Returns:
true if the asset was successfully found and released.
virtual bool AddReference ( const AssetId assetid ) [pure virtual]

Add a reference to the asset identified by the AssetId.

Parameters:
[in] assetid asset id for which we want to add a reference
Returns:
true if the asset was successfully found and a reference added.
virtual bool AddReference ( const MCHAR *  guid_string ) [pure virtual]

Add a reference to the asset identified by the AssetId string.

Parameters:
[in] guid_string asset id string for which we want to add a reference
Returns:
true if the asset was successfully found and a reference added.
virtual MSTR AssetIdToString ( const AssetId assetId ) const [pure virtual]

Convert an AssetId object to a string.

Parameters:
[in] assetid assetid that will be converted
Returns:
the asset id converted to a string
virtual bool StringToAssetId ( const MSTR string,
AssetId assetId 
) const [pure virtual]

Try to convert an a string to an AssetId.

Parameters:
[in] string string to be converted
[out] assetid will be filled with the AssetId if the method is successful
Returns:
true if the string was successfully converted , false otherwise (if the string wasnt a valid AssetId)
virtual IOResult LoadAsset ( ILoad iload,
AssetUser assetUser 
) [pure virtual]

Load an asset from the scene file.

Parameters:
[in] iload the ILoad interface
[out] assetUser will be filled with the AssetUser if the method is successful
Returns:
IO_OK if the asset was successfully loaded , IO_ERROR otherwise
virtual void RemapLoadedAssetID ( AssetId assetId ) [pure virtual]

Remaps asset id loaded from scene file to new asset id for the asset.

The asset id in the file being loaded may conflict with an existing asset id. Therefor, immediately after loading an asset id it must be passed through this method to get the new asset id

Parameters:
[in,out] assetid asset id to remap
virtual void RegisterAssetMetaData ( const AssetId assetId,
const MSTR filename,
AssetType  type 
) [pure virtual]

Called by system while loading the 3ds Max file.

Registers asset metadata loaded from file

Parameters:
[in] assetid asset id for asset metadata
[in] name A file name which can be either a full path ("C:\bitmaps\a.bmp"), a relative path("..\bitmaps\a.bmp"), or just a filename("a.bmp").
[in] type The asset type, see AssetType.
virtual IOResult Save ( ISave isave ) [pure virtual]

Called by system to save the metadata for the active assets to the 3ds Max file.

Parameters:
[in] isave the ISave interface
virtual IOResult Load ( ILoad iload ) [pure virtual]

Called by system to load the metadata for all assets from the 3ds Max file.

Parameters:
[in] iload the ILoad interface
virtual void PreSave ( ISave isave ) [pure virtual]

Called by system before saving to the 3ds Max file.

Used to identify assets to store metadata for.

Parameters:
[in] isave the ISave interface
virtual void PreLoad ( ILoad iload ) [pure virtual]

Called by system before loading a 3ds Max file.

Preps the asset manager for loading assets from the file.

Parameters:
[in] iload the ILoad interface
virtual void PostLoad ( ILoad iload ) [pure virtual]

Called by system after loading the 3ds Max file.

Removes unused asset metadata.

Parameters:
[in] iload the ILoad interface
static AssetMgmntExport IAssetManager* GetInstance ( ) [static]

Returns the only instance of this manager.


IAssetManager IAssetManager IAssetManager IAssetManager IAssetManager IAssetManager IAssetManager IAssetManager IAssetManager IAssetManager
IAssetManager IAssetManager IAssetManager IAssetManager IAssetManager IAssetManager IAssetManager IAssetManager IAssetManager IAssetManager