Avatar SDK Local Compute Unity plugin  2.2.2
Toolset for Head 2.0 avatars generation in Unity3D
Scene #02: Gallery Sample

This scene showcases the more advanced usage of the Avatar SDK API.

User interface and the scene

UI is similar to a previous scene: use upload buttons to create avatars from different photos, use the drop-down list to select the pipeline type.

Once the photo is uploaded, the avatar isn't opened right away, but rather added to a gallery with a small thumbnail image.

Show button will open an Avatar Viewer which is implemented as a separate scene. Once opened, the Avatar Viewer will download the mesh and the list of available resources for this avatar from the server (or from disk in case of Local Compute SDK). Controls in avatar viewer allow you to change haircut or its color, playback blendshape animations, change rendering options and export the avatar to a prefab, .obj or .fbx format.

Keep in mind that in this sample the avatars are always created with a default set of parameters. To learn how to create an avatar with the custom set of parameters take a look at the Parameters Sample.

Implementation

The key code components for this scene are:

  • IAvatarProvider used to generate avatars, just like in GettingStarted scene.
  • GallerySampleLocalCompute demonstrates how to create a very basic avatar gallery using the Avatar SDK API
  • The viewer scene is built around AvatarViewer class which contains all functionality to display the avatar in a scene.

All classes mentioned are implemented in open-source C#, please take a look at the source code and the comments for further instructions.

See also FAQ and the getting started instructions on the main page: Main Page.