3ds Max C++ API Reference
IEnumAuxAssetsCallback Class Referenceabstract

An extension of AssetEnumCallback that exposes an interface for providing more detailed information about an asset. More...

#include <IAssetAccessor.h>

+ Inheritance diagram for IEnumAuxAssetsCallback:

Public Member Functions

virtual void DeclareAsset (IAssetAccessor &anAccessor)=0
 Allows a client to implement and return an asset accessor object. More...
 
virtual void DeclareGroup (IAssetAccessor &anAccessor)=0
 Allows a client to declare a new asset sub-group. More...
 
virtual void EndGroup ()=0
 Used to end the declaration of a sub-group of assets. More...
 
- Public Member Functions inherited from AssetEnumCallback
virtual ~AssetEnumCallback ()
 
virtual void RecordAsset (const MaxSDK::AssetManagement::AssetUser &asset)=0
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary. More...
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary. More...
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More...
 

Detailed Description

An extension of AssetEnumCallback that exposes an interface for providing more detailed information about an asset.

An extension of AssetEnumCallback that allows an application component to declare more information about an asset, and to provide a callback method for retargeting that asset. A client wishing to expose more asset information should follow the following code example:

class PointCacheAssetAccessor : public IAssetAccessor {
public:
PointCacheAssetAccessor(PointCacheBase* aPointCache);
// path accessor functions
virtual MaxSDK::AssetManagement::AssetUser GetAsset() const ;
virtual bool SetPath(const MaxSDK::AssetManagement::AssetUser& aNewAsset) ;
// asset client information
virtual int GetAssetType() const ;
protected:
PointCacheBase* mPointCache;
};
PointCacheAssetAccessor::PointCacheAssetAccessor(PointCacheBase* aPointCache) :
mPointCache(aPointCache)
{
}
MaxSDK::AssetManagement::AssetUser PointCacheAssetAccessor::GetAsset() const {
return mPointCache->pblock->GetAssetUser(pb_cache_file);
;
}
bool PointCacheAssetAccessor::SetAsset(const MaxSDK::AssetManagement::AssetUser& aNewAsset) {
mPointCache->pblock->SetValue(pb_cache_file, 0, aNewAsset);
}
int PointCacheAssetAccessor::GetAssetType() const {
}
void PointCacheBase::EnumAuxFiles(AssetEnumCallback& nameEnum, DWORD flags)
{
if ((flags&FILE_ENUM_CHECK_AWORK1)&&TestAFlag(A_WORK1)) return; // LAM - 4/11/03
PointCacheAssetAccessor accessor(this);
if(accessor.GetAsset().GetId()!=MaxSDK::AssetManagement::kInvalidId) {
IEnumAuxAssetsCallback* callback = static_cast<IEnumAuxAssetsCallback*>(&nameEnum);
callback->DeclareAsset(accessor);
}
}
else {
// do normal enum business
}
}
Definition: AssetEnumCallback.h:31
A callback interface for declaring and modifying an asset reference.
Definition: IAssetAccessor.h:120
An extension of AssetEnumCallback that exposes an interface for providing more detailed information a...
Definition: IAssetAccessor.h:299
virtual void DeclareAsset(IAssetAccessor &anAccessor)=0
Allows a client to implement and return an asset accessor object.
Definition: AssetUser.h:37
#define A_WORK1
Definition: AnimatableFlags.h:221
#define FILE_ENUM_ACCESSOR_INTERFACE
The callback object passed through is an IEnumAuxAssetsCallback derived object.
Definition: FileEnumConstants.h:53
#define FILE_ENUM_CHECK_AWORK1
Do not enumerate things with flag A_WORK1 set.
Definition: FileEnumConstants.h:43
@ kAnimationAsset
Any animation file.
Definition: AssetType.h:28
static AssetId kInvalidId
Definition: AssetId.h:32
If the FILE_ENUM_ACCESSOR_INTERFACE is passed to the EnumAuxFiles, then it
is safe to cast the AssetEnumCallback object to the IEnumAuxAssetsCallback interface.
From there, an asset can declare it's own asset interface, as shown in the above
example.  This example is taken from the <b>maxsdk\\samples\\modifiers\\pointcache</b> sample
plugin project.

Member Function Documentation

◆ DeclareAsset()

virtual void DeclareAsset ( IAssetAccessor anAccessor)
pure virtual

Allows a client to implement and return an asset accessor object.

An application component wishing to declare an asset should implement the IAssetAccessor interface and return an instance of that implementation via this method. It is important to note that a link to this interface is not kept by the IEnumAuxAssetsCallback object receiving the interface. The interface need only be valid for the length of the DeclareAsset method call. This allows a component to pass in a stack object that will be destroyed at the end of the scope containing this method call.
See class description for a code sample.

Parameters
[in]anAccessorAn asset accessor object.

◆ DeclareGroup()

virtual void DeclareGroup ( IAssetAccessor anAccessor)
pure virtual

Allows a client to declare a new asset sub-group.

Allows a client to declare a new asset subgroup. An example of a sub-group would be an xref file that has its own assets. This method declares that we are now enumerating a sub-group of assets, meaning that declared assets will be added to this group. It is possible to nest groups further by making repeated calls to this function. To end the declaration of a group, call EndGroup().

Precondition
The asset accessor should not return NULL for a newly declared group. It is the onus of the asset client to check that IAssetAccessor::GetPath returns a non-null value. If null is returned, neither DeclareGroup nor EndGroup should be called.
Parameters
[in]anAccessorAn asset accessor describing the asset which holds a a sub-group of assets.

◆ EndGroup()

virtual void EndGroup ( )
pure virtual

Used to end the declaration of a sub-group of assets.

Called when a client is done declaring a sub-group of assets. See DeclareGroup(IAssetAccessor&) for details.