Home > Devices > Fire Phone

Using ModelMan to View Your Custom Assets on Fire Phone


Note: Certain development tools referenced in this document are provided by third parties, not by Amazon. Any links to these tools in this document take you to third-party sites to download and install them. Autodesk screen shots reprinted with the permission of Autodesk, Inc. This software uses the FreeImage open source image library. FreeImage is used under the FIPL license. See http://freeimage.sourceforge.net/freeimage-license.txt for details. Source code for this library is available at http://downloads.sourceforge.net/freeimage/FreeImage3154Win32.zip.

ModelMan is a visualization tool on the Fire phone for 3D assets packaged in visual bundles.

Viewing Content in ModelMan

Note: ModelMan is packaged with the Fire Phone SDK, and must be installed on the device via the Android Debug Bridge (ADB), before it can be used. For more information on using ADB, see Android Debug Bridge.

ModelMan is a visualization and debug tool for 3D scenes that have been packaged in visual bundles. Before ModelMan can do anything useful, however, you have to push graphic content onto the device. This section describes methods for getting visual bundles into ModelMan.

Quick Preview from Autodesk Maya

The fastest way to visualize a scene in ModelMan is to use the quick preview function of the EuclidBuilder plug-in. For previewing, you need the following:

  • You need a computer running Autodesk Maya.
  • The computer must have the Android SDK installed, with the directory containing Android Debug Bridge (ADB) in the system path.
  • The computer must have the EuclidBuilder plug-in installed and loaded by Maya.

To automatically bundle the open scene and load it in ModelMan, in the Euclid dropdown menu select Preview in ModelMan.

The plug-in will push content to your attached device and send the correct intent to load ModelMan. You should see something like this:

Building and Pushing Assets

Getting assets into ModelMan requires:

  • Windows computer
  • Python 2.7
  • Maya + EuclidBuilder

From the root of the SDK tools folder, run the following command:

python makebundles -push

This command will:

  • Export all out-of-date .ma files referenced by bundles.xml
  • Run ebb to generate any out-of-date bundles
  • Push the resultant bundles to /sdcard/modelman/files/

 Note: To build and push a single bundle, add the -i (interactive) argument.

Pushing any VBL by Using adb

A VBL can be loaded into ModelMan via adb by using the following command:

adb push .vbl /sdcard/modelman/files/

Using ModelMan

Loading a Scene

To preview content, first push one or more bundles into the ModelMan data directory. To open the info pane, swipe in from the right and then tap the Select Root Scene button to open a scene chooser. The expandable list view is categorized by bundle name.

  • Tap the name of a bundle to expand or hide its contained scenes
  • Tap a scene name to load it

Scene View

The primary view in ModelMan is the scene view. In this view, you can interact with the loaded scene:

  • To change orientation, drag with one finger
  • To zoom (scale), pinch
  • To restore the initial orientation and scale, double tap
  • If an animation has been selected, tap to bring up the media controller. To control animation playback, use transport controls or scrub the timeline.

Info Pane

 To open the info pane, swipe in from the right. This pane presents detailed information about the currently loaded scene, including:

  • Current orientation and scale of the scene view
  • Named animations
  • Parametric animations
  • State machines
  • Image hosts
  • Attach points (more on this later)

With the exception of the orientation/scale display, tapping items in the info pane activates them:

  • Tapping an animation makes it current for playback
    • Media controls will be presented in the scene view
    • Transport controls will disappear after a timeout; tap the scene view to restore them
  • Tapping a state machine state makes it the current goal
    • The scene will perform whatever actions are associated with transitioning to the goal state
  • Tapping an image host enables you to apply any .png or .jpg in the ModelMan data directory

Attachment Points and Navigating the Scene Hierarchy

ModelMan enables arbitrary scenes to be attached at authored attach points. Attached scenes may also contain authored attach points, which is how ModelMan enables nesting of attached scenes and navigation of the hierarchy.

In this example, we'll start by loading glyphbutton, a simple frame with an attach point meant to hold a glyph. To attach a scene, swipe in from the right and then select ap_glyph.

A scene chooser opens. This looks like the root scene chooser, but instead indicates that we're loading a scene at an attach point. Select a scene to attach. In this example, it is ic_setings_amazon_3d.

Notice that ap_glyph now indicates the name of the attached scene. If you wish to remove the attached scene, tap the X to the right of the attach point name.

Tapping the attach point name, now that it has an attached scene, will drill down in the hierarchy. Notice that:

  • The info pane now shows info for ic_settings_amazon_3d
  • The Select Root Scene button has changed to enable navigation higher in the hierarchy

Previewing Parametric Layout

Use the Edit Parametric Layout option to preview parametric sizing:

When the parametric layout previewer is open, the previewed asset will switch to Layout via parametric animation. A magenta plane at the back of the object displays the expected layout size.

The top of the panel shows the following information, in order:

  1. Requested layout dimensions in pixels
  2. Animation position in seconds
  3. Parametric units requested (to show what the min/max sizing values are from the asset)

Locking Rotation and/or Scale

To expose Lock Scale and Lock Rotation controls, tap the top-right menu button:

These options work independently and enable the asset to be scaled and/or rotated before locking.

Thumbnail Pane

To open the thumbnail pane, swipe in from the left. This will display each scene in the currently selected bundle in a grid view.

  • To adjust the size of the grid items, use the radio buttons at the top of the pane 
  • To load an item into the model view, tap the item