MAXScript Language Reference > 3ds Max Objects > Node : MAXWrapper > Node Subclasses > Helper : Node > Helper - Standard >

# Container : Helper

    Container - superclass: helper; super-superclass:node - 10:0 - classID: #(1848947859, -473657791)

Value > MAXWrapper > Node > Helper > Container

| Helpers - Quick Navigation

In 3ds Max 2010 and higher, a Container is a helper object in the scene that can be used to group self-contained content together, manage, publish and inherit the content including the ability to unload the content objects from memory.

See Containers and Interface: Containers for more information.

Constructors:

    Container ... ContainerHelper ...

See also Containers.CreateContainer() in Interface: Containers.

## Local Content (Left) and Inherited Content (Right) - Quick Navigation

Properties:

## Manage Container Properties

    <Container>.unloaded BooleanClass default: false -- boolean;

Get/set the unloaded state of the container.

Whenset to true , the containerwill beunloadedby saving the content to disk and removing it from the scene.

When set to false , the container will be loaded by loading the content from disk and showing it in the scene.

See also UnloadContainer and LoadContainerMethods for related methods.

    <Container>.autoUpdateClosed BooleanClass default: false -- boolean; AutoUpdate_when_Closed

Get/set whether to update the content automatically when the container is closed.

Corresponds to the "Auto Update when Closed" checkbox in the Container's UI.

## Local Content Properties

    <Container>.localDefinitionFilenameString default: "" -- filename; Local_Definition_Filename

Get/set the "Local Definition" file name.

Definition files have the format of a 3ds Max scene file, but use a different .MAXC file extension. This is to allow users to distinguish container definitions from regular max scenes when browsing folders and prevent accidental 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 .If the container is inherited, the name is empty.

## Inherited Content Properties

    <Container>.sourceDefinitionFilename String default: "" -- filename; Source_Definition_Filename

Get/set the "Source Definition" filename.If the container is local, the name is empty.

Definition files have the format of a 3ds Max scene file, but use a different .MAXC file extension. This is to allow users to distinguish container definitions from regular max scenes when browsing folders and prevent accidental edits of container definitions. It is possible to rename the container definition and open it as a .MAX file.

Inherited containers reference a source definition file.

Local containers use a local definition file.

## Proxies Properties

    <Container>.alternateDefinitionFilename ArrayParameter default: #() -- filename array; Alternate_Definition_Filename; SubAnim

Get/set the alternate (Proxy) definition filenames list.

Available in 3ds Max 2011 and higher.

    <Container>.currentAlternateDefinition Integer default: 0 -- integer; Current_Alternate_Definition

Get/set the index of the current Proxy definition used from the file list.

Available in 3ds Max 2011 and higher.

    <Container>.proxyType Name default: #none -- enum

Get/set the state of the radio button controlling the use of Proxies.

Possible values are:

#none- Do not use a Proxy file.

#alternate- Use the Proxy file specified by the previous two properties.

Available in 3ds Max 2011 and higher.

## Content RulesProperties

The content rules are stored with the .MAXC asset file and control how the content will behave when inherited by a container.

    <Container>.allowInPlaceEditing BooleanClass default: false -- boolean; Allow_In_Place_Editing

Get/set theIn Place Editing Container Rule.

Corresponds to thestate of the "Allow In-Place Editing" checkboxin the Container's UI.

When set to false (default), the content can be inherited but not edited in place.

When set to true , the content can be inherited and edited in place, resulting in the overwriting of the original asset file content.

    <Container>.accessContent BooleanClass default: false -- boolean; Allow_Content_Access

Get/setthestate of theAccess Content Rule.

This Rule isnot exposed to the User Interface and is considered only when .AllowInPlaceEditing is set to false . When In Place Editing is allowed, the contentof a closed containerwill not be accessibleregardless of this Rule.

When set to false (default), the content will not be accessible when inherited. The content cannot be selected, modified or accessed via MAXScript.

When set to true , thecontentwill be accessible when inherited.Any local modifications to such content will be LOST when Unloaded!

    <Container>.accessPublishedContent BooleanClass default: false -- boolean; Allow_Published_Content_Access

Get/set the state of the Access Published Content Rule.

This Rule is not exposed to the User Interface.

## Display- ContainerProperties

    <Container>.displayLabel BooleanClass default: false -- boolean; Display_Label

Get/set the state of theName checkbox. (called "Label" in 3ds Max 2010).

When set to true , a text label will be displayed next to the Container to show its Name.

    <Container>.displayStatus BooleanClass default: false -- boolean; Display_Status

Enable/disablethe display of the Container's Status.

Available in 3ds Max 2011 and higher.

    <Container>.editingUser String default: "" -- string; Editing_User;

Get/set the name of the user editing the Container.

Available in 3ds Max 2011 and higher.

    <Container>.contentBoundingBox BooleanClass default: false -- boolean; Content_Bounding_Box

Get/set the state of the Expand Bounding Box checkbox.

When set to true , a bounding box of the container will expand to enclose the content.

    <Container>.size Float default: 10.0 -- animatable; worldUnits

Get/set the Size value controlling the size of the Container's icon.

    <Container>.updateNeeded BooleanClass default: false -- boolean; Update_Needed

Contains true if the Container needs an update. Reflects the state of the icon next to the Update button.

Read-only.

Available in 3ds Max 2011 and higher.

## Display -ContentsProperties

    <Container>.overrideNodeProperties BooleanClass default: false -- boolean; Override_Object_Properties

Get/set the state of the "Override Obj Properties" checkbutton.

When set to true , the content will display using the Container's display properties including wireframe color, visibility settings etc. If the content is set to use properties By Layer, the Container's Layer will be used instead of the content's Layers.

When set to false , the content will display using its own display properties.

## Container interfaces:

    Interface:IContainerObject

Properties:

    .proxyType: enum : Read|Write
    proxyType enums: {#none|#alternate}

Get/set the state of the radio button controlling the use of Proxies.

Possible values are:

#none- Do not use a Proxy file.

#alternate- Use the Proxy file specified by the previous two properties.

Available in 3ds Max 2011 and higher.

Methods:

### Manage ContainerMethods

    <bool><Container>.LoadContainer()

Loads theContainer's content from its definition and local modifications.Only available when unloaded.

Corresponds to pressing the "Load" button in the Container's UI when the Container is in Unloaded state(see .unloaded property for querying this state). The button will change to "Unload".

Returns true on success, false otherwise.

    <bool><Container>.UnloadContainer()

Unloads theContainerby saving the local definition and deleting the content from the scene.

Corresponds to pressing the "Unload" button in the Container's UI when the Container is in Loaded state(see .unloaded property for querying this state).The button will change to "Load".

Returns true on success, false otherwise.

    <bool><Container>.SetOpen <bool>open

When the argument is true , opens theContainer, equivalent to pressing the "Open" button in the Container's UI.

When the argument is false , closes theContainer, equivalent to pressing the "Close" button in the Container's UI.

    <bool><Container>.IsOpen()

Returns true if theContainer is open, false otherwise.See previous method for controlling the open state.

    <bool><Container>.UpdateContainer()

Updates the content of theContainer, preserving local modifications. Corresponds to the "Update" button in the Container's UI.

Returns true on success, false otherwise.

    <bool><Container>.MakeUnique()

Merges the Container's source and recursively merges any nested containers among its content.

Corresponds to pressing the "Make All Content Unique" button in the Container's UI.

    <bool><Container>.IsUnique()

Returns true if the content is unique, false otherwise.

### Access Type Control Methods

    <void>SetAccessType <enum>accessType

    accessType enums: {#noAccess|#onlyEditInPlace|#onlyAddNewObjects|#anythingUnlocked}

Sets the access type to the given enum value.

Available in 3ds Max 2011 and higher.

    <enum>GetAccessType()

    GetAccessType enums: {#noAccess|#onlyEditInPlace|#onlyAddNewObjects|#anythingUnlocked}

Returns the access type as an enum value.

Available in 3ds Max 2011 and higher.

    <enum>InheritedAccessType()
    InheritedAccessType enums: {#noAccess|#onlyEditInPlace|#onlyAddNewObjects|#anythingUnlocked}

Returns the inherited access type as an enum value.

Available in 3ds Max 2011 and higher.

    <void>SetLockedContents<enum>lockedType <bool>clear

    lockedType enums: {#lockAllMaterials|#lockAllModifiers|#lockAllAnimation|#lockAllObjects}

Sets the lock for the content component specified by the first argument's enum to the Boolean value of the second argument.

Available in 3ds Max 2011 and higher.

    <bool>IsLockedContents <enum>lockedType

    lockedType enums: {#lockAllMaterials|#lockAllModifiers|#lockAllAnimation|#lockAllObjects}

Returns true if the content component specified by the argument is locked, false if it is unlocked.

Available in 3ds Max 2011 and higher.

EXAMPLES:
      --Check the Modifiers Lock:$Container001.IsLockedContents #lockAllModifiers--> false --Lock theModifiers:$Container001.SetLockedContents #lockAllModifiers true--> OK --Check the Modifiers Lock:$Container001.IsLockedContents #lockAllModifiers--> true --Unlock the materials:$Container001.SetLockedContents #lockAllMaterials false--> OK

    <void>ClearLockedContents()

Clears the locked contents of the Container.

Available in 3ds Max 2011 and higher.

    <string>GetStatusString()

Returns the status string of the Container.This is the same string displayed in the viewport label if the .displayStatus property is set to true.

Available in 3ds Max 2011 and higher.

EXAMPLES:
     $Container001.GetStatusString()-->"No Access"$Container001.UnloadContainer()-->true$Container001.GetStatusString()-->"Unloaded"$Container001.MakeUnique()-->true$Container001.GetStatusString()-->"Unsaved"

### Manage Container - Edit In PlaceMethods

The"Edit In Place"checkbutton performs two operationsinternally depending on its state:

- When checked, it merges the content, equivalent to MergeSource()

- When unchecked, it saves the content to disk, equivalent to SaveContainer()

    <bool><Container>.CanEditInPlace()

Returns true if the container can be edited in-place, false otherwise.

The container rule controlling whether the content can be edited in place when inherited is set using the allowInPlaceEditing property in the local container whose content is being inherited.

The content file must have been saved with that rule set to true to allow other containers inheriting that content to edit it in place.

### Local ContentMethods

    <bool><Container>.AddNodeToContent <node>node

Adds the specified nodeand its children/dependentsto the Container's content.

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 - for instance a camera target-then its target is added

- ifthe nodeis a target, the targeting node is also added.

Returns true on success, false otherwise.

    <bool><Container>.AddNodesToContent <&node array>nodes

    nodes is In and Out parameter

Adds the providedarray ofnodesand all their children and dependentsto the Container's content.See previous method for details.

Returns true on success, false otherwise.

EXAMPLES:
    b = Box()
    -->$Box:Box01 @ [0.000000,0.000000,0.000000]
    s = Sphere pos:[100,0,0]
    -->$Sphere:Sphere01 @ [100.000000,0.000000,0.000000]
    --Will be created at the origin unless position is provided.
    --Compare to Containers.CreateContainer() which creates
    --at the average position of all content nodes
    c= Container()
    -->$Container:Container01 @ [0.000000,0.000000,0.000000]
    c.addNodeToContentb--adding single node
    -->true
    c.addNodesToContent #(s)--adding an array of one or more nodes
    -->true
    c.GetContentNodesfalse &theNodes
    --> OK
    theNodes--> #($Box:Box01 @ [0.000000,0.000000,0.000000],$Sphere:Sphere01 @ [100.000000,0.000000,0.000000])

    <void><Container>.GetContentNodes <bool>nestedContainerNodes<&node array>contentNodes

    contentNodes is Out parameter

Returns an array of the content nodes of the container into the second by-referenceparameter.

If the first argument is passed as true , nested containers will also be processed.

If the first argument is passed as false , only the content of the current container will be returned.

    <bool>IsNodeInContent <node>node <bool>nestedContainerNodes

Returns true if the specified node is in the content.

If the second argument is true , nested containersin inherited contentwill also be searched.

If false , only the current container will be searched.

    <bool><Container>.RemoveNodeFromContent <node>node <bool>detach

Removes the nodespecified as first argumentfrom the Container's content.

If the second argument is specified as true , unlinks the node from the Container. If false , the node will remain a child of the Container but will not be in the content of the Container anymore.

    <bool><Container>.SaveContainer <bool>newFileNamesaveAsVersion:<integer>

saveAsVersion default value: 0

Saves the contentand rulesof theContaineras the new definition.

Returns true on success, false otherwise.

If the newFileNameargument is true , a save file dialog will be shown to specify a new file name, making the method behave like the "Save As" button in the UI.

If the newFileNameargument is false , the current file name will be used, unless the file name is not defined yet in which case the save file dialog will still be shown. This makes the method behave like the "Save" button in the UI.

In 3ds Max 2011 and higher, If the saveAsVersion: optional keyword argument is supplied, is different than 0 and equals a supported version number, the MAXC file will be saved in that format. If the argument is unsupplied or 0, the MAXC file will be saved in the format of the current 3ds Max Version.

Valid value is 2010 in 3ds Max 2011, and 2011 in 3ds Max 2012

    <bool><Container>.ReloadContainer()

Reloads theContainer.Same as LoadContainer(), but does not depend on thestate of the .unloaded property and isthusalways available.Discards unsaved changes.

Corresponds to pressing the "Reload" button in the Container's UI.

Returns true on success, false otherwise.

### Inherited ContentMethods

    <bool><Container>.MergeSource()

Turns an inherited container into an unsaved local containercontent,merging its content into the scene. Does not merge nested container's content.

Corresponds to pressing the "Merge Source Definition" button in the Container's UI.

Returns true on success, false otherwise.

EXAMPLE:
     (-------------------------Creating a Container:-----------------------
    resetMaxFile #noprompt --reset the scene
    cnt01 = container size:50 name:"LocalContent" --create a container
    cnt01.displaylabel = true --display its label
    cnt_filename = getDir #scene + "\\_Container01.maxc" --define file name
    cnt01.localDefinitionFilename = cnt_filename --assign the file name
    cnt01.accessContent =true --enableaccess to inherited content
    cnt01.allowInPlaceEditing = false --disallow in-place editing --------------------------Creating some Content:------------------------
    obj01 = Teapot wirecolor:blue --create a blue teapot
    cnt01.AddNodeToContent obj01 --add to content
    cnt01.SaveContainerfalse --save to the current file name -------------------------Display and Wait...:-----------------------
    max modify mode --switch to modify panel
    max views redraw --update the viewports
    select cnt01 --select the container
    sleep 2 --and wait for two seconds
    -------------------------Inherit the Content:-----------------------
    cnt02 = containers.CreateInheritedContainer cnt_filename --inherit file
    cnt02.name ="InheritedContent" --name the container
    cnt02.pos = [0,60,0] --move it to the side
    cnt02.size = 50 --set the size of the icon
    cnt02.displayLabel = true --and display the label -------------------------Display and Wait...:-----------------------
    max tool zoomextents all --zoom the viewports
    select cnt02 --select the inherited container
    max views redraw --update the viewports
    sleep 2 --wait for two seconds
     --------------------------Adding MoreContent:------------------------
    obj02 = Sphere radius:15 pos:[50,0,15] wirecolor:green --green sphere
    obj03 = Box pos:[100,0,0] wirecolor:blue --blue box
    cnt01.AddNodesToContent #(obj02, obj03) --addnodes arrayto content
    obj01.wirecolor = red --change the teapot to red
    cnt01.SaveContainerfalse save to update the container definition -------------------------------Updating Inherited Content:-----------------------------
    cnt02.updateContainer() --update the inherited container from disk
    format "\nCurrently In The Scene: % objects\n" objects.count
    print objects --print scene objects - inherited content is there! -->Currently In The Scene: 8 objects
    -->$Container:LocalContent @ [0.000000,0.000000,0.000000]
    -->$Teapot:Teapot01 @ [0.000000,0.000000,0.000000]
    -->$Sphere:Sphere01 @ [50.000000,0.000000,15.000000]
    -->$Box:Box01 @ [100.000000,0.000000,0.000000]
    -->$Container:InheritedContent @ [0.000000,100.000000,0.000000]
    -->$Teapot:Teapot01 @ [0.000000,100.000000,0.000000]
    -->$Sphere:Sphere01 @ [50.000000,100.000000,15.000000]
    -->$Box:Box01 @ [100.000000,100.000000,0.000000]
    max views redraw --update the viewports
    sleep 2 --wait for two seconds
     --------------------------Changing Access Rules:------------------------
    cnt01.accessContent =false --disallow theaccess to inheritedcontent
    cnt01.SaveContainerfalse --resave to update the rules
    cnt02.updateContainer() --update the inherited container from disk
    format "\nCurrently In The Scene: % objects\n" objects.count
    print objects--print scene objects - inherited content is not there! -->Currently In The Scene: 5 objects
    -->$Container:LocalContent @ [0.000000,0.000000,0.000000]
    -->$Teapot:Teapot01 @ [0.000000,0.000000,0.000000]
    -->$Sphere:Sphere01 @ [50.000000,0.000000,15.000000]
    -->$Box:Box01 @ [100.000000,0.000000,0.000000]
    -->$Container:InheritedContent @ [0.000000,100.000000,0.000000]
    max views redraw --update the viewports
    sleep 2 --wait for two seconds
     ----------------------------------Unloading Inherited Container:--------------------------------
    cnt02.UnloadContainer()
    max views redraw --update the viewports
    sleep 2 --wait for two seconds
    -------------------------------------Making Inherited Container Local:-----------------------------------
    cnt02.MakeUnique() --make the content unique
    format "\nCurrently In The Scene: % objects\n" objects.count
    print objects --print scene objects - the content is now local! -->Currently In The Scene: 8 objects
    -->$Container:LocalContent @ [0.000000,0.000000,0.000000]
    -->$Teapot:Teapot01 @ [0.000000,0.000000,0.000000]
    -->$Sphere:Sphere01 @ [50.000000,0.000000,15.000000]
    -->$Box:Box01 @ [100.000000,0.000000,0.000000]
    -->$Container:InheritedContent @ [0.000000,100.000000,0.000000]
    -->$Teapot:Teapot01 @ [0.000000,100.000000,0.000000]
    -->$Sphere:Sphere01 @ [50.000000,100.000000,15.000000]
    -->$Box:Box01 @ [100.000000,100.000000,0.000000]
    cnt02.localDefinitionFilename = cnt_filename--set the same file name
    cnt02.name ="AlsoLocal"--rename the object, too
    for i = 1 to cnt02.children.count do--Stack the content vertically
      cnt02.children[i].pos = cnt02.pos + [0,0,(i-1)*50]
    cnt02.SaveContainer false --and save, overwriting the original asset
    max views redraw--update the viewports
    sleep 2 --wait for two seconds
    -------------------------------------------------Reloading The New File In Original Container:-----------------------------------------------
    cnt01.ReloadContainer() --reload thecontent fromfile
    cnt01.SetOpen false --close the container
    )--end script

#### See Also

- Containers

- Interface: Containers

- Interface: ContainerPreferences