Public Member Functions | Static Public Member Functions

IContainerObject Class Reference

This reference page is linked to from the following overview topics: Containers, Container Manager and Container Objects, Working with Containers.


Search for all occurrences

Detailed Description

Container Interface.

IContainer provides access to the container object functionality.

A container is a helper object in the scene. Once created, the user can choose its content, that is, nodes that are meant to be grouped together. Containers should be self-contained blocks without references from the content to nodes outside of the container, otherwise the references will be lost during operation of the container. Containers hold the content, and moving or deleting a container will affect the content, but containers and content are not the same thing. For example, content can be unloaded, while the container remains in the scene. The container is associated to a container definition file, which is a Max file that stores only the container and its contents. Container definitions are tracked as file assets.

There are two types of containers:

  1. Local Containers: Containers can be created locally and used to organize scenes in ways that are similar to the uses of groups or layers. This provides a way to collect a bunch of nodes and work with them as one, or to section part of your scene to share with others. If a local container has no content that is inherited from any source (including nested containers, that is, containers inside containers), we can call it a unique container. If content is inherited at all, it is not a Unique container.
  1. Inherited Containers: Containers can also be inherited. When you inherit a container from someone else, you get its contents. If the author allows, you can open the container and add changes, while still inheriting the author's changes. This allows teams to work collaboratively.

Content nodes of containers are all children of the container. It is possible to have objects linked to containers or contents of containers without being inside, but this is not recommended. It is not possible to instance containers, but they can be copied, and then changes to one of the copies can be saved, and all containers can be reloaded, and all copies will inherit the changes. Many containers can point to the same definition.

In addition to the content, containers also govern what users of a container are allowed to do with the content if they inherit the container. This is called the container rules. At the moment, the only options are either no access (the user can only read in the content but make no modification) or edit in-place, which allows someone inheriting the container to modify the content and save the result, overwriting the original definition.

Containers can be closed, making the content uneditable. When a container is closed the content behaves like an xreffed scene, displayed and rendered but not selectable or editable.

#include <IContainerObject.h>

Inheritance diagram for IContainerObject:
Inheritance graph
[legend]

List of all members.

Public Member Functions

FPInterfaceDesc GetDesc ()
virtual INode GetContainerNode () const =0
  Returns the node containing this container object.
Content queries and modifications
virtual void  GetContentNodes (bool nestedContainerNodes, INodeTab &contentNodes) const =0
  Returns the content nodes for this container.
virtual bool  IsNodeInContent (INode *in_node, bool nestedContainerNodes) const =0
  Checks for content membership.
virtual bool  IsNodeInInheritedContent (INode *in_node, bool nestedContainerNodes) const =0
  Checks for inherited content membership.
virtual bool  AddNodeToContent (INode *in_node)=0
  Adds a node and its children to the container.
virtual bool  AddNodesToContent (INodeTab &in_nodeTab)=0
  Adds several nodes to the container.
virtual bool  RemoveNodeFromContent (INode *in_node, bool detach=true)=0
  Removes a node from the container.
Definition files.

Definition files have the format of a max file, but use a different file extension: .MAXC.

This is to allow users to distinguish container definitions from regular max scenes when browsing folders, and prevent mistaken edits of container definitions. It is possible to rename the container definition and open it as a MAX file. Local containers use a local definition file. Inherited containers reference a source definition file.

virtual
MaxSDK::AssetManagement::AssetUser 
GetLocalDefinitionFileName () const =0
  Gets the local definition file for the container.
virtual bool  SetLocalDefinitionFileName (const MaxSDK::AssetManagement::AssetUser &val)=0
  Sets the local definition file for the container.
virtual
MaxSDK::AssetManagement::AssetUser 
GetSourceDefinitionFileName () const =0
  Gets the source definition file for the container.
virtual bool  SetSourceDefinitionFileName (const MaxSDK::AssetManagement::AssetUser &val)=0
  Sets the source definition file for the container.
Definition file operations and content management
virtual bool  SaveContainer (bool newFileName=false)=0
  Saves the current content and rules as the new definition.
virtual bool  UpdateContainer ()=0
  Updates the content from its definition, preserving local modifications.
virtual bool  UnloadContainer ()=0
  Saves the local definition and deletes the content from the scene.
virtual bool  LoadContainer ()=0
  Reloads content from its definition and local modifications. Only available when unloaded.
virtual bool  ReloadContainer ()=0
  Reloads content from its definition and local modifications.
virtual bool  MergeSource ()=0
  Turns an inherited container into an unsaved local container, merging its content into the scene.
virtual bool  MakeUnique ()=0
  Merges a container source, and recursively merges any nested container among its content.
Container status and rules.
virtual bool  IsInherited () const =0
  Returns whether the container is inherited (or local)
virtual bool  IsOpen () const =0
  Returns whether the container is open.
virtual bool  SetOpen (bool isOpen)=0
  Opens or closes the container.
virtual bool  IsContainerOpenableOrClosable () const =0
  Returns whether the open status of the container can be changed in its current state.
