FaceRig

FaceRig

32 ratings
[WIP]Custom Avatar in Blender
By `Tyr~
How to make and import an Avatar in Free Blender Open Source 3D Program.

Requires a Moderately-Advanced understanding of Blender (topics like ). I'd suggest an understanding of modeling, skinning, textures, and unwrapping before attempting this guide.

Blender[www.blender.org]

Currently a work in progress. Needs a review, a once-over, and, possibly in the future, a video to include some 'how to blender'.
 
Rate  
Favorite
Favorited
Unfavorite
1) Make a mesh.
2) Add Materials.
Note: For the model to be importable to FaceRig, certain parts of the file must be named EXACTLY in the correct format. The mesh's materials are one such part, because the materials determine what shader types are used for which portions of the mesh. Whenever a naming scheme is listed, please check in the documents for options and explanations of what each portion of the name indicates.

Naming scheme: avatarName_sht_shaderType_materialName.
Example: bob_sht_metalcloth_tshirt


Assign the materials to your mesh in order set which shaders affect which portions of your model.


Make a UV map for the mesh.


Now that the Materials are all set up in blender, you can create the textures. Textures are to be made in .tga image file format and placed into the directory you plan to import into Facerig. Each material you make needs have at least a diffuse texture, but can also include a variety of other texture types depending one the shader types you're using. The naming scheme can be found in the documents.
3) Make Skeleton & Rig Mesh
Naming scheme is vital and found in documents.

Add Armature


Naming Scheme is Important


Naming Scheme Example


Skinning/Rigging
4) Animate.
FaceRig makes the your avatar copy what you face is doing by detecting what state you face is in, then blending between a set of animations. Because of this method of motion, every avatar must include 55 different animations defining different states and expressions of the avatar. These animations, and the exact names of each, are listed in the documentation.

If you want to test whether your model will import into FaceRig, you can simplify the animation process by just making an idle animation, and not making the rest. The model will still import and run the idle, but it will not respond to any movement/expressions you make.

The colladae exporter only exports animation frames where there are Keyframes. To make sure that the entire animation is exported, you can use 'Shift-O' to generate "in-between keyframes" for each of your keyframes (the blue keyframes).


By default, Blender only saves animations that are linked to an object, and each object can only have 1 animation at a time. As such make sure to hit the 'F' next to the ActionSelector for every animation to force it to be saved even without a link. Otherwise, all animations but the one currently linked to your armature won't be included when you save the .blend file.
5) Export Geometry
Export just the model, without animations to collada format.

To do so, first remove the Action using the 'X' button.


Then select the export "Collada (Default)(.dae)" under the File menu.


As you only want the model you made, use "Selection Only", "Include Children", and "Include Armatures". This will export the correct contents if you have either the mesh or the armature selected when you export.


Finally, export a file with the name 'avatarName'Geometry.dae Example: bobGeometry.dae

6) Export Animations
Export each animation. To do so, Link the Action to the Armature by selecting the Armature, then selecting the action from the dropdown list.
You can do this individually, one at a time, for every animation (as in below image), or you can use the below script that will iterate through the Animations and export them all for you.


You can use the same export settings to export the animations as you did for the Geometry.

For the script to work, you must have the Armature selected and have the Action Editor window open somewhere on you workspace.
import bpy for actionIter in bpy.data.actions: for a in bpy.context.screen.areas: if a.type == 'DOPESHEET_EDITOR': x = a.spaces.active x.action = actionIter exportLocation="K://Project2-Smiley//output//"+actionIter.name+".dae" bpy.ops.wm.collada_export(filepath=exportLocation, selected=True, include_children=True, include_armatures=True, include_shapekeys=False)
Note: Double slash in exportLocation is required for python to understand it.
7) Config File
You can also include a config file in your import directory to make small adjustments to how FaceRig handles your model. In mine, I have used set_friendly_name to rename the avatar's ingame name from avatarSmiley to Smiley, and set_skin_for_avatar so I can rename the avatar's skins if I ever make more than 1.
Example:
set_friendly_name avatarsmiley smiley set_skin_for_avatar avatarsmiley Default Default

What your import directory should look like so far:
8) Setup ImportWizard
Open ImportWizard, found in %FaceRig%/Bin/Tools/ImportWizard, and browse to your output directory.
Note: This step can be quickened by copy/pasting the path before clicking the browse button. This will allow the folder to already be open in the browsing window.


When you click OK, the wizard will automatically fill the import options for you.


While exporting a mesh, Blender tags '-material' to the end of every material's name. Because of this, the materials aren't automatically filled out when opening the model. You can either manually assign the textures their intended materials in the wizard, or you can account for the extra tag by adding it onto the end of your textures' filenames so they are automatically filled out upon opening.
Example: smiley_face_d.tga => smiley_face-material_d.tga -or- reassign as below img.

9) Click Import.
< >
18 Comments
Ponlets Aug 16, 2016 @ 8:46pm 
why does it have to be so hard to do :< i have a model rigged and everything but this seems really hard to import when i would think they could just let you import your rigged model to facerig and move the bones based on what the tracker sees not move via predefined animation but thats my thoughts ... great guide though :) ... i kinda wish this was a video on youtube :)
Actualkevin Aug 16, 2016 @ 11:44am 
Hey what a great effort! Thanks for taking the time!
`Tyr~  [author] Aug 15, 2016 @ 8:38am 
Can't share the .blend, but i may be able to get around for a clarifying pass on the tutorial sometime when I can finish the model.
`Tyr~  [author] Aug 15, 2016 @ 8:37am 
He can use it without uploading it. Placing the files in the apropriate folder should work no problem.

For the files, the only method I know is to find them in the installed program's folder. If you asked facerig community managers, they'd probably hand it out no problem ( https://steamcommunity.com/app/274920/discussions/6/613936673288270863/ ).
HDVdeArgentina Aug 14, 2016 @ 6:38pm 
Hey, Tyr! Nice tutorial, looks pretty complex but I think I can handle it.
I'm going to make a custom character for a friend, but I don't have the FaceRig software. Where can I find the documentation that you mentioned for the 55 animations?

By the way, can he use the custom model without uploading it to the Workshop? Once there, everybody will be able to download it, so no more exclusive model for him.
aytimothy May 21, 2016 @ 4:31am 
Do you think you could share a copy of your current .blend file so that I can see how you've done it? If you can't could you at least clear something up for me:

Which bones (from the outliner) is which (in the 3D viewport)?
PoisonMaster Mar 11, 2016 @ 1:51am 
Hi, are there any tutorial specifically for max? Or some kind of documentation? Thanks for your work anyway.
Bloody Grundel Feb 21, 2016 @ 10:18pm 
Sweet tutorial, im new to facerig but used blender alot so I cant weait to get into it!!
`Tyr~  [author] Jan 27, 2016 @ 8:38pm 
No easy way for the animations. If you use someone else's skeletons theres a chance you can use animations someone else made. But if your model is custom enough to require a custom skeleton, I know of no way to get animations besides making them yourself. The good new is that most of them are simple, and only require part of the bones to be animated.
It wasn't me Jan 27, 2016 @ 2:45am 
OK, thanks. Still, what about the animations? Can I import them from somewhere, or must I make every one of the 55 myself?