ILockedContainerUpdate Class Reference

ILockedContainerUpdate Class Referenceabstract

#include <ILockedContainerUpdate.h>

Class Description

This class provides an interface for classes that may need to augment the new container update process that was introduced in 3ds Max 2011.

During this update process, locked items from the source are merged into the master file and replace their corresponding locked counterpart in the master if one exists. This process is automatic but sometimes the item in question needs to augment this process since some information may get lost during this merge and copy process. Note there may be some other cases where the source item is merged in, for example unlocked modifiers may get copied in from the source if that modifier doesn't exist in the master. An example of a class that needs to implement this is the skin modifier. When a skin modifier is put onto the modifier stack on some node, any existing weight information on the specific vertices are automatically lost, since they are stored in the local mod data for modifier instance, even though that skin modifier has the correct nodes in its node list, which is the case during the container update process. So what the skin modifier needs to do is provide an implementation of ILockedContainerUpdate interface. In the ILockedContainerUpdate::PreReplacement function it copies and saves out it's weight information, and then in the ILockedContainerUpdate::PostReplacement function it pastes these weights back onto itself, since this function is called after the replacement has happened. You can see this example at maxsdk\samples\bondesdef.

Note that the container update process does handle the transferring of node references during the process, that's why the skin modifier doesn't need to worry about having the correct nodes it's node list. However external non-node references aren't automatically handled so an item has one and this reference isn't locked, it will need to make sure that the correct one is found and the reference replaced. For example we do this internally with our wire parameters, if the object that's controlling the wire isn't locked we make sure that this existing master item replaces the merged item that's coming in from the source.

See also
ILockedTracksMan
+ Inheritance diagram for ILockedContainerUpdate:

Public Member Functions

virtual ~ILockedContainerUpdate ()
 Deconstructor. More...
 
virtual Interface_ID GetID ()
 Return the Interface_ID. More...
 
virtual bool PreReplacement (INode *sourceNode, Animatable *sourceAnim, INode *masterNode, Animatable *masterAnim, IContainerUpdateReplacedNode *man, MSTR &log)=0
 Function that's called before the source item replaces the master item during a container update. More...
 
virtual bool PostReplacement (INode *sourceNode, Animatable *sourceAnim, INode *masterNode, IContainerUpdateReplacedNode *man, MSTR &log)=0
 Function that's called after the source item replaces the master item during a container update. More...
 
- Public Member Functions inherited from BaseInterface
virtual UtilExport ~BaseInterface ()
 Destructor. More...
 
UtilExport BaseInterfaceGetInterface (Interface_ID id)
 
virtual LifetimeType LifetimeControl ()
 
virtual bool RegisterNotifyCallback (InterfaceNotifyCallback *incb)
 
virtual void UnRegisterNotifyCallback (InterfaceNotifyCallback *incb)
 
virtual BaseInterfaceAcquireInterface ()
 
virtual void ReleaseInterface ()
 
virtual void DeleteInterface ()
 
virtual BaseInterfaceCloneInterface (void *remapDir=NULL)
 
- Public Member Functions inherited from InterfaceServer
virtual UtilExport ~InterfaceServer ()
 Destructor. More...
 

Additional Inherited Members

- Public Types inherited from BaseInterface
enum  LifetimeType { noRelease, immediateRelease, wantsRelease, serverControlled }
 
- 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...
 

Constructor & Destructor Documentation

virtual ~ILockedContainerUpdate ( )
inlinevirtual

Deconstructor.

42 {};

Member Function Documentation

virtual Interface_ID GetID ( )
inlinevirtual

Return the Interface_ID.

Returns
The default implementation returns IID_LOCKED_CONTAINER_UPDATE

Reimplemented from BaseInterface.

#define IID_LOCKED_CONTAINER_UPDATE
The interface ID for an object that implements ILockedContainerUpdate The id that's passed into BaseI...
Definition: ILockedContainerUpdate.h:15
virtual bool PreReplacement ( INode sourceNode,
Animatable sourceAnim,
INode masterNode,
Animatable masterAnim,
IContainerUpdateReplacedNode man,
MSTR log 
)
pure virtual

Function that's called before the source item replaces the master item during a container update.

Parameters
[in]sourceNodeThe merged node from the source, that may be needed to find a modifier's ModContext, etc.. Note that the sourceNode doesn't replace the masterNode, only the sourceAnim replaces the masterAnim on the masterNode.
[in]sourceAnimThe merged Animatable from the source that replaces the masterAnim parameter. Note that this value may be the same as the object that implements this function.
[in]masterNodeThe masterNode that the masterAnim exists under. It may be needed to find a modifier's ModContext, etc.. Note that the sourceNode doesn't replace the masterNode, only the sourceAnim replaces the masterAnim on the masterNode.
[in]masterAnimThe Animatable that will get replaced.
[in]manAn IContainerUpdateReplacedNode interface that lets you query for a node currently in the scene what node, if any, will be replacing it after the update process. As noted the references to these nodes are automatically transferred but it still may be useful to the client to know exactly what's getting replaced, in case for some reason they aren't using reference to keep track of a node.
[in,out]logA string to place any pertinent error messages that the container update system may output as an error log during the update process.
Returns
Returns true if the function succeeds, false otherwise.
virtual bool PostReplacement ( INode sourceNode,
Animatable sourceAnim,
INode masterNode,
IContainerUpdateReplacedNode man,
MSTR log 
)
pure virtual

Function that's called after the source item replaces the master item during a container update.

Parameters
[in]sourceNodeThe merged node from the source, that may be needed to find a modifier's ModContext, etc.. Note that the sourceNode doesn't replace the masterNode, only the sourceAnim replaces the masterAnim on the masterNode.
[in]sourceAnimThe merged Animatable from the source that replaces the masterAnim parameter. Note that this value may be the same as the object that implements this function.
[in]masterNodeThe masterNode that the master anim exists under. It may be needed to find a modifier's ModContext, etc.. Note that the sourceNode doesn't replace the masterNode.
[in]manAn IContainerUpdateReplacedNode interface that lets you query for a node currently in the scene what node, if any, will be replacing it after the update process. As noted the references to these nodes are automatically transferred but it still may be useful to the client to know exactly what's getting replaced, in case for some reason they aren't using reference to keep track of a node.
[in,out]logA string to place any pertinent error messages that the container update system may output as an error log during the update process.
Returns
Returns true if the function succeeds, false otherwise.