virtual bool  IsUnloaded () const =0
  Returns whether the container is unloaded, that is, whether its content has been temporarily deleted.
virtual bool  IsUnique () const =0
  Returns whether the container is unique, that is, whether it is local as well as any container it may contain.
virtual void  AllowInPlaceEdit (bool allowEdit)=0
  Sets whether the container, when inherited, will allow editing in place.
virtual bool  GetAllowInPlaceEdit () const =0
  Returns whether the container, when inherited, will allow editing in place.
virtual void  SetEditInPlace (bool edit)=0
  Temporarily makes an inherited container that allows it to act like a local container.
virtual bool  IsInPlaceEditing () const =0
  Returns whether the container is currently editing in place.
virtual bool  CanEditInPlace () const =0
  For an imported container, returns whether it allows editing in place.
virtual void  SetAutoUpdateClosed (bool setAutoUpdate)=0
  Sets whether the container will automatically update if it is closed and its definition is updated.
virtual bool  AutoUpdateClosed () const =0
  Returns whether the container will automatically update if it is closed and its definition is updated.
Display properties of the container helper.
virtual void  SetLabelDisplay (bool display)=0
  Sets whether the container displays its name in the viewport.
virtual bool  GetLabelDisplay () const =0
  Returns whether the container displays its name in the viewport.
virtual void  UseContentBoundingBox (bool useContent)=0
  Sets whether the bounding box for the container object will be extended to encompass all of its content.
virtual bool  IsUsingContentBoundingBox () const =0
  Returns whether the bounding box for the container object will be extended to encompass all of its content.
virtual void  SetOverrideNodeProperties (bool setOverride)=0
  Sets whether the container overrides the object properties (wire color, hidden status etc) of its content.
virtual bool  OverrideNodeProperties () const =0
  Returns whether the container overrides the object properties (wire color, hidden status etc) of its content.
virtual void  SetSize (float size, TimeValue t=0)=0
  Sets the size of the container helper object.
virtual float  GetSize (TimeValue t=0) const =0
  Returns the size of the container helper.

Static Public Member Functions

static IContainerObject GetInterface (Animatable *anim)
  If the Animatable supports the IContainerObject interface, returns a pointer to it.

Member Function Documentation

FPInterfaceDesc* GetDesc ( ) [virtual]
Remarks:
Returns a pointer to the class which contains the interface metadata.

Implements FPInterface.

virtual INode* GetContainerNode ( ) const [pure virtual]

Returns the node containing this container object.

Remarks:
There can only be one node since we cannot create instances of container objects
virtual void GetContentNodes ( bool  nestedContainerNodes,
INodeTab contentNodes 
) const [pure virtual]

Returns the content nodes for this container.

Parameters:
[in] nestedContainerNodes - if true include nested content
[out] contentNodes - returned content nodes
virtual bool IsNodeInContent ( INode in_node,
bool  nestedContainerNodes 
) const [pure virtual]

Checks for content membership.

Returns:
- true if the node is part of the content.
Parameters:
[in] in_node - node to check for membership
[in] nestedContainerNodes - include nested containers child nodes when checking
virtual bool IsNodeInInheritedContent ( INode in_node,
bool  nestedContainerNodes 
) const [pure virtual]

Checks for inherited content membership.

Returns:
- true if the node is part of the inherited content.
Parameters:
[in] nestedContainerNodes - check content of nested containers
virtual bool AddNodeToContent ( INode in_node ) [pure virtual]

Adds a node and its children to the container.

The container node becomes the parent of the content node. Some nodes are automatically added to the local content along with the input node. The children of the node are added. If the node is part of a system [like biped or bones], all nodes in the system are also added. If the node has a target [as in INode::GetTarget() - for instance a camera target], then its target is added and if it is a target, the targeting node is also added

See also:
RemoveNodeFromContent
Returns:
- true if the node was added.
Parameters:
[in] in_node - node to add to the container
virtual bool AddNodesToContent ( INodeTab in_nodeTab ) [pure virtual]

Adds several nodes to the container.

See also:
AddNodeToContent
Returns:
- true if all nodes were added.
Parameters:
[in] in_nodeTab - array of nodes to add to the container
virtual bool RemoveNodeFromContent ( INode in_node,
bool  detach = true 
) [pure virtual]

Removes a node from the container.

Some nodes are automatically removed along with the input node. The children of the node are removed. If the node is part of a system, all nodes in the system are also removed. If the node has a target, its target is removed and if it is a target, the targeting node is also removed

See also:
AddNodeToContent
Returns:
- true if the node was removed from local content.
Parameters:
[in] in_node - node to remove from the container
[in] detach - whether or not the removed node should also be unlinked from its parent
virtual MaxSDK::AssetManagement::AssetUser GetLocalDefinitionFileName ( ) const [pure virtual]

Gets the local definition file for the container.

If the container is inherited, the name is empty

virtual bool SetLocalDefinitionFileName ( const MaxSDK::AssetManagement::AssetUser val ) [pure virtual]

Sets the local definition file for the container.

virtual MaxSDK::AssetManagement::AssetUser GetSourceDefinitionFileName ( ) const [pure virtual]

