Public Member Functions

ILockedContainerUpdate Class Reference

This reference page is linked to from the following overview topics: SDK Change Details.


Search for all occurrences

Detailed 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\.

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

#include <ILockedContainerUpdate.h>

Inheritance diagram for ILockedContainerUpdate:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual  ~ILockedContainerUpdate ()
  Deconstructor.
virtual Interface_ID  GetID ()
  Return the Interface_ID.
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.
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.

Constructor & Destructor Documentation

virtual ~ILockedContainerUpdate ( ) [inline, virtual]

Deconstructor.

{};

Member Function Documentation

virtual Interface_ID GetID ( ) [inline, virtual]

Return the Interface_ID.

Returns:
The default implementation returns IID_LOCKED_CONTAINER_UPDATE

Reimplemented from BaseInterface.

{ return IID_LOCKED_CONTAINER_UPDATE; }
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] sourceNode The 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] sourceanim The 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] masterNode The 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] masterAnim The Animatable that will get replaced.
[in] man An 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] log A 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] sourceNode The 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] sourceanim The 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] masterNode The 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] man An 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] log A 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.

ILockedContainerUpdate ILockedContainerUpdate ILockedContainerUpdate ILockedContainerUpdate ILockedContainerUpdate ILockedContainerUpdate ILockedContainerUpdate ILockedContainerUpdate ILockedContainerUpdate ILockedContainerUpdate
ILockedContainerUpdate ILockedContainerUpdate ILockedContainerUpdate ILockedContainerUpdate ILockedContainerUpdate ILockedContainerUpdate ILockedContainerUpdate ILockedContainerUpdate ILockedContainerUpdate ILockedContainerUpdate