What are container templates?
 
 
 

Container templates are XML files that let you create a common user interface for assets that are interchangeable. For each template, you can create multiple custom views of the published attributes. Each view can be customized with its own layout, attribute labels and descriptions (tooltips).

After you have created a container and defined its published attributes, you can save a template of the published attribute names. (See Create a container template.) The next time you create a container of the same kind, you can load the saved template to set up the new container with the same published names. (See Assign a template to a container.)

TipYou can also set up all containers that use the same template to display the same icon in the Hypergraph and Outliner. (See Mark a container with a custom icon in the Outliner.

Templates are referenced by the container using the container’s Template Name attribute, which tells the container which template to use. (See also Template naming conventions.) Each template file stores a set of published attribute names that the assigned container requires. This lets you quickly and easily create other containers of the same kind without missing any of the required attributes. Saving templates as separate files lets you establish a library of templates that you can reuse across a pipeline, independent of specific scene files.

Once you have assigned a template to a container in your scene, you can bind the container’s attributes to the template’s unbound attributes.

For example, you can set up all of the spot lights in your scene using the same container template, giving all spot light containers a common interface. Since all of your spot light containers have the exact same set of published attributes, you can easily swap controls and animation between them using Replace Reference or Transfer Attribute Values. (See Replace referenced containers and Transfer attribute values between containers.)

Using templates to create a common interface for assets is optional. However, if you save templates, you can also define multiple views, or layouts, for each template. Template views let you completely customize the container interface, changing the grouping, organization, and naming of attributes in the Asset Editor, Attribute Editor, Outliner, and Channel Box.

The following illustration shows the Attribute Editor for a fountain asset first with no views assigned, then with two different views created for the shading artist and the environment artist on a team. Each artist is supplied with only those attributes they will need when working with the fountain asset.

Even if you do not save templates or define custom views, the container View Mode attribute gives you two options for organizing the layout of published attributes in Maya’s various windows and editors. The Group By Node view organizes published attributes by node, with one collapsible frame per node. The Flat view lists nodes in the order they were published.

NoteFor all views, Maya automatically creates the appropriate interface tools in the layout (for example, numeric attributes display with sliders and appropriate Min and Max values) based on each attribute type you have included in the template. For more information on customizing views, see Customize a template view.

For more detailed technical information about container templates, refer to Parts of a container template and Template file format.

Template views

Template views let you define the way a container’s published attributes are displayed in Maya’s windows and editors. Depending on your production requirements, you can create multiple views for each template. (See Add a view to a container template.)

A template view is essentially a set of published container attributes that you have grouped and organized together for a specific purpose. Creating a set of different views for one template lets you create a different user interface for any purpose your pipeline requires. (See Customize a template view.)

For example, you can create custom template views to do the following:

For information on setting up your own customized views, see Add a view to a container template and Customize a template view.

Related topics