Gets the source definition file for the container.

If the container is local, the name is empty

virtual bool SetSourceDefinitionFileName ( const MaxSDK::AssetManagement::AssetUser val ) [pure virtual]

Sets the source definition file for the container.

virtual bool SaveContainer ( bool  newFileName = false ) [pure virtual]

Saves the current content and rules as the new definition.

If there is no definition file name, the user will be prompted for one.

Parameters:
[in] newFileName - if true, prompt the user for a definition file name
virtual bool UpdateContainer ( ) [pure virtual]

Updates the content from its definition, preserving local modifications.

virtual bool UnloadContainer ( ) [pure virtual]

Saves the local definition and deletes the content from the scene.

virtual bool LoadContainer ( ) [pure virtual]

Reloads content from its definition and local modifications. Only available when unloaded.

virtual bool ReloadContainer ( ) [pure virtual]

Reloads content from its definition and local modifications.

Same as load but is always available. Discards unsaved local changes.

virtual bool MergeSource ( ) [pure virtual]

Turns an inherited container into an unsaved local container, merging its content into the scene.

virtual bool MakeUnique ( ) [pure virtual]

Merges a container source, and recursively merges any nested container among its content.

virtual bool IsInherited ( ) const [pure virtual]

Returns whether the container is inherited (or local)

virtual bool IsOpen ( ) const [pure virtual]

Returns whether the container is open.

virtual bool SetOpen ( bool  isOpen ) [pure virtual]

Opens or closes the container.

Depending on the container state, this may not be allowed

Returns:
- the open state of the container after the operation.
virtual bool IsContainerOpenableOrClosable ( ) const [pure virtual]

Returns whether the open status of the container can be changed in its current state.

virtual bool IsUnloaded ( ) const [pure virtual]

Returns whether the container is unloaded, that is, whether its content has been temporarily deleted.

virtual bool IsUnique ( ) const [pure virtual]

Returns whether the container is unique, that is, whether it is local as well as any container it may contain.

virtual void AllowInPlaceEdit ( bool  allowEdit ) [pure virtual]

Sets whether the container, when inherited, will allow editing in place.

Editing in place is a container rule that allows a user to temporarily turn an inherited container into a local container and change its definition. You can now set more rules than just edit in place.

See also:
IContainerObject13::SetAccessType
Parameters:
[in] allowEdit - whether the container, when inherited, will allow editing in place
virtual bool GetAllowInPlaceEdit ( ) const [pure virtual]

Returns whether the container, when inherited, will allow editing in place.

virtual void SetEditInPlace ( bool  edit ) [pure virtual]

Temporarily makes an inherited container that allows it to act like a local container.

virtual bool IsInPlaceEditing ( ) const [pure virtual]

Returns whether the container is currently editing in place.

virtual bool CanEditInPlace ( ) const [pure virtual]

For an imported container, returns whether it allows editing in place.

virtual void SetAutoUpdateClosed ( bool  setAutoUpdate ) [pure virtual]

Sets whether the container will automatically update if it is closed and its definition is updated.

Otherwise a manual Update or Reload is needed.

virtual bool AutoUpdateClosed ( ) const [pure virtual]

Returns whether the container will automatically update if it is closed and its definition is updated.

virtual void SetLabelDisplay ( bool  display ) [pure virtual]

Sets whether the container displays its name in the viewport.

virtual bool GetLabelDisplay ( ) const [pure virtual]

Returns whether the container displays its name in the viewport.

virtual void UseContentBoundingBox ( bool  useContent ) [pure virtual]

Sets whether the bounding box for the container object will be extended to encompass all of its content.

virtual bool IsUsingContentBoundingBox ( ) const [pure virtual]

Returns whether the bounding box for the container object will be extended to encompass all of its content.

virtual void SetOverrideNodeProperties ( bool  setOverride ) [pure virtual]

Sets whether the container overrides the object properties (wire color, hidden status etc) of its content.

virtual bool OverrideNodeProperties ( ) const [pure virtual]

Returns whether the container overrides the object properties (wire color, hidden status etc) of its content.

virtual void SetSize ( float  size,
TimeValue  t = 0 
) [pure virtual]

Sets the size of the container helper object.

virtual float GetSize ( TimeValue  t = 0 ) const [pure virtual]

Returns the size of the container helper.

static IContainerObject* GetInterface ( Animatable anim ) [inline, static]

If the Animatable supports the IContainerObject interface, returns a pointer to it.

Parameters:
[in] anim - Animatable to be tested for support of the IContainer interface
Returns:
- a pointer to an IContainer interface, or NULL.

Reimplemented in IContainerObject13.

                                                                   { 
        return anim? static_cast<IContainerObject*>(anim->GetInterface(IID_CONTAINER)): NULL;}

IContainerObject IContainerObject IContainerObject IContainerObject IContainerObject IContainerObject IContainerObject IContainerObject IContainerObject IContainerObject
IContainerObject IContainerObject IContainerObject IContainerObject IContainerObject IContainerObject IContainerObject IContainerObject IContainerObject IContainerObject