# Containers A **container** in 3DS Max is essentially a separate file that can be referenced by multiple other files, and any changes made to this file will then be reflected in all the files that reference it. This permits you to use containers in your assets but requires some specific setting up to get it to work correctly. {{< callout context="note" title="NOTE" icon="outline/bulb" >}} For full details on how to create containers and how they work, please see the [3DS Max documentation](https://knowledge.autodesk.com/support/3ds-max/learn-explore/caas/CloudHelp/cloudhelp/2016/ENU/3DSMax/files/GUID-50762DFA-E412-4377-AFBA-F62C82A22F39-htm.html). {{< /callout >}} Containers are mainly used for things like aircraft instrumentation, meaning that you only need to make something once then all your aircraft can use it, however containers can also be used in other circumstances, like to replicate scenery elements in multiple different 3DS Max scenes. So you would have a single `*.maxc` file for the instrument/scenery and then one or more `*.max` files that reference it. {{< callout context="note" title="NOTE" icon="outline/bulb" >}} This functionality is currently not supported when using [The Blender Plugin](../blender-plugin/the-blender-plugin/). {{< /callout >}}     ### Animation Groups To help you to correctly setup, export, and then reference Animation Groups, there has been some additional functionality added to 3DS Max via the Microsoft Flight Simulator 2024 plugin. If we assume that you have defined all the Animation Groups in the source file that is going to be used as the container, you would have something like this: {{< image-center src="images/3_Models_And_Textures/Plugins/3DsMax/containers/3dsmax_container_1.png" alt="Animation Groups Example In 3DS Max" >}}   At this point you can select the container node, then use the following right-click Babylon menu option "**Babylon Store AnimationGroups**": {{< image-center src="images/3_Models_And_Textures/Plugins/3DsMax/containers/3dsmax_container_2.png" alt="Babylon Utilities Store Animation Groups Option" >}}   Using this option will define a "*Helper*" node within the container hierarchy which is used to store (or load) the data about the container animation group across *all* target scenes. Note that all AnimationGroup information is stored inside the **UserDefinedProperties** of the node: {{< image-center src="images/3_Models_And_Textures/Plugins/3DsMax/containers/3dsmax_container_3.png" alt="Animation Group Information" >}}     ### Exporting A Container When using the Multi-Exporter to export a file with one or more container elements in it, you need to ensure that the following options are checked: - **Use PreExportProcess** - **Merge Container and Xref** Once your export process is finished the status of the container will be reverted and closed again.   Note that if you want to debug and see how the exporter has managed your container node and AnimationGroups, check **Apply Preprocess to Scene** when you run the exporter. If you do, however, you need to be careful saving as most of the time you do *not* want to save a merged container inside your target scene. To prevent this follow these steps to debug the container: - save the scene - check "**Apply Preprocess To Scene**" - export - inspect the scene and check how the exporter modified it - reopen the 3DS Max file {{< image-center src="images/3_Models_And_Textures/Plugins/3DsMax/containers/3dsmax_container_5.png" alt="The Container And Animation Groups After Exporting" >}}   Note how a `_1` has been automatically added during the export process to both the nodes *and* the animation groups - this is to avoid duplications and conflicts and the suffix is based on the container **ID** property.     ### Babylon Container ID To allow you to reference multiple times the same element container in a target scene, a User Defined property is set for each container when it is imported into the scene: {{< image-center src="images/3_Models_And_Textures/Plugins/3DsMax/containers/3dsmax_container_6.png" alt="The Unique COntainer ID For Each Container Version In A Scene" >}}   This container ID is assigned automatically based on the number of occurrences of the container itself within the scene, for example: {{< image-center src="images/3_Models_And_Textures/Plugins/3DsMax/containers/3dsmax_container_7.png" alt="Examples Of The Container ID User Defined Property" >}}   The exporter uses this ID to rename Nodes and AnimationGroups, as shown in the image below: {{< image-center src="images/3_Models_And_Textures/Plugins/3DsMax/containers/3dsmax_container_8.png" alt="Suffixes Added On To Nodes And Animation Groupss" >}}     ### Note For Referencing Containers In Model Behaviors It is important to understand that when setting up the object to be used as a 3DS Max container, you need to be aware of the node names and animation group names. These should be **unique** to each container object, otherwise you can have issues when trying to reference the nodes/animations within the model behavior XML.   For example, if you define two *different* instrument containers and place one of each in an aircraft, and both of them have an instrument node named `x0_AttitudeIndicator_Bars`, then try to reference it, what happens? How do you know which one of the instruments in the different containers is being targeted? One, the other or both? You can't, and neither can Microsoft Flight Simulator 2024...   There are two ways to resolve this issue:   - The first - and recommended - method is to simply ensure that nodes and animations have unique names based on the container itself. Let's look at this generic node name: ``` codeblock x0_AttitudeIndicator_Bars ``` It would become: ``` codeblock x0_INSTRUMENT_AttitudeIndicator_Bars ``` For example: ``` codeblock x0_AS_225_AttitudeIndicator_Bars ```   - If the above method is not possible, you can always change the default container ID in the User Defined properties for the container in the scene, then reference this ID in the model behavior. For example:![Changing The Container ID In A Scene](images/3_Models_And_Textures/Plugins/3DsMax/containers/3dsmax_container_9.png) This allows you to manually solve the conflict in the case that your node or animation name is the same in two or more different container objects. After doing this you would need to ensure that the Model Behavior XML uses the matching ID value for the relevant container: ![Setting The Container ID In The Model Behavior XML](images/3_Models_And_Textures/Plugins/3DsMax/containers/3dsmax_container_10.png)