Customize a template view

 
 
 

While you can change the basic layout of an asset’s attributes by editing its template file (see Edit an asset template), adding multiple views lets you set up multiple layouts for the same asset.

Some information (such as labels and descriptions) can be provided in both the template and the view. View-specific definitions take precedence over template-level definitions when they are provided.

For detailed information on the XML elements allowed within a view definition, see View elements.

The following illustration gives you a brief overview of the view XML elements and how they display in the Attribute Editor.

To customize a view

  1. Open a template for editing and locate the view definition you want to change.
  2. Edit the view definition by doing any of the following:
  3. Save the XML template file.
  4. Reload the template in Maya.

To locate a view definition within a template file

  1. Open the XML editor of your choice and load a template file.

    By default, the asset templates you create are saved in the assets sub-directory of your current project. (See Create an asset template.)

  2. Search the XML file for the name of the view you want to change.

    For example, to find a view that you named “ShadingArtist”, search for the view name “ShadingArtist”. (See Add a view to an asset template for information on adding views to your template files.)

    The view definition is located between <view> element tags. See Parts of an asset template to see a diagram of a template file.

    You can edit the elements within this view definition to change the way the view displays.

To remove attributes from a view

By default, all attributes from the template are added to the view when you create it. The attributes are represented in the view definition by <property> elements. The <property> elements refer to the attributes available in the template by name.

You can edit the view definition to remove any attributes you don’t want to display in a particular view.

  1. Within the view definition, delete the <property> element that represents any attribute you don’t want to display in this view.
  2. Save and close the XML file.

    When you reload the template in Maya and select the modified view as active, the attributes corresponding to your deleted <property> elements no longer display in windows and editors.

To change the display names of attributes in a view

In each view, you can use <label> elements inside each property definition to change the name that displays for the corresponding attribute in the Attribute Editor.

  1. Add a <label> element to the property definition if it does not already have one.
    Tip

    Make sure you delete the trailing slash / at the end of the property definition and add a closing </property> tag when you add <label> tags to a property definition.

  2. Edit the text string within the <label> element.
    Note

    Changing the <label> text also changes what displays as tooltip help for the attribute in the Asset Editor. By default, the Asset Editor displays tooltips based on the attribute’s <type> and <label> elements.

To re-order or re-group attributes in a view

  1. Within the view definition, select and cut an entire <property> element.
  2. Paste the element to a new location within the view definition.
  3. When you are finished reorganizing attributes in the view, save the XML template file and close your XML editor.

To change the heading for a group of attributes in a view

Before proceeding with these steps, ensure that you select the Group By Node layout in the Add View Options as you create the view.

  1. Do one of the following:
    • If your group name does not need to contain spaces or special characters, simply edit the name text string within the <group> element.
    • If you want your group name to contain spaces or special characters, add and edit a <label> element to the group definition.

To display child attributes with individual controls in a view

  1. As you add the view to your template, ensure that Expand Compounds is turned on in the Add View Options. (See also Add a view to an asset template.)

    When Expand Compounds is on, the child attributes of compounds are added to the view definition individually.

    Consequently, they display with individual controls.

  2. (Optional) If you want to display only the child attributes (with their individual controls), you can remove the parent attributes (and their group controls) from the view definition. (See also Remove attributes from a view.)

To display only group controls for compound attributes in a view

  1. As you create the view, turn off Expand Compounds in the Add View Options. See also Add a view to an asset template.

    When Expand Compounds is off, child attributes are not individually listed in the view definition, so the parent attribute (with its children) will be displayed using a group control.

To change tooltips that display in the Attribute Editor

You can set up each view to display different tooltips as the users of your asset mouse over attributes in the Attribute Editor. This lets you display any information that will be helpful to your users.

  1. Within the view definition, find the property definition with tooltips you want to edit.
  2. Add a <description> element to the property definition if it does not already exist.
    Tip

    Make sure you delete the trailing slash / at the end of the property definition and add a closing </property> tag if you are adding <description> tags.

  3. Enter your Attribute Editor tooltip text between the <description> tags.
  4. (Optional) If you want the tooltip text to display in a different language, you can also add <language> tags. See Localize the asset user interface and Localization elements: Interface labels and descriptions.
  5. Save the XML template file.

Related topics