Creating Views
 
 
 

One advantage to creating a template for your asset is that you can create multiple Views for it. You can use Views to customize which attributes certain users can see in the Maya editors. For example, you can create a View that limits an animator to only the door controls and wheel spin controls and another View to limit a shader to only the truck’s body materials and textures.

Not only do Views cut down the amount of editor clutter for each artist, but it also adds a layer of protection so that users don’t accidentally change an attribute they shouldn’t have control over.

To create a View for an animator

  1. In the Asset Editor, select View > Add > .

    The Add View Options window appears.

  2. Select Edit > Reset Settings.
  3. Set the Name to Animator.
  4. Set Layout Mode to Flat.
  5. Click Apply and Close.

    Maya creates a new View for the asset.

Notice that even though you created a new View, all the attributes are still visible in the right column. Since we only want the animation controls visible, we need to customize this View.

To customize a View

  1. Open the Script Editor by clicking .
    Note

    If you prefer, you can also use any external text editing tool to perform the following steps.

  2. In the Script Editor, select File > Load Script.

    A file browser appears.

  3. Set Files of type to All files.
  4. Navigate to the GettingStartedMaya2012LessonData\Assets\assets folder. Ensure that Files of type is set to All Files. Select emergency_vehicle.template.
  5. Click Open.

    The template is now displayed in the Script Editor. The template is an XML file and thus is arranged with a series of tags.

  6. Scroll to the bottom of the Script Editor or use + F to search for the following tag:
    <view name='Animator' template='emergency_vehicle'>
    

    Underneath this tag, delete the following:

    • <property name='headlight_intensity'/>
    • <property name='siren_intensity'/>
    • <property name='interior_light_intensity'/>
  7. Highlight the text of the XML file or press + A.
  8. Select File > Save Script.

    A file browser appears.

  9. Set Files of type to All files.
  10. Navigate to the GettingStartedMaya2012LessonData\Assets\assets folder and select emegency_vehicle.template.
  11. Click Save.
  12. Select Edit > Clear All to clear the Script Editor.
  13. Close the Script Editor.

You’ve now customized the View by leaving only the attributes an animator would be interested in. However, this is still not reflected in the Asset Editor. To see your changes, you need to refresh to the Asset Editor.

To update the Asset Editor

  1. Select Template > Reload.

    The right panel updates to show you your customized View.

Now repeat the procedure to create a second view, but with the following changes:

Now you have two different Views that are useful for two different artists. You can switch between Views in the Asset Editor by selecting View > Name, and then selecting the name of the View you want to set.