This is a tutorial showing how to get Daz3D models into Unity for the purpose of animation as I have been asked a few times about how I do it in my projects.
I’m currently using the most up to date versions of both programs, but I’ve had it working like this for a few generations of each program.
So here I am using Daz Studio 4.9 and Unity 5.3.4f1.
First load up a model in Daz and clothe her/him as you like. Remember that more complex clothes generally mean more polygons – so that’s a consideration for working in Unity. A standalone character will be fine on most PCs. I’ve had characters with many hundreds of thousands of polygons running on my 6 Core i7 and GTX970 and also on lower specs. But if you want a terrain and some sort of world, you might need to go lower.
When I first started this I was using Victoria 4.2 as she’s quite low in polygons. Over a few years I have also used Genesis 2 models, but now I feel Genesis 3 is the way to go.
Daz also make a Decimator for Daz Studio which can reduce the number of polygons quite well and still keep a good shape. I won’t go into that here though.
OK so I have a character here… this is a Genesis 3 model.
Note that hair can be troublesome. Some will look okay in Unity and others won’t. This one is Fashion Hair for Genesis 2 which I fitted to Genesis 3. Also hair can be incredibly costly in terms of polygons, so note that.
Leave the model in the T-Pose and in Daz Studio go to Export. When the file dialog opens choose to export as FBX – then enter your filename as usual.
Here are my export settings.
Under Export Options the important things are ‘Figures’ & ‘Morphs’ – so tick those. Under Output Options I use FBX 2012 — Binary. And the settings under that will likely already be ticked, but you can compare mine to yours and make alterations if needs be.
The next thing here, is the morphs. You need certain morphs to control parts the body, for example the mouth shapes for lip-sync. I will concentrate on those.
Click the ‘Edit Morph Export Rules’ button.
You can add expressions here that will cause morphs to export if they match the pattern. I won’t go into detail here, as you can find out more about that in the Daz docs and online.
But for the purpose of this tutorial, make sure you have the rules as I have set them up here. The ‘.CTRLVS’ pattern is the one that will grab the mouth shapes (Visemes) that you need for lip sync. And you can see from the Action segment that these should all be exported. These are what will appear in Unity under ‘Blendshapes’. In the future, at this stage, you will probably find other things you need or don’t need. What I have shown here is enough to get you going on things like lip-sync and blinking.
Now export her and you should find wherever you saved it, the FBX model and a sub folder with all the textures in it.
That’s all we need from Daz, so save your scene with the character if you wish, close Daz down and open up Unity.
Start a new Unity project, find help online if you need it. In a fresh project you won’t see much, but here we will do the importing. Click on the ‘Project’ tab in the bottom left and then the ‘Assets’ tab.
Now the easy bit, just drag your FBX model into the Assets folder pane. Wait a bit while Unity does it’s work.
You should then end up with a model, and a couple of folders that contain materials and textures. This has improved no end over the years, it used to be a chore to assign all the materials manually, but now they should already be set up.
Now lets rig the model. Click on the model (test in my screen shot) and you will see information in the ‘Inspector tab’ on the right.
Click on ‘Rig’…
Then in the ‘Animation Type’ drop down, choose Humanoid. You can also choose to optimise game objects here too… Click Apply.
Once Unity is ready click on the ‘Configure…’ button. This will bring up the rigging screen.
Now as Daz makes their models so well and Unity does a great job on their side, there is really nothing to do here but you can tweak bones and things here if you need to. I really can’t talk about this section in depth here, so on this occasion just have a browse around and see how things are lined up. When you are done just click on ‘Done’ in the inspector.
That’s it ! She is now rigged for animation. Again animation is a big subject. But now you should be able to attach an animation to her and she will animate – check out the Unity asset store for free and commercial animations. Let’s just see where the morphs are though (or as Unity call them ‘blendshapes’).
Drag your model into the scene. Navigate in the scene hierarchy to Genesis3Female.Shape (or whatever generation you used) – this is your main model, other things will be clothes and props. You should see something like this…
Notice I have highlighted Blendshapes in the Inspector. Ignore her eyes for the moment. If you open up the blendshapes branch you will see all those morphs we exported out of Daz Studio – play with those to see that they will affect the model. Here I have increased the OW mouth shape. It’s by controlling those in script that you can do things like lip sync.
But those eyes…. Well different models do different things. Basically Daz uses layers on top of the actual eyes to add things like eye moisture. We don’t really need these in Unity unless you want to write a shader for them. The quick fix is to make those extra layers transparent so that we see through to the base eye texture. Like I said, these eyes can vary.
So create a small transparent PNG image in your favourite graphics program – just a totally empty transparent image then bring that into Unity and apply that to the Albedo slot of the offending material. Then change the rendering Mode for that material to ‘Transparent’ and the Shader to ‘Standard (Specular setup)’. Repeat this for any interfering layers.
If all that last part makes no sense, then you need to have a quick look at the Unity docs about materials. Once you have done it a few times it becomes easy, honest.
For the eyelashes and hair, just set the Rendering Mode to ‘Fade’. Again these often need tinkering with. I forgot to set the hair to fade in my screen shot, but it will look a lot better when you do.
That’s the end of the tutorial, I hope it helps people in some way. It took me a long time to nail down this method and things often change, but I find with my projects this works quite well. Leave a comment or ask questions if there is something that needs expanding, but remember this is just about getting Daz figures into Unity not a tutorial about everything mentioned.
I have a thread going over on AiDreams about some of my work on this kind of thing if it is of any further interest.