Monday, 22 February 2016

Using Daz Animations in Unity

In a previous post the steps for importing a Daz character in Unity palov vidaurrof asked if there was a way to export animations from Daz so that they can be utilized in Unity using the Mecanim animation system. This post answers that question.

Note: This tutorial uses Daz 4.8.0.55 Pro Edition (64bit) (from Help > About Daz Studio) and Unity 5.2.0f3. My system is a first generation Wacom Cintiq Companion running Windows 10 and using an Intel 4600 Graphics Card.




So let's start in Daz. For this tutorial Victoria 6 is being used with Toulouse Hair, pink shorts and top so there's nothing getting in the way of you seeing what's going on with the model. Obviously, you can use whichever model you like.

Here's my Daz scene:


Now let's add some animation to this. We're going to use aniMate Lite here, but the steps should be the same if you have aniMate 2. aniMate Lite is already docked to the bottom of the workspace, but if you can't see it click on Window > aniMate Lite:


Here is the aniMate window:


Along the bottom of the aniMate window you can see some items in blue. These are complete animations ready to use that you can drag onto the timeline and if you hover your mouse over the animation, then it will run against the currently selected character in your scene.


For the purpose of this tutorial we are going to use the first animation: crouch and jump. Click on the "crouch and jump" animation and drag and drop it onto the Timeline.


Before we go further, let's take a quick look at the aniMate controls. They are described below:

Press Play and you will see the animation run and loop (unless you turned looping off by clicking on the "Loop animation" button). 

Note: if you leave the animation as looping, it will not import into Unity that way so you will have to set that within Unity.

When we dragged the animation on the timeline it did not line up with the start of the timeline, so we're going to drag that back to frame 0 of the timeline so that the animation plays straight away. You'll also notice that the animation will stop, or loop, at the end of the "crouch and jump" animation, this is because there's no other animation on the timeline, so that's really neat as it saves you trimming the animation.

OK, now we've dragged the animation to Frame 0 of the timeline just by clicking and dragging:


Now there's no gap when the animation is played. So now we have a character in Daz and it has an animation, but there's one more thing we need to do before we can export it. Right click in the blank space under the timeline and click "Bake to Studio Keyframes":


Click "Yes" to transfer the animation from the aniMate timeline to the Daz Studio timeline:


Now you are ready to export, so click "File > Export".


Type a name for your file and choose a location to store it in (making sure you've selected .fbx as the file type) and click "Save".


Make sure you select "Animations" and "Morphs" and click "Accept".


You'll see a progress bar while the export completes. Once complete, you now have a model with animations to import into Unity.



1 comment: