Page tree

Versions Compared

Key

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

...

  1. Follow the steps above to get the VHToolkit Unity Package in your project
  2. Copy your art assets to your Unity Project. You can use the assets in VHToolkit if you wish. Copy these files to <your project>\Assets\Resources:
    1. <VHToolkit>\core\vhtoolkitUnity\Assets\Resources\art\characters\Brad.fbx
    2. <VHToolkit>\core\vhtoolkitUnity\Assets\Resources\art\textures\Brad_Face_2048.jpg
    3. <VHToolkit>\core\vhtoolkitUnity\Assets\Resources\art\textures\Brad_Hand.jpg
    4. <VHToolkit>\core\vhtoolkitUnity\Assets\Resources\art\textures\Brad_Pants.jpg
    5. <VHToolkit>\core\vhtoolkitUnity\Assets\Resources\art\textures\Brad_Shirt.tif
  3. You now have to match up the Materials with the textures:
    1. In Unity, in the Project pane, click to open the Resources folder, then click to open the Materials folder.
    2. Click on Brad-Brad_SkinRig_Brad_Hands
    3. In the Inspector, in the Texture2D square, click the Select.
    4. In the dialog that pops up, select the Brad_Hand texture
    5. Repeat these steps for the Head, Pants, and Shirt materials.
    6. To test to see if the character is imported correctly, select Brad in the Project column, and drag it to the Scene view. You should see the character, fully textured. Click delete to remove him from the scene when done.
  4. You now have to create a Prefab for the character.
    1. Select the Brad object in the Project View
    2. On the menu bar, click VH->Prefabs->Create Smartbody Prefab(s) from Selected
    3. In the Project column, click Create -> Prefab
    4. Drag 'New Prefab' to the Resources folder
    5. Click on 'New Prefab' to rename it to 'BradPrefab'
    6. Drag 'Brad' onto 'BradPrefab' to create a prefab of Brad
    7. Still in the Project column, open up vhAssets\sbm
    8. Drag UnitySmartbodyCharacter to BradPrefab
    9. 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>
    10. 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.
    11. Still in the Inspector, select the checkbox 'Is Face Bone Driven'. Turn that on.
  5. Now you need to add the components to the scene.
    1. In the Project column, open up vhAssets\Resources
    2. Drag VHBehaviourManager to the Hierarchy column
    3. Drag DebugConsole to the Hierarchy column https://jira.ict.usc.edu/browse/VH-232
    4. Drag Fps Counter to the Hierarchy column https://jira.ict.usc.edu/browse/VH-231
    5. Drag FreeMouseLookCamera to the Hierarchy column. In the Hierarchy column, select 'Main Camera' and delete it.
    6. Drag VHMsgManager to the Hierarchy column
    7. (Unity Pro) Drag SmartbodyManager to the Hierarchy column.
    8. (Unity Free) Drag SmartbodyManagerBonebus to the Hierarchy column.
  6. Now you need to configure and initialize SmartbodyManager
    1. (Unity Pro) In the Hierarchy, select SmartbodyManager
    2. (Unity Free) - In the Hierarchy, select SmartbodyManagerBonebus.
    3. Change Position Scale to 0.01 since Brad's data is in centimeters. This is unnecessary if all your data is in meters.
    4. (Unity Pro) In the Project column, go to Create C Sharp script
    5. (Unity Pro) Select NewBehaviourScript and click Edit in the Inspector
    6. (Unity Pro) Add the following code to the Start() function:

...