Container templates are used in Maya to store information about the published interface of a container and to customize the user interface associated with it. This topic provides a reference for advanced users who want to customize template files and understand in more detail the way that container templates work. A complete template file reference document for FBX Assets is also available at http://www.autodesk.com/maya-docs.
Container templates are defined in XML template files. This file format allows you to define a hierarchical template with inheritance from multiple types. You can edit and validate the structure of the XML template file using the XML editor of your choice. (See Edit a container template.)
Once you have saved a container template, you can find the XML template file in the assets directory of your current project.
Within Maya, a template is defined by a unique name. All actions associated with the template use the template name as the primary means of identifying and locating the template. The template name is an object identifier and cannot contain illegal characters such as spaces, special symbols and multibyte characters.
Maya adopts the following naming conventions for template files:
Maya uses a search path for locating template files. The template search path contains both built-in and user-designated locations that will be searched in order when attempting to load a template.
Templates are loaded primarily by name. An attempt is made to locate a template file matching the template name along the search path. Template files not on the search path can also be loaded using absolute file paths, but this approach is not recommended as it can lead to problems locating the template in future sessions.
To query the current template search path, use the following command:
containerTemplate -query -searchPath;
By default, this file rule points to the assets subdirectory of the current workspace. The first location in this file rule is also the default location where template files are saved if no other path is specified.
To customize the search path with a location of your choice, see Change the template search path.
The following attributes are stored on the container node to define the associated template.
(Optional) Specifies the physical location of the XML template file. This path can be relative to the current project or it can be an absolute path.
The following container node attributes define the current container view.
When the viewMode is set to Use Template, the template definition of the container is used for layout of the published interface of the container. If the template has views defined for it, the viewName attribute is set to the name of the view to use. If the viewName attribute is empty, the template definition serves as the default view.
All common template operations are provided through the Asset Editor and Attribute Editor, so you will not require the command-line interface in most cases.
The following commands provide the underlying support for container templates and container views and can be used for scripted access to these operations:
Refer to the command reference documentation for further details on these commands.