Custom .Anims
Using .anim Animations Files in APS
This tutorial will go over how to add .anim files in APS that can be fired while recording motion capture. You can add any number of .anim animations and they can be used loaded for any avatar.
Use the APS_SDK to to create a AnimationBuilderBase prefab and build a .anims asset file needed for the game.
Modify the example prefab for much faster learning curve.
Add a audio clip synchronized with the animation.
Add a particles gameobject synched with the animation.
Record motion capture that includes mixed-in .anim animations.
And lots of other neat options, read below for showcases and ideas!
The Anims panel is for loading and triggering custom .anim files
Using a .anim in the game
From the new Anims panel is where custom .anim animations can be setup and linked to controller buttons.
The simplest way to add custom .anims in APS is to build a "Anims" asset with the bundled .anim animations,
in the below tutorial I'd like to go over how to use the existing example prefab found in the APS_SDK to create new customized prefab and then add it to the game to see the .anim playing on custom avatars and use them during motion capture.
For this I am going to start from a entirely blank Unity project , The APS_SDK is the only asset required and contains all the prefabs needed!
Start a new Unity project.
It is recommended to use Unity 2019.4.40f1
I set the project name: APS_SDK_ANIMS
Import the APS_SDK
The latets APS_SDK v9.3.9 or later is required for this tutorial.
Simply import the entire .unitypackage into the new project.
Open the example scene
Locate Default_Anims_Prefab_Example_Scene from the APS examples folder.
We now have a new/empty project with just the APS_SDK imported and have opened the anims prefab default example scene.
lets take a look at the example scene and see what's in the hierarchy.
In the hierarchy of the default scene example are two prefabs:
The avatar$LuxVRM is for visualizing the the animation builder animations.
While the anims$default prefab is the actual game asset with the bundled .anims that gets built and copied to the game folder.
Lets look at the anims$default prefab in more detail.
Clicking on the anims$default prefab and in the inspector you can see the AnimationBuilder and AnimLinker
This same prefab has been added to the avatar$LuxVRM avatar and allows us to fire the anims and see the results on a avatar before building the final asset.
So by starting the game and selecting the animation builder for the avatar we can then see each of the .anims
Press play in the editor and select the anims$default prefab located on the avatar.
You can then click the trigger buttons to see the .anims playback.
Press the play button and now we can see the superheros anims !
You can also add advanced effect such as audio and toggling game objects or lights and particles at a desired time in the animation and I will try to get into that in a bit, but first let's start with the simplest case and create a .anims asset file using the example prefab, so we can simply make a modification and then build and copy to the games VR_MocapAnims folder to check the result!
To be extra concise in the next steps I will be adding a new AnimationBuilder component to the existing prefab and assigning the a new .anim files, then simply build the asset for the game!
Okay so first lets look for the example scene located in the project folder:
Assets\APS_SDK\Example Anim Actions\Default Examples\Default_Anims_Prefab_Example_Scene.scene
In the scene hierarchy you should find the "anims$default" prefab:
First step create a new Unity project and import the APS_SDK .unitypackage
After importing the APS_SDK you should be able to find a new examples folder and the prefab example located in Default_Anims_Prefab_Example_Scene
Click on and open the scene in the editor,
Once the scene has loaded look for the anims$default prefab in the hierarchy and click on it so the object is highligheted and displayed in the inspector.
This is the same asset used to build the default anims asset provided with the game. You can quickly test out the default anims in any version of APS by opening the Anims panel and triggering one of the default .anim actions to see how they appear; then back in the example check how the prefab is configured in the example!
You can customize the example prefab and use it as a template for creating more advanced animation triggers.
As a quick review of what's goin on so far. We've created new Unity project and imported the APS_SDK, then located the example scene from the examples folder and opened the scene. From there we clicked on the "anims$default" prefab in the hierarchy and can now see all of the components listed in the inspector panel that make up the asset prefab.
So now you should now see each component listed in the inspector.
The Example Prefab
The "anims$default" prefab uses several components, I'll try to briefly explain the purpose of each component.
AnimationBuilderBase component is added to the prefab only once, and includes buttons for generating the custom Animator controller.
AnimationBuilder components can be added any number of times and are what reference the .anim and define the trigger behavior.
Animator is a Unity component and is needed in order to store a reference to the AnimationController.
APS_SDK component is needed to build the initial game asset for APS.
AnimLinker component is added by the APS_SDK after generating the game asset, this is the asset's "linker" script necessary for initialization in the game.
Sorry for not writing more..
This tutorial is still being worked on!! Check back soon for updates!
Thanks for reading ❤️