0b Unity Maya Import Animation

smallarrows.GIF

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

In Unity:
Select New
Give your project a name such as 0b_Maya_Anim1_Tutorial

Select GameObject->3D Object->Cube
Use the Cube for the floor, scale it down in the Y axis.


In Maya: Model a room with some animated objects
Create poly models for items in your VR environment. (NURBS do not work)

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.


Animation, rotation example

Move the timeline 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 timeline over to frame 120 at the bottom of the screen.

Rotate the object 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 timeline over to frame 1 at the bottom of the screen.

Right mouse over the timeline to bring up the mini-menu
     select Playback Speed->Real-time

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.



Save Maya File to Unity Assets
Save the Maya scene file into your Unity project->Assets folder
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. Do not use.)

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
In Unity:

Import plugin
Choose the Asset Store tab next to the Scene window

Type SteamVR in the search bar
unity_VR_steam_plugin

Add the SteamVR Player Prefab to your scene
Select the SteamVR folder from the Project tab
Select the arrow, open InteractionSystem, open Core, select Prefabs
Drag the Player into the Hierarchy tab


Script to help the SteamVR simulator work
This helps throwing objects and starting animation when you do not have a headset.
Written by Alex Rickett
Download this file 
Place the file in your Assets folder
Drag and drop this script onto the Player->NoSteamVRFallbackObjects->FallbackHand in your Hierarchy


Setup the Main Camera
Select the Main Camera from the Hierarchy tab
     Change Target Display to Display 2,
Change Target Eye to None in Inspector
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

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


If your Maya 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 to .3 hit Apply
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 located beneath Take 001 to Loop
Hit Apply

Now your animations are all set up to run continuously.

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

Try your Project
Always Save your scene before playing.
Hit the Play button   unity_play_arrow

If you are running in Sim mode use wasd or the arrow buttons to navigate around the scene,

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
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.