0b Unity Maya Import Animation

smallarrows.GIF

In this tutorial we will create animations in Maya that run continuously in Unity.


:::::: SAME AS LAST TUTORIAL ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
In Unity:

Select NEW
Give your project a name such as 0b_Maya_Anim1_Tutorial.
This will create a folder with folders inside.
Save to your external hard drive or the Desktop.
Select 3D.
Select Create Project.


Import plugin, Steam VR Camera and Controllers for Vive
Choose the Asset Store tab next to the Scene window

Type SteamVR in the search bar
unity_VR_steam_plugin
Select the
SteamVR Plugin by Valve  (It is free)
If you have never done this select Download first, then Import

Choose Import in the store window (Ignore errors, select I made a backup go ahead)
The Import Unity package window will pop-up, you can downsize the import if you don't want to wait and take up extra disk space. Select Import

Turn off: the file will be 2.73MB compared to 94.4MB
     Longbow
     Readme_InteractionSystem.txt
     Samples
     Materials
     quickstart.pdf
     readme.txt
     Resources
     Scenes
     Textures

Plugins always import into the Assets folder of your project. You can always copy or delete them between projects.

Put the main view window back to Scene instead of Asset Store

     Click the Scene tab on the left


Select the SteamVR folder from the Project tab
Select the arrow, open InteractionSystem, open Core, select Prefabs
Drag the Player into the Hierarchy tab

Unity_steam_primitives1a

Setup the Main Camera to be out of the way
Select the Main Camera from the Hierarchy tab
     Change Target Display to Display 2

     Change Target Eye to None in the Inspector tab
(The main camera interferes with the Vive Headset camera.)


Try your Project with Vive Headset


Hit the Play button   unity_play_arrow

Turn on the hand held controllers, press both small round buttons at the same time, the light will be blue. Put on the headset


If the Vive VR is not working:
Start SteamVR steam_VR1   from the System Tray menu lower right screen. system_tray

Make sure the headset and controllers are connected
Try wiggling the Headset and pressing the buttons on the controllers
Make sure the hand held controllers have charged batteries
unity_steam_status
Steam Status Utility will look like this if it is ready.

Reset Steam if you don't see all the icons
     Select the down arrow next to SteamVR unity_steam_arrow
     Select Devices->Reboot Vive headset
     There is also a menu to Run Room Setup, this should be done already
:::::: END ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::



In Maya: Model a room with some animated objects
Create poly models for items in your VR environment. (NURBs do not work)
(NOTE) In Unity, use GameObject->3D Object->Cube for your floor, this will make things easier. The floor should be at 0 in the Y axis. Do not use a plane for the floor, collisions will not work with a plane, you need a volume.


If you have any texture maps place them in your Unity project-> Assets folder
Assign any textures from inside Maya, using the images inside your Unity project Assets folder.

Save the Maya scene file into your Unity project-> Assets
You will see your models and textures appear automatically in Unity.

(Maya does have a utility to send files straight to a Unity project, it saves as an FBX, the scale is completely wrong. Don't use.)



Animation, rotation example
Move the time line over to frame 1 at the bottom of the screen.
timeslider_1

Select a poly object.

Use the channel box on the right side of the screen. 
If you do not see the channel box, hit the channel button upper right side of the screen.


Highlight Rotate Y in the Channel Box
Use the right mouse key to bring up mini menu, choose Key Selected.

Move the time line over to frame 120 at the bottom of the screen.

Rotate theobject 360 degrees in the Y axis

Highlight Rotate Y in the Channel Box
Use the right mouse key choose Key Selected.


Use this process for any channel that can be animated.


Preview the animation
Move the time line over to frame 1 at the bottom of the screen.

Hit the play arrow on the time slider. timesliderplay.jpg

Stop the playback by clicking the mouse on the red square over the play arrow.




In Unity: View your Maya Animation in your Unity scene
Select Assets in the Project tab
Drag your Maya file from the Assets list over to the Hierarchy tab.

If your object is the wrong scale do this:
Select the Maya file in the Assets list, select the Model section in the Inspector tab, change the Scale Factor, hit Apply
Scale: In general the classroom active area is about 15 x 10 x 11.25 units xyz in Maya, this will match the Vive scale is you change Scale Factor to .3
VRCollisions_1


Switch to Legacy Animation

Select your Maya Model in the Assets area
Switch to the Rig tab in the Inspector on the right.
     Change Animation Type to Legacy  (default was Generic)
     Hit Apply
Switch to the Animation tab
Rename Take 001 to a unique name



Loop
If you would like to loop your animation:
Select the object that has the animation from the Assets window
Change to the Animation section of the Inspector tab
Change Wrap Mode to Loop
Hit Apply


Now your animations are all set up to run continuously.

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

Try your Project
 Hit the Play button   unity_play_arrow


::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
If the Vive VR is not working:
Make sure the headset and controllers are connected
Try wiggling the Headset and pressing the buttons on the controllers
Make sure the hand held controllers have charged batteries
Make sure SteamVR status utility is running
     Start Steam  unity_steam_logo
     Login
     Hit this logo in the upper right of the steam window, you can close the large window  start_steam_VR
     Ignore Display and Base Station warnings, it will work.
    
unity_steam_status
Steam Status Utility will look like this if it is ready.

Reset Steam if you don't see all the icons
     Select the down arrow next to SteamVR unity_steam_arrow
     Select Devices->Reboot Vive headset
     There is also a menu to Run Room Setup, this should be done already



::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
OBS
OBS screen capture VR documentation

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

**IMPORTANT Save a spare copy of your Maya scene files and Textures in another folder away from your Unity project.