This reference page is linked to from the following overview topics: Plug-in Upgrade Guide, General Best Practices, Declaring and Representing Assets, Saving and Loading Assets, Asset File Path Resolution.
#include <AssetUser.h>
Public Types |
|
enum | { asset_type } |
enum | { kGetAssetId, kGetFileName, kGetType, kCanGetFullFilePath, kGetFullFilePath } |
Public Member Functions |
|
CoreExport | AssetUser () |
Create an empty AssetUser
pointing to kInvalidId AssetId.
|
|
CoreExport | AssetUser (const AssetId &assetId) |
Create an AssetUser
pointing to assetId. |
|
CoreExport | AssetUser (const AssetUser &assetU) |
Create an AssetUser
pointing to the same asset as assetU. |
|
CoreExport AssetUser & | operator= (const AssetUser &assetU) |
This function will remove the reference to
the Asset on which this asset User points and add a reference to
the asset corresponding to the AssetUser
passed. |
|
CoreExport const AssetId & | GetId () const |
Gets the AssetId
of the asset to which this AssetUser
points. |
|
CoreExport MSTR | GetIdAsString () const |
Gets the AssetId
of the asset to which this AssetUser
points. |
|
CoreExport AssetType | GetType () const |
Gets the type of the asset to which this
AssetUser
points. |
|
CoreExport const MSTR & | GetFileName () const |
Gets the current file name of the asset to
which this AssetUser
points. |
|
CoreExport MSTR | GetFullFilePath () const |
gets an absolute UNC path of the asset file
|
|
CoreExport bool | GetFullFilePath (MaxSDK::Util::Path &filePath) const |
resolves the physical location of the asset
to which this AssetUser
points. |
|
CoreExport bool | GetFullFilePath (MSTR &filePath) const |
resolves the physical location of the asset
to which this AssetUser
points. |
|
CoreExport void | SetUsedInFileSave () |
Flags the asset as having been saved to a
max scene file. |
|
CoreExport void | Reset () |
Resets the current asset id. |
|
CoreExport IOResult | Save (ISave *isave) const |
Called for saving data. |
|
CoreExport | ~AssetUser () |
BaseInterface * | GetInterface (Interface_ID id) |
BaseInterface * | GetInterfaceAt (int i) const |
MCHAR * | GetIObjectName () |
int | NumInterfaces () const |
void | AcquireIObject () |
void | ReleaseIObject () |
void | DeleteIObject () |
LifetimeType | LifetimeControl () |
FPInterfaceDesc * | GetDescByID (Interface_ID id) |
Interface_ID | GetID () |
FPInterfaceDesc * | GetDesc () |
BEGIN_FUNCTION_MAP | FN_0 (kGetAssetId, TYPE_TSTR_BV, GetIdAsString) |
FN_0 (kGetFileName, TYPE_TSTR_BV, GetFileName) | |
FN_0 (kGetType, TYPE_ENUM, GetType) | |
FN_1 (kCanGetFullFilePath, TYPE_bool, GetFullFilePath, TYPE_TSTR_BR) | |
FN_0 (kGetFullFilePath, TYPE_TSTR_BV, GetFullFilePath) | |
Static Public Member Functions |
|
static CoreExport UINT64 | GetNumCreated () |
Gets the total number of AssetUsers created
during this 3dsmax session. |
|
static CoreExport UINT64 | GetNumAlive () |
Gets the current number of AssetUser
instances. |
|
Protected Member Functions |
|
CoreExport const MSTR & | GetResolvedAssetPath () const |
Gets the absolute path to the most recently
resolved location of the asset that this AssetUser
points to. |
|
CoreExport bool | SetResolvedAssetPath (const MSTR &resolvedPath) |
Sets the absolute path to the most recently
resolved location of the asset that this AssetUser
points to. |
|
CoreExport DWORD | GetTimePathWasResolved () const |
CoreExport void | SetTimePathWasResolved (DWORD newTime) |
Friends |
|
class | ::FileResolutionMgrImp |
anonymous enum |
anonymous enum |
CoreExport ~AssetUser | ( | ) |
This function will remove the reference to the Asset on which this asset User points and add a reference to the asset corresponding to the AssetUser passed.
CoreExport const AssetId& GetId | ( | ) | const |
CoreExport MSTR GetIdAsString | ( | ) | const |
CoreExport AssetType GetType | ( | ) | const |
Gets the type of the asset to which this AssetUser points.
CoreExport const MSTR& GetFileName | ( | ) | const |
Gets the current file name of the asset to which this AssetUser points.
CoreExport MSTR GetFullFilePath | ( | ) | const |
gets an absolute UNC path of the asset file
CoreExport bool GetFullFilePath | ( | MaxSDK::Util::Path & | filePath | ) | const |
resolves the physical location of the asset to which this AssetUser points.
gets an absolute UNC path of an asset file
[out] | filePath | : is set to an absolute UNC path if the asset file is found. If the asset file is not found it is left unchanged. |
CoreExport bool GetFullFilePath | ( | MSTR & | filePath | ) | const |
resolves the physical location of the asset to which this AssetUser points.
gets an absolute UNC path of an asset file
[out] | filePath | : is set to an absolute UNC path if the asset file is found. If the asset file is not found it is left unchanged. |
CoreExport void SetUsedInFileSave | ( | ) |
Flags the asset as having been saved to a max scene file.
This method is called if the AsssetId of the asset is stored to the max scene file (typically as a string) rather than the Save method being called on this AssetUser. This tells the Asset Manager that the metadata for the asset must be saved to the scene file (asset metadata is saved only for those assets actually written to the scene file. Note: If you save the AssetId instead of the AssetUser, on scene load you must pass the AssetId read through IAssetManager::RemapLoadedAssetID before getting an AssetUser using the AssetId
CoreExport void Reset | ( | ) |
Resets the current asset id.
Remove the reference to the asset held by this AssetUser and sets the internal value to kInvalidId.
Called for saving data.
Called to allow the asset to save its data.
isave | - The ISave interface. |
static CoreExport UINT64 GetNumCreated | ( | ) | [static] |
Gets the total number of AssetUsers created during this 3dsmax session.
static CoreExport UINT64 GetNumAlive | ( | ) | [static] |
Gets the current number of AssetUser instances.
BaseInterface* GetInterface | ( | Interface_ID | id | ) | [virtual] |
Reimplemented from FPMixinInterface.
BaseInterface* GetInterfaceAt | ( | int | i | ) | const [virtual] |
Reimplemented from BaseInterfaceServer.
MCHAR* GetIObjectName | ( | ) | [inline, virtual] |
Reimplemented from IObject.
{ return _M("AssetUser");}
int NumInterfaces | ( | ) | const [virtual] |
Reimplemented from BaseInterfaceServer.
void AcquireIObject | ( | ) | [virtual] |
void ReleaseIObject | ( | ) | [virtual] |
void DeleteIObject | ( | ) | [virtual] |
LifetimeType LifetimeControl | ( | ) | [inline, virtual] |
Reimplemented from FPMixinInterface.
{ return wantsRelease; }
FPInterfaceDesc* GetDescByID | ( | Interface_ID | id | ) | [virtual] |
Reimplemented from FPMixinInterface.
Interface_ID GetID | ( | ) | [inline, virtual] |
Reimplemented from FPMixinInterface.
{ return IID_IASSET_USER; }
FPInterfaceDesc* GetDesc | ( | ) | [inline, virtual] |
Implements FPInterface.
{ return GetDescByID(IID_IASSET_USER); }
BEGIN_FUNCTION_MAP FN_0 | ( | kGetAssetId | , |
TYPE_TSTR_BV | , | ||
GetIdAsString | |||
) |
FN_0 | ( | kGetFileName | , |
TYPE_TSTR_BV | , | ||
GetFileName | |||
) |
FN_0 | ( | kGetType | , |
TYPE_ENUM | , | ||
GetType | |||
) |
FN_1 | ( | kCanGetFullFilePath | , |
TYPE_bool | , | ||
GetFullFilePath | , | ||
TYPE_TSTR_BR | |||
) |
FN_0 | ( | kGetFullFilePath | , |
TYPE_TSTR_BV | , | ||
GetFullFilePath | |||
) |
CoreExport const MSTR& GetResolvedAssetPath | ( | ) | const [protected] |
Gets the absolute path to the most recently resolved location of the asset that this AssetUser points to.
This function returns an empty string if the asset's location has not yet been resolved by the file resolution manager.
CoreExport bool SetResolvedAssetPath | ( | const MSTR & | resolvedPath | ) | [protected] |
Sets the absolute path to the most recently resolved location of the asset that this AssetUser points to.
This function only accepts an absolute path or an empty string. This function is usually invoked by the file resolution manager after it attempts to resolve an asset's location. If the file resolution manager fails to resolve the physical location of an asset file, 'resolvedPath' is an empty string (i.e. resolvedPath equals "")
param[in] resolvedPath the most recent resolved path of the asset file
CoreExport DWORD GetTimePathWasResolved | ( | ) | const [protected] |
CoreExport void SetTimePathWasResolved | ( | DWORD | newTime | ) | [protected] |
friend class ::FileResolutionMgrImp
[friend] |