Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Open Unity
  2. File->New Project
  3. You need 2 Unity Packages to start with.  You'll find all packages here: <VHToolkit>\bin\vhtoolkitUnity.  Copy them to <your project>\Assets. 
  4. First, is the vhAssets package.  This contains common scripts and libraries used in various Virtual Humans applications.  There is a different .unitypackage file for each platform.  
    1. vhAssetsPackage.unityPackage    (Windows)
    2. vhAssetsPackageOSX.unityPackage
    3. vhAssetsPackageIOS.unityPackage
    4. vhAssetsPackageAndroid.unityPackage
  5. Second, is the vhAssets Test Scene.  This contains assets and scripts that will initialize a very basic test scene environment.  This file is:  vhAssetsTestScenePackage.unityPackage
  6. Copy the 2 Unity Packages to this new project.
  7. In Unity, in the 'Project' column, double click on the 2 Unity Packages.
  8. Open Scenes->vhAssetsTestScene
  9. Click Play.  The virtual human should be animating in an idle pose.  Hit 'C' to show a debug menu.  You should be able to control him via the buttons on the debug menu.

 

 

<outdated>

These instructions are for both Unity Pro and Unity Free. When there are specific instructions for a particular version, they have been marked as such.

There are differences because Unity Pro uses an .dll version of smartbody, and runs within the process. For Unity Free, Smartbody is launched as a separate process and communicates to Unity via network traffic.

Steps:

  1. You now have to create a Prefab for the character.
    1. In the Project column, click Create -> Prefab
    2. Drag 'New Prefab' to the Resources folder
    3. Click on 'New Prefab' to rename it to 'BradPrefab'
    4. Drag 'Brad' onto 'BradPrefab' to create a prefab of Brad
    5. Still in the Project column, open up vhAssets\sbm
    6. Drag UnitySmartbodyCharacter to BradPrefab
    7. Create a SoundNode for the character:
      1. Go to GameObject->Create Empty
      2. In the Hierarchy, rename GameObject to SoundNode
      3. With SoundNode selected, go to Component->Audio->Audio Source
      4. In the Project column, drag BradPrefab to the Hierarchy
      5. Drag SoundNode to BradPrefab in the Hierarchy. A dialog will pop up saying that this will lose the prefab connection. Click Continue.
      6. In the Hierarchy, drag BradPrefab onto the BradPrefab in the Project column.
      7. Remove BradPrefab from Hierarchy
      8. <todo> <set the position of the SoundNode to the character's mouth>
    8. Select BradPrefab. In the Inspector, change 'Bone Parent Name' to CharacterRoot1/AccumulationRoot since that's how the hierarchy is set up in our current character. That points to the 'top' of the skeleton hierarchy.
    9. Still in the Inspector, select the checkbox 'Is Face Bone Driven'. Turn that on.

 

 

 

  1. Now we are ready to test
    1. In Unity, hit Play button
    2. (Unity Free) Launch Smartbody as a separate process. Run <VHToolkit>\tools\launch-scripts\run-toolkit-sbm.bat
    3. Brad should appear and animating with his idle animation.
    4. Try and play an animation
    5. Open the Unity debug console by hitting tilde (~)
    6. Type the following command: vhmsg sbm bml char brad anim HandsAtSide_Arms_Chop

</outdated>


Creating your own Virtual Human

...

The easiest way to use your own Virtual Human is to create a Unity Project using the included .unitypackages as a starting point.  From here, you can add/change features on the default character, or bring in your own and customize using the existing character for reference.

 

Smartbody initialization

  • SmartbodyInit class (Attached to SmartbodyManager gameobject)
    • asset paths
    • joint mappings
    • mapped skeletons/motions
  • SmartbodyCharacterInit class  (Attached to each character gameobject)
    • skeleton name (.sk)
    • voice type (prerecorded audio or tts)
    • voice "code"  (path to audio files or tts voice name)
    • backup voice type and backup "code"  (if prerecorded audio file is not found, you can use TTS as a backup
    • starting posture
    • locomotion information
  • SmartbodyFaceDefinition class (Attached to each character gameobject)
    • defines visemes and facial expressions for the character.
    • visemes and facial expression are single pose animations (.skm) for doing blended lip-sync and expressions.
    • neutral pose, action units and visemes
  • SoundNode gameobject
    • Empty gameobject named 'SoundNode' attached as a child of the character's gameobject
    • Attach a Sound Source script to the SoundNode gameobject
    • Manually position the SoundNode gameobject where you want the character's speech to originate (eg, his mouth)

 

Using the Console

Hit the ~ key to bring up the console. Here you can see some debug information. Type 'help' for all available commands.

...