HeroEngine Forums
Welcome, Guest. Please login or Register for HeroCloud Account.

Author Topic: Complete Facegen Tutorial  (Read 7594 times)

Stadi_Thompson

  • General Accounts
  • *
  • Posts: 324
    • View Profile
Complete Facegen Tutorial
« on: Jul 21, 14, 03:35:59 PM »

PART ONE

Complete Facegen Tutorial

I strongly recommend reading the Facegen tutorials located in the HeroEngine wiki located here:
http://wiki.heroengine.com/wiki/FaceGen_Pipeline and http://wiki.heroengine.com/wiki/FaceGen_Tutorial . There is a lot of detailed information in these wiki entries that you may need to know and understand before moving forward. This is a compact version I created for the HeroEngine community based off the wiki pages.

Preparing your body morph data files.

-Download and install the HeroEngine Art Pipeline.
-Copy the folder "template_FaceGen_directory" from "C:\HeroEngine\ArtPipeline\Templates" to C:\.

IMPORTANT: Make sure none of the files are marked as "read only", otherwise the whole process will not work.

-Lets rename the folder "template_FaceGen_directory" to "malebody_FaceGen_directory" for this example.
-Each body morph variation must have the same amount of vertices and consist of the same topology. The best way to do this is to make your morph variations from the same base model. Here are my morph variations for my project:



IMPORTANT: Always test your body shapes with the Morpher modifier in 3dsMax to make sure they are morphing correctly. Your morph shapes may have the same amount of vertices and faces, but that doesn't mean the vertex order is the same, this may cause vertex stretching.

-Place all of your full body morph variations models at the 0,0,0.
-Freeze Transforms/Reset Xforms on all of the models after they are scaled appropriately.
-Make sure the model's pivot point is at 0,0,0.
-Detach any eyes, teeth, eye lashes, etc. You just want the basic skin, the basic skin it must be one mesh with one texture.
-Export each mesh to individual OBJ files using the settings shown.



Make sure the settings are exact, otherwise the OBJs will get modified on export and will not work.

IMPORTANT this tutorial is written for 3dsMax units, export setting will be different in Maya.

-Use the following naming scheme when exporting each body shape, name your models xxxxx_tall.obj, xxxxx_heavy.obj, xxxxx_thin.obj etc. Example, malebody_tall.obj, malebody_heavy.obj, malebody_thin.obj
-Create a new folder in "C:\malebody_FaceGen_directory\egm" named "tris"

-Next we are going to setup our script files which bakes the different body shapes OBj files into one morph file.
-Open up process.bat in "C:\malebody_FaceGen_directory" with a text editor.
-Change the line 2 "set logFile="Q:\Template Directory\log.txt" to the directory that you want your log file to be exported to.
-In this example I will change line 2 to set logFile="C:\malebody_FaceGen_directory\log.txt", now save the file.
-The next file we want to setup is "add_morphs.bat" located in "C:\malebody_FaceGen_directory\egm".
-Open up the file in your text editor and edit the lines below line 15.
-For my particular character, the lines I placed below line 15 looked like this:

Code: [Select]
addanimatemorph diff male_average_body.tri male_heavy_body.tri "Heavy" InternalMeanFace.tri
addanimatemorph diff InternalMeanFace.tri male_thin_body.tri "Thin" InternalMeanFace.tri
addanimatemorph diff InternalMeanFace.tri male_muscular_body.tri "Muscular" InternalMeanFace.tri
addanimatemorph diff InternalMeanFace.tri male_short_body.tri "Short" InternalMeanFace.tri
addanimatemorph diff InternalMeanFace.tri male_tall_body.tri "Tall" InternalMeanFace.tri
tri2egm InternalMeanFace.tri InternalMeanFace.egm

-Now run/execute process.bat in "C:\malebody_FaceGen_directory"
-After the process is done, check your log.txt file to make sure everything went well. Any errors will be listed in the log file. My successful log file reads:

Code: [Select]
G:\malebody_FaceGen_directory\egm>del InternalMeanFace.*

G:\malebody_FaceGen_directory\egm>cd objs

G:\malebody_FaceGen_directory\egm\objs>REM

G:\malebody_FaceGen_directory\egm\objs>REM ***OBJ->TRI***

G:\malebody_FaceGen_directory\egm\objs>REM

G:\malebody_FaceGen_directory\egm\objs>REM Copy objs to extensionless files

G:\malebody_FaceGen_directory\egm\objs>FOR %f IN (*.obj) DO COPY "%f" *.

G:\malebody_FaceGen_directory\egm\objs>COPY "repopmale_base.obj" *.
        1 file(s) copied.

G:\malebody_FaceGen_directory\egm\objs>COPY "repopmale_fit.obj" *.
        1 file(s) copied.

G:\malebody_FaceGen_directory\egm\objs>COPY "repopmale_heavy.obj" *.
        1 file(s) copied.

G:\malebody_FaceGen_directory\egm\objs>COPY "repopmale_short.obj" *.
        1 file(s) copied.

G:\malebody_FaceGen_directory\egm\objs>COPY "repopmale_tall.obj" *.
        1 file(s) copied.

G:\malebody_FaceGen_directory\egm\objs>COPY "repopmale_thin.obj" *.
        1 file(s) copied.

G:\malebody_FaceGen_directory\egm\objs>REM Use extensionless files to iterate through objs, converting to tris

G:\malebody_FaceGen_directory\egm\objs>FOR %f IN (*.) DO fileconvert obj-tri "%f" "%f" 

G:\malebody_FaceGen_directory\egm\objs>fileconvert obj-tri "repopmale_base" "repopmale_base" 

G:\malebody_FaceGen_directory\egm\objs>fileconvert obj-tri "repopmale_fit" "repopmale_fit" 

G:\malebody_FaceGen_directory\egm\objs>fileconvert obj-tri "repopmale_heavy" "repopmale_heavy" 

G:\malebody_FaceGen_directory\egm\objs>fileconvert obj-tri "repopmale_short" "repopmale_short" 

G:\malebody_FaceGen_directory\egm\objs>fileconvert obj-tri "repopmale_tall" "repopmale_tall" 

G:\malebody_FaceGen_directory\egm\objs>fileconvert obj-tri "repopmale_thin" "repopmale_thin" 

G:\malebody_FaceGen_directory\egm\objs>REM Delete extensionless files

G:\malebody_FaceGen_directory\egm\objs>DEL *.

G:\malebody_FaceGen_directory\egm\objs>REM Reposition tri files

G:\malebody_FaceGen_directory\egm\objs>MOVE *.tri ..\tris\
G:\malebody_FaceGen_directory\egm\objs\repopmale_base.tri
G:\malebody_FaceGen_directory\egm\objs\repopmale_fit.tri
G:\malebody_FaceGen_directory\egm\objs\repopmale_heavy.tri
G:\malebody_FaceGen_directory\egm\objs\repopmale_short.tri
G:\malebody_FaceGen_directory\egm\objs\repopmale_tall.tri
G:\malebody_FaceGen_directory\egm\objs\repopmale_thin.tri
        6 file(s) moved.

G:\malebody_FaceGen_directory\egm\objs>cd ..\

G:\malebody_FaceGen_directory\egm>REM

G:\malebody_FaceGen_directory\egm>REM ***Build EGM***

G:\malebody_FaceGen_directory\egm>REM

G:\malebody_FaceGen_directory\egm>copy tris\*.tri .\
tris\repopmale_base.tri
tris\repopmale_fit.tri
tris\repopmale_heavy.tri
tris\repopmale_short.tri
tris\repopmale_tall.tri
tris\repopmale_thin.tri
        6 file(s) copied.

G:\malebody_FaceGen_directory\egm>call add_morphs.bat

G:\malebody_FaceGen_directory\egm>REM ********          add_morphs.bat             *************************************************************

G:\malebody_FaceGen_directory\egm>REM * This file is where you specify the base and extreme meshes that make up                                *

G:\malebody_FaceGen_directory\egm>REM * the controls of your base statistic. Each line has the following form:                                 *

G:\malebody_FaceGen_directory\egm>REM * addanimatemorph diff input.tri extremeMeshName.tri "Display Name of This Control" InternalMeanFace.tri *

G:\malebody_FaceGen_directory\egm>REM *                                                                                                        *

G:\malebody_FaceGen_directory\egm>REM * Things that you change are as follows:                                                                 *

G:\malebody_FaceGen_directory\egm>REM *    input.tri : -On the first line, this should be the name of your base mesh gr2 (but with a tri extension)

G:\malebody_FaceGen_directory\egm>REM *                -On every line after the first, this should be InternalMeanFace.tri                     *

G:\malebody_FaceGen_directory\egm>REM *    extremeMeshName.tri : the name of the extreme mesh for the control, with a .tri extension           *

G:\malebody_FaceGen_directory\egm>REM *    "Display Name of This Control" : the string displayed to the user (via HSL) that tells what this control does

G:\malebody_FaceGen_directory\egm>REM *      *

G:\malebody_FaceGen_directory\egm>REM * Note that FaceGen requires at least 3 controls. If you don't have that many,                           *

G:\malebody_FaceGen_directory\egm>REM * fill in the remaining control lines with "dummy" controls that have extremeMeshName.tri                *

G:\malebody_FaceGen_directory\egm>REM * set to the same name as your base mesh (with a .tri extension); this will make controls that do nothing.

G:\malebody_FaceGen_directory\egm>REM **********************************************************************************************************

G:\malebody_FaceGen_directory\egm>addanimatemorph diff repopmale_base.tri repopmale_heavy.tri "Heavy" InternalMeanFace.tri

G:\malebody_FaceGen_directory\egm>addanimatemorph diff InternalMeanFace.tri repopmale_thin.tri "Thin" InternalMeanFace.tri

G:\malebody_FaceGen_directory\egm>addanimatemorph diff InternalMeanFace.tri repopmale_fit.tri "Fit" InternalMeanFace.tri

G:\malebody_FaceGen_directory\egm>addanimatemorph diff InternalMeanFace.tri repopmale_short.tri "Short" InternalMeanFace.tri

G:\malebody_FaceGen_directory\egm>addanimatemorph diff InternalMeanFace.tri repopmale_tall.tri "Tall" InternalMeanFace.tri

G:\malebody_FaceGen_directory\egm>tri2egm InternalMeanFace.tri InternalMeanFace.egm
5 diff morphs converted to EGM modes

G:\malebody_FaceGen_directory\egm>ECHO YES   | copy InternalMeanFace.tri "..\customizer_1_1\data\"
        1 file(s) copied.

G:\malebody_FaceGen_directory\egm>ECHO YES   | copy InternalMeanFace.egm "..\customizer_1_1\data\"
        1 file(s) copied.

G:\malebody_FaceGen_directory\egm>ECHO YES   | copy InternalMeanFace.tri "..\ctl\"
        1 file(s) copied.

G:\malebody_FaceGen_directory\egm>ECHO YES   | copy InternalMeanFace.egm "..\ctl\"
        1 file(s) copied.

G:\malebody_FaceGen_directory\egm>del .\tris\*.tri

G:\malebody_FaceGen_directory\egm>del InternalMeanFace.*

G:\malebody_FaceGen_directory\egm>del .\*.tri

G:\malebody_FaceGen_directory\ctl>customCtl InternalMeanFace.egm InternalMeanFace.tri dummy.egt si.ctl

G:\malebody_FaceGen_directory\ctl>copy si.ctl "templateBody.ctl"
        1 file(s) copied.

G:\malebody_FaceGen_directory\ctl>del InternalMeanFace.*

G:\malebody_FaceGen_directory\ctl>if exist ..\facegen_modeller_3_0\nul copy "templateBody.ctl" "..\facegen_modeller_3_0\si.ctl"

G:\malebody_FaceGen_directory\ctl>copy si.ctl ..\fg\
        1 file(s) copied.

G:\malebody_FaceGen_directory\fg>copy ..\ctl\si.ctl .\
        1 file(s) copied.

G:\malebody_FaceGen_directory\fg>BlankFGCoord si.ctl "defaultTemplate.fg"
Read 5 symmetrical geometry controls, 0 asymmetrical geometry controls, and egm basis number 20040219.
Read 3 symmetrical texture controls, 0 asymmetrical texture controls, and egt basis number 0.
Writing 8 controls.
G:\malebody_FaceGen_directory\fg>del si.ctl

-Let's setup this morph data we just generated above in Facegen Customizer.
-To acquire Facegen Customizer, you simply email Facegen support saying you have a HeroCloud license under your name and email.
-Run Customizer.exe from "C:\malebody_FaceGen_directory\customizer_1_1"
-Enter your serial number you received from Facegen support if not already registered.
-Select "New Project". In the dialogue box set the project name and the model set name "malebody", and used "C:\malebody_FaceGen_directory\" as the data directory



-Click Next twice.
-Browse/Add the directory "C:\malebody_FaceGen_directory\customizer_1_1\data\InternalMeanFace.tri" into both fields.



-Click next a few times until you get the the seam vertices screen.



-Click next.
-Click "Start Setup", this can take up to minutes or hours to generate cache files depending on the complexity of your models. It takes about 5-10 minutes on an i5 processor

IMPORTANT: It is very important that you keep your body morph data and your head morph data in separate folders, otherwise Customizer will get confused.



Preparing your head morph data files.

-Copy the folder "template_FaceGen_directory" from "C:\HeroEngine\ArtPipeline\Templates" to C:\.

IMPORTANT, Make sure none of the files are marked as "read only", otherwise the whole process will not work.

-Lets rename the folder "template_FaceGen_directory" to "malehead_FaceGen_directory" for this example.
-Open your game character inside of your 3d application (3ds Max in this example). Make sure your characters head is detached from the body. The head must also be skinned to the skeleton of the game model. Make sure your character is of proper scale for HeroEngine. Your character should be setup similar to the images below.




-Import the "facegen_meanface.obj" model from "C:\HeroEngine\ArtPipeline\Templates\template_FaceGen_directory\customizer_1_1\" into the current scene. IMPORTANT, this tutorial is written for 3dsMax, there is a different meanface OBJ file for Maya due to vertex order being different.
-Rotate, uniform Scale and Translate "InternalMeanFace" until it fits like a mask over your game head model. Reset xform/freeze transform and reset the pivot point to 0,0,0 making sure it still covers the face like a mask. IMPORTANT: DO NOT scale the InternalMeanFace non-uniformly, do not squash, skew or stretch. Also do not edit the vertices. the InternalMeanFace should look similar to the image below once positioned.



Make sure the settings are exact, otherwise the head will get modified on export and will not work.
-Export the head model separately using the settings shown. (If your game model's head mesh is not triangulated, export it as an HGM model then drag and drop it on the file HGM2Obj.exe, located in "C:\HeroEngine\ArtPipeline\HGMToObj" and use the outputted OBJ, instead)



-I named it "male_average_head.obj" in this example. Save the head to C:\malehead_FaceGen_directory\ (you will not be running any scripts during the head setup, so the directory is not as important)

-You must now export the InternalMeanFace separately using the settings shown below. Save the Internalmeanface to C:\malehead_FaceGen_directory\ , I named it "male_meanface.obj" (you will not be running any scripts during the head setup, so the directory is not as important).



-Open up customizer.exe in "C:\malehead_FaceGen_directory\customizer_1_1".
-Create a new project using the settings in the image below for this example.



-Proceed to the next part of the process. Here we will setup the internalmeanface to match your high res male face. When the two models are imported the should look like the image below.



-Proceed by pressing next until you reach the seam setup. Select all of the vertices around the neck.



-Proceed and click "Start Setup". This Takes 2 hours or so on an i5 processor machine.
« Last Edit: Nov 15, 14, 08:34:11 AM by Stadi_Thompson »
Logged

Stadi_Thompson

  • General Accounts
  • *
  • Posts: 324
    • View Profile
Re: Complete Facegen Tutorial
« Reply #1 on: Jul 21, 14, 03:36:47 PM »

PART TWO

How to integrate new BODY parts (example, armor, clothing, accessories)  that morph.

-Adding body parts, armor, clothing and accessories, that morph, is easy once you've finished the above tutorials. Let's start by adding an armor model so the armor can morph with the body data we created in the previous steps. I have a chest armor model that I want to add to my character so the armor can morph as well. I'd skin the armor model to the character and export it in a normal manner as a "dynamic character part" (please check wiki for detailed instruction on how to do so). I named the exported mesh "chestarmor.hgm"

-I then take the exported HGM file "chestarmor.hgm" and drag and drop it on the file HGM2Obj.exe, located in "C:\HeroEngine\ArtPipeline\HGMToObj". Optionally I can export the armor model directly from 3dsMax using these settings listed below



Now you will have a file called "chestarmor.obj"
I prefer to use HGM2Obj.exe as it has a "runOnAllInCurrentDirectory.bat" to batch convert a full directory of dynamic part files. My typical workflow is to batch export all of the Dynamic Character parts into a directory and then run the HGM2Obj batch script on the entire directory.

-Once you have converted chestarmor.hgm to the proper OBJ file, you can set it up in Customizer with my morph data I generated in the first tutorial in the directory C:\malebody_FaceGen_directory\ .

IMPORTANT: It is very important that you keep your body morph data and your head morph data in separate folders, otherwise Customizer will get confused.

-Open up Customizer.exe  and click "Load Project", navigate to C:\malebody_FaceGen_directory\customizer_1_1
-You should look similar to the dialog box below



-Click on "malebody" and select open.
-Next click on "Geometry Integration"
-Click on "Add", you will see a dialog box similar to the image below



-Click "Browse" and select the chest armor OBJ file you created in the previous steps named "chestarmor.obj"
-For the "Model Name" and "Output File" type in "chestarmor", then click "Done".
-You will now see the chest armor piece added to the list.
-Once you are ready click "Start Integration", this will create a morph file called an EGM file which HeroEngine can read. The EGM file will be exported to C:\malebody_FaceGen_directory\customizer_1_1\projmalebody\csammalebody and named chestarmor.egm.

IMPORTANT: You must add all of your body parts including your bare head, bare chest, bare feet, bare lower body. The chest armor was just an example on how to add an additional part other than your characters base bare body. My Customizer list for the body looks like this



Note, you will need every single character part to be added to the body's project list, as the body will morph head data as well. Example, if your character has a beard although the beard is head data, the beard needs to know to move upward if the body is morphed to "Tall" and downward if the body is morphed to "Short". In short, every single dynamic part will need to be added to the body's project list in Customizer.


How to integrate new HEAD parts (example, heads, beards, hats, eyes and mouth) that morph.


Adding heads, beards, hats, eyes and mouth that morph, is easy once you've finished the above tutorials. Let's start with adding the characters head. We are going to prepare the characters game head for HeroEngine, I'd skin the character head to the skeleton and export it in a normal manner as a "dynamic character part" (please check wiki for detailed instruction on how to do so). I named the exported mesh "main_head.hgm"

I then take the exported HGM file "main_head.hgm" and drag and drop it on the file HGM2Obj.exe, located in "C:\HeroEngine\ArtPipeline\HGMToObj". Optionally I can export the head model directly from 3dsMax using these settings listed below



Now you will have a file called "main_head.obj"
I prefer to use HGM2Obj.exe as it has a "runOnAllInCurrentDirectory.bat" to batch convert a full directory of dynamic part files. My typical workflow is to batch export all of the Dynamic Character parts into a directory and then run the HGM2Obj batch script on the entire directory.

Once you have converted main_head.hgm to the proper OBJ file, you can set it up in Customizer with my morph data we generated in the first tutorial in the directory C:\malehead_FaceGen_directory\ (not malebody directory).

Note: Always run customizer.exe out of the directory you are working from, otherwise it gets confused. Example, do not run customizer.exe from the body directory when working on the head morph data.

-Open up Customizer.exe from the head directory (C:\malehead_FaceGen_directory\customizer_1_1\) and click "Load Project", navigate to C:\malehead_FaceGen_directory\customizer_1_1
-Click on the "malehead" and select open.
-Next click on "Geometry Integration".
-Click on "Add", you will see a dialog box similar to the image below



-Click "Browse" and select the head OBJ file you created in the previous steps named "main_head.obj"
-For the "Model Name" and "Output File" type in "main_head".

IMPORTANT: This is a little bit different from Body setup in the previous tutorial.

-For the main head and any other head variations that have a seam that connects with the body, you must specify the "# of Neck Seam Vertices". Next to "# of Neck Seam Vertices", Click "Assign".
-You must select the verticies where the neck seams meet. It should look like the image below,
-Click OK once they are all selected. Then click "Done"
-You will now see the head model added to the list along with the number of vertices.

Note: This only needs to be done with the head models, thing like hair, eyes, helmets etc, do not need to have the seam vertices set.

IMPORTANT: You only need to add head accessories to the head's customizer list, example eyes, hair, helmets, body parts, tlike chest armor etc will not need to be added to the head's Customizer list.

-Once you are ready click "Start Integration", this will create a morph file called an EGM file which HeroEngine can read. The EGM file will be exported to C:\malehead_FaceGen_directory\customizer_1_1\projmalehead\csammalehead and named main_head.egm.


Character setup in the engine

Be sure to read up on the HeroEngine wiki on how to upload your characters and your setup characters script files.

To setup your character's files please refer to this wiki entry:
http://wiki.heroengine.com/wiki/Dynamic_Characters_Tutorial

To setup your characters scripts inside of HeroEngine refer to these wiki entry:
http://wiki.heroengine.com/wiki/Facegen_Dat_File_Reference
http://wiki.heroengine.com/wiki/Dynamic_Char_Spec
« Last Edit: Jul 21, 14, 03:44:08 PM by Stadi_Thompson »
Logged

Stadi_Thompson

  • General Accounts
  • *
  • Posts: 324
    • View Profile
Re: Complete Facegen Tutorial
« Reply #2 on: Jul 21, 14, 03:37:19 PM »

PART THREE

Here are examples of what my .par file and facegen.dat file looks like for both the body and head. These do not relate to the file names used in the tutorials, but only serve as reference:

Facegen.dat file:

Code: [Select]
!
! FaceGen Specification
!
[SETTINGS]
  .Name=facegen.dat
  .Folder=character\dynamic_2\repopmale1\facegen\
  Version=1
[CONTROLS]
!  This section specifies the base statistics that are in use by this character specification.

!  The available names for base statistics are as follows:
!     Head - the statistical model that provides the 80 or so human face shape controls, included with all FaceGen licenses
!     Body - your own custom statistic that deals with whole body transformations, such as beer bellies, muscularity, and anything else that is not head-specific. Skeletal morphing-related controls go here, too.
!     CustomHead - since Singular Inversions hasn't provided the source material for the Head statistic, you must create and modify this custom statistic to implement any face-related controls you desire (including non-human racial morphing)
!
!  Each base statistic is specified in the following manner:
!
!  {Base Statistic Name}
!     File=pathToCtl\example.ctl
!     DefaultCoord=pathToCoord\defaultExample.fg
!     Control Name=keyword string goes here
!
!  where the properties are:
!     File - path to the .ctl file that holds the control names for the statistic
!     DefaultCoord - path to the .fg file that holds the default state of the statistic (i.e. the "saved version" of the mean head that you can apply to a character to make it look like the mean; this is needed for new characters)
!     keywords - an optional keyword for each control in the statistic. Keywords are mainly used for passing information to user interface scripts via HSL, but are also needed for skeletal morphing.
!         -Skeletal morph-related controls must have a keyword containing "skeleton:skeletonName" where skeletonName is the name in brackets in the .dyc file (i.e. SkeletalMorph[skeletonName]). This hooks a corresponding mesh transform up to a skeletal morph.
 {Head}
  File=Character\Dynamic_2\repopmale1\facegen\head.ctl
  DefaultCoord=Character\Dynamic_2\repopmale1\facegen\head.fg
 
  Gender (Geometry)=type:both;path:basic;index:1;name:Gender Features;order:1;min:-4;max:0;labels:masculine,feminine;
  Age (Geometry)=type:both;path:basic;index:2;name:Age;order:2;min:15;max:65;labels:young,old;
! Caricature (Geometry)=handled:ignore;type:both;path:basic;index:3;name:Deformation;order:3;min:0;max:0;labels:normal,bizarre;
  Asymmetry (Geometry)=handled:ignore;type:both;path:basic;index:4;name:Asymmetry;order:4;min:0;max:4;labels:symmetrical,asymmetrical;
  Brow Ridge - high / low=type:shape;path:face.forehead;min:-10;max:10;
  Brow Ridge Inner - up / down=type:shape;path:face.forehead;min:-10;max:10;
  Brow Ridge Outer - up / down=type:shape;path:face.forehead;min:-10;max:10;
  Cheekbones - low / high=type:shape;path:face.cheekbones;min:-10;max:10;
  Cheekbones - shallow / pronounced=type:shape;path:face.cheekbones;name:Cheekbones - protrusion;min:-10;max:10;
  Cheekbones - thin / wide=type:shape;path:face.cheekbones;min:-10;max:10;
  Cheeks - concave / convex=type:shape;path:face.cheeks;min:-10;max:10;
  Cheeks - round / gaunt=type:shape;path:face.cheeks;min:-10;max:10;
  Chin - forward / backward=type:shape;path:face.chin;min:-10;max:10;
  Chin - pronounced / recessed=type:shape;path:face.chin;min:-10;max:10;
  Chin - retracted / jutting=type:shape;path:face.chin;min:-10;max:10;
  Chin - shallow / deep=type:shape;path:face.chin;min:0;max:10;
  Chin - small / large=type:shape;path:face.chin;min:-10;max:10;
  Chin - tall / short=type:shape;path:face.chin;min:-10;max:10;
  Chin - wide / thin=type:shape;path:face.chin;min:-10;max:10;
  Eyes - down / up=type:shape;path:eyes.eyes;min:-10;max:10;
  Eyes - small / large=type:shape;path:eyes.eyes;min:-10;max:10;
  Eyes - tilt inward / outward=type:shape;path:eyes.eyes;min:-5;max:10;
  Eyes - together / apart=type:shape;path:eyes.shape;eyes:-5;max:10;
  Face - brow-nose-chin ratio=type:shape;path:face.face shape;min:0;max:10;
  Face - forehead-sellion-nose ratio=type:shape;path:face.face shape;name:forehead-sellion-nose ratio;min:-10;max:10;
  Face - heavy / light=type:shape;path:face.face shape;min:-3;max:3;
  Face - round / gaunt=type:shape;path:face.face shape;min:-5;max:5;
  Face - thin / wide=type:shape;path:face.face shape;min:-10;max:10;
  Forehead - small / large=type:shape;path:face.forehead;min:-3;max:3;
  Forehead - tall / short=type:shape;path:face.forehead;min:-10;max:10;
  Forehead - tilt forward / back=type:shape;path:face.forehead;min:-10;max:10;
  Head - thin / wide=type:shape;path:face.forehead;min:-3;max:3;
  Jaw - retracted / jutting=type:shape;path:face.jaw;min:-5;max:10;
  Jaw - wide / thin=type:shape;path:face.jaw;min:-5;max:5;
  Jaw-Neck slope high / low=type:shape;path:face.jaw;min:-10;max:0;
  Jawline - concave / convex=type:shape;path:face.jaw;min:-10;max:3;
  Mouth - drawn / pursed=type:shape;path:mouth.mouth;min:-10;max:10;
  Mouth - happy / sad=type:shape;path:mouth.mouth;min:-10;max:10;
  Mouth - Lips deflated / inflated=type:shape;path:mouth.lips;name:lips deflated / inflated;min:-10;max:5;
  Mouth - Lips large / small=type:shape;path:mouth.lips;name:lips large / small;min:-5;max:5;
  Mouth - lips puckered / retracted=type:shape;path:mouth.lips;name:lips puckered / retracted;min:-10;max:10;
  Mouth - lips thin / thick=type:shape;path:mouth.lips;name:lips thin / thick;min:-5;max:5;
  Mouth - protruding / retracted=type:shape;path:mouth.mouth;min:-10;max:10;
  Mouth - tilt up / down=type:shape;path:mouth.mouth;min:-10;max:10;
  Mouth - underbite / overbite=type:shape;path:mouth.mouth;min:-10;max:10;
  Mouth - up / down=type:shape;path:mouth.mouth;min:-10;max:10;
  Mouth - wide / thin=type:shape;path:mouth.mouth;min:-10;max:10;
  Mouth-Chin distance - short / long=type:shape;path:mouth.mouth;name:Mouth to Chin distance;min:-10;max:10;
  Nose - bridge shallow / deep=type:shape;path:nose.nose;min:-5;max:5;
  Nose - bridge short / long=type:shape;path:nose.nose;min:-5;max:5;
  Nose - down / up=type:shape;path:nose.placement;min:-7;max:7;
  Nose - flat / pointed=type:shape;path:nose.nose;min:-5;max:5;
  Nose - nostril tilt down / up=type:shape;path:nose.nose;min:-5;max:5;
  Nose - nostrils small / large=type:shape;path:nose.nose;min:-5;max:5;
  Nose - nostrils wide / thin=type:shape;path:nose.nose;min:-7;max:7;
  Nose - region concave / convex=type:shape;path:nose.placement;name:nose - concave / convex;min:-10;max:10;
  Nose - sellion down / up=type:shape;path:nose.placement;min:-10;max:10;
  Nose - sellion shallow / deep=type:shape;path:nose.nose;min:-7;max:7;
  Nose - sellion thin / wide=type:shape;path:nose.nose;min:-10;max:10;
  Nose - short / long=type:shape;path:nose.nose;min:-10;max:10;
  Nose - tilt down / up=type:shape;path:nose.nose;min:-10;max:10;
  Temples - thin / wide=type:shape;path:face.face shape;min:-10;max:10;
! Asymmetry starts here
  Brow Ridge - forward axis twist=type:shape;path:face.forehead;min:-6;max:6;
  Cheekbones - protrusion asymmetry=type:shape;path:face.cheekbones;name:Cheekbones - asymmetry;min:-6;max:6;
  Chin - chin axis twist=type:shape;path:face.chin;min:-6;max:6;
  Chin - forward axis twist=type:shape;path:face.chin;;min:-6;max:6;
  Chin - transverse shift=type:shape;path:face.chin;min:-6;max:6;
  Eyes - height disparity=type:shape;path:eyes.shape;min:-6;max:6;
  Eyes - transverse shift=type:shape;path:eyes.shape;min:-6;max:6;
  Face - coronal bend=type:shape;path:face.face shape;min:-6;max:6;
  Face - coronal shear=type:shape;path:face.face shape;min:-6;max:6;
  Face - vertical axis twist=type:shape;path:face.face shape;min:-6;max:6;
  Forehead - forward axis twist=type:shape;path:face.forehead;min:-6;max:6;
  Mouth - corners transverse shift=type:shape;path:mouth.mouth;min:-6;max:6;
  Mouth - forward axis twist=type:shape;path:mouth.mouth;min:-6;max:6;
  Mouth - transverse shift=type:shape;path:mouth.mouth;min:-6;max:6;
  Mouth - twist and shift=type:shape;path:mouth.mouth;min:-6;max:6;
  Mouth-Nose - coronal shear=type:shape;path:mouth.mouth;min:-6;max:6;
  Mouth-Nose - transverse shift=type:shape;path:mouth.mouth;min:-6;max:6;
  Nose - bridge transverse shift=type:shape;path:nose.nose;min:-6;max:6;
  Nose - frontal axis twist=type:shape;path:nose.nose;min:-6;max:6;
  Nose - sellion transverse shift=type:shape;path:nose.placement;min:-6;max:6;
  Nose - tip transverse shift=type:shape;path:nose.nose;min:-6;max:6;
  Nose - transverse shift=type:shape;path:nose.placement;min:-6;max:6;
  Nose - vertical axis twist=type:shape;path:nose.nose;min:-6;max:6;
  Nose Region - frontal axis twist=type:shape;path:nose.nose;min:-6;max:6;
  Nostrils - frontal axis twist=type:shape;path:nose.nose;min:-6;max:6;
  Nostrils - transverse shift=type:shape;path:nose.nose;min:-6;max:6;
 
 

 {Body}
  File=Character\Dynamic_2\repopmale1\FaceGen\Body\templateBody.ctl
  DefaultCoord=Character\Dynamic_2\repopmale1\FaceGen\Body\defaultTemplate.fg
  Base=skeleton:Base
  Heavy=skeleton:Heavy
  Thin=skeleton:Thin
  Fit=skeleton:Fit
  Short=skeleton:Short 
  Tall=skeleton:Tall






[SAMS]
! A SAM is a grouping of EGM and TRI files mapped to a specific GR2 file.
!
! Specify a SAM in the following form:
!
!  samName
!     EGM(head)=character\dynamic_2\human\male\facegen\head\head_male.egm
!     EGM(customhead)=character\dynamic_2\human\male\facegen\customhead\head.egm
!     EGM(body)=character\dynamic_2\human\male\facegen\body\head.egm
!     TRI=character\dynamic_2\human\male\facegen\head\head_male.tri
!     GR2=character\dynamic_2\human\male\head.gr2
!     RecalculateNormals=true
!
! The properties are defined as follows:
!   samName - an arbitrary name for the SAM, for your reference
!   EGM - describes paths to the EGMs that affect the GR2 associated with this SAM. Specify which base statistc this SAM applies to by putting the base statistic name in parentheses, like so: EGM(baseStatisticName)=pathToEGM\foo.egm
!   TRI - path to the TRI file associated with this mesh. TRI files are only necessar if you have any morphs (non-persisted morphs, i.e. facial expressions) specified in FaceGen Customizer for this mesh
!   GR2 - path to the .gr2 file that this SAM specifies statistics for
!   RecalculateNormals - true or false; causes the normals to be recalculated for the mesh whenever the user changes its FaceGen-related deformation. Use this on meshes with fine geometric detail that have controls that modify their vertex positions at a fine level, causing the vertex normals to get out of sync after a deformation. Generally unnecessary for any meshes besides a head.
!


!///////////////////////////////////////////////////
! head
!//////////////////////////////////////////////////
 
  head.head
     EGM(head)=character\dynamic_2\repopmale1\facegen\head\rm2_head.egm
     EGM(body)=character\dynamic_2\repopmale1\facegen\body\rm2_head.egm
     GR2=character\dynamic_2\repopmale1\rm2_head.hgm




!////////////////////////////////////////////////////
! eyes_mouth
!/////////////////////////////////////////////////////
 
  eyes_mouth.base
     EGM(head)=character\dynamic_2\repopmale1\facegen\head\eyes_mouth.egm
     EGM(body)=character\dynamic_2\repopmale1\facegen\body\eyes_mouth.egm
     GR2=character\dynamic_2\repopmale1\eyes_mouth.hgm



!////////////////////////////////////////////
! hair
!/////////////////////////////////////////////

   rm_hair_short11
      EGM(head)=character\dynamic_2\repopmale1\facegen\head\rm_hair_lowcut.egm
      EGM(body)=character\dynamic_2\repopmale1\facegen\body\rm_hair_lowcut.egm
      GR2=character\dynamic_2\repopmale1\hair\rm_hair_lowcut.hgm
 


!///////////////////////////////////////
!facial_hair
!////////////////////////////////////////

 facial_hair.moustache_goatee
     EGM(head)=character\dynamic_2\repopmale1\facegen\head\moustache_goatee.egm
EGM(body)=character\dynamic_2\repopmale1\facegen\body\moustache_goatee.egm
     GR2=character\dynamic_2\repopmale1\hair\moustache_goatee.hgm



!/////////////////////////////////////
!helmets
!////////////////////////////////////
 
 helmet.helmet1
     EGM(head)=character\dynamic_2\repopmale1\facegen\head\helmet1.egm
EGM(body)=character\dynamic_2\repopmale1\facegen\body\helmet1.egm
     GR2=character\dynamic_2\repopmale1\helmets\helmet1.hgm


!/////////////////////////////////////////////
! arms
!/////////////////////////////////////////////
 
  arms.bare
     EGM(body)=character\dynamic_2\repopmale1\facegen\body\arms_base.egm
     GR2=character\dynamic_2\repopmale1\arms\arms_base.hgm


!////////////////////////////////////////////
! upper body
!//////////////////////////////////////////////
 
  upper body.bare
EGM(body)=character\dynamic_2\repopmale1\facegen\body\upper_body_base.egm
     GR2=character\dynamic_2\repopmale1\upperbody\upper_body_base.hgm
 
  start.vest
     EGM(body)=character\dynamic_2\repopmale1\facegen\body\start_vest.egm
     GR2=character\dynamic_2\repopmale1\upperbody\start_vest.hgm


!///////////////////////////////////////////
! lower body
!///////////////////////////////////////////

  lower body.bare
     EGM(body)=character\dynamic_2\repopmale1\facegen\body\lower_body_base.egm
     GR2=character\dynamic_2\repopmale1\lowerbody\lower_body_base.hgm

  start.pants
     EGM(body)=character\dynamic_2\repopmale1\facegen\body\start_pants.egm
     GR2=character\dynamic_2\repopmale1\lowerbody\start_pants.hgm


!/////////////////////////////////////////////
! legs
!//////////////////////////////////////////////
 
  legs.bare
     EGM(body)=character\dynamic_2\repopmale1\facegen\body\legs_base.egm
     GR2=character\dynamic_2\repopmale1\legs\legs_base.hgm


  start.boots
     EGM(body)=character\dynamic_2\repopmale1\facegen\body\start_boots.egm
     GR2=character\dynamic_2\repopmale1\legs\start_boots.hgm
   

IMPORTANT: File information, under the {Body} tag in the facegen.dat the lines, they read:

 " File=Character\Dynamic_2\repopmale1\FaceGen\Body\templateBody.ctl
  DefaultCoord=Character\Dynamic_2\repopmale1\FaceGen\Body\defaultTemplate.fg""

Note these two files were generated when running the facegen scripts and can be found in, C:\malebody_FaceGen_directory\fg and C:\malebody_FaceGen_directory\ctl, they were generated by your script .bat files

IMPORTANT  File information, under the {Head} tag in the facegen.dat the lines, they read:
  File=Character\Dynamic_2\repopmale1\facegen\head.ctl
  DefaultCoord=Character\Dynamic_2\repopmale1\facegen\head.fg
 
Note these files came with Customizer and were renamed, I have attached a zip with the two files. (facegen_head.zip attached to post)These files contain the basic morph data for the face defaults.





PAR file:

Code: [Select]
! bang to comment line
! Human Parts definition file
!
[Root]
\Character\Dynamic_2\repopmale1\

[Slots]
!
! The slots are the areas defined for the Human in which various parts can go
!
Head
   Keyword=handled:ignore;
Hair
   Keyword=type:hair;palettes:Hair Color,Shine,Highlights,Accessories;

face_hair
  Keyword=type:face_hair;

eyes_mouth
    Keyword=type:eyes_mouth;palettes:Eye Color;

Head_Gear
 Keyword=type:headgear;

Upper Body
% hides(Neck)

Arms
   Keyword=handled:synced;


Lower Body
   Keyword=handled:synced;

Under Body
   Keyword=handled:synced;

   
Legs
   Keyword=handled:synced;


[Divisions]
Head: Head,Hair,eyes_mouth,face_hair,Head_Gear
Upper Body: Upper Body,Arms,Under Body
Lower Body: Lower Body,Legs

[Parts]
!
! Slot: Part,GR2file
!
!/////////////////////////////////// H E A D ///////////////////////////////////

Head: Head2,Character\dynamic_2\repopmale1\rm2_head.hgm
eyes_mouth: eye_mouth,Character\dynamic_2\repopmale1\eyes_mouth.hgm

!/////////////////////////////////// F A C I A L  H A I R ///////////////////////////////////

face_hair: None,empty
face_hair: moustache_beard 1,Character\dynamic_2\repopmale1\hair\moustache_goatee.hgm


!/////////////////////////////////// H A I R ///////////////////////////////////
Hair: Bald,empty
Hair: Short Style 1,Character\dynamic_2\repopmale1\hair\rm_hair_short1.hgm

!/////////////////////////////////// H E A D  G E A R ///////////////////////////////////
Head_Gear: None,empty
Head_Gear: helmet1,Character\dynamic_2\repopmale1\helmets\helmet1.hgm
   % hides(Hair)
   % hides(face_hair)


!/////////////////////////////////// U P P E R  B O D Y ///////////////////////////////////
Upper Body: Bare,Character\dynamic_2\repopmale1\upperbody\upper_body_base.hgm
Upper Body: Start Vest,Character\dynamic_2\repopmale1\upperbody\start_vest.hgm


!/////////////////////////////////// A R M S ///////////////////////////////////
Arms: Bare,Character\dynamic_2\repopmale1\arms\arms_base.hgm

   
!/////////////////////////////////// L O W E R  B O D Y ///////////////////////////////////
Lower Body: Bare,Character\dynamic_2\repopmale1\lowerbody\lower_body_base.hgm
   % substitutes(Under Body Bottom:None,Undershorts)
Lower Body: Start Pants,Character\dynamic_2\repopmale1\lowerbody\start_pants.hgm


!/////////////////////////////////// L E G S ///////////////////////////////////
Legs: Bare,Character\dynamic_2\repopmale1\legs\legs_base.hgm
Legs: Start Boots,Character\dynamic_2\repopmale1\legs\start_boots.hgm

Previewing in HeroEngine:


Keep an eye on the Error Panel for any errors that might be in your scripts or morph data. Once everything is setup and uploaded, test the morphs inside of HeroEngine by press F5, go to CCS Tab. From there to test Body morphs click on "Skeletal Morphing". To test the Head morphs click on "Character Manager" the the tab "Facegen Shapes"
« Last Edit: Jul 22, 14, 02:17:22 AM by Stadi_Thompson »
Logged

Amanda_Brooks

  • General Accounts
  • *
  • Posts: 514
    • View Profile
    • Heroes and Villains
Re: Complete Facegen Tutorial
« Reply #3 on: Jul 21, 14, 08:24:06 PM »

Thanks for posting his - it'll hopefully be useful for the various projects that are using Facegen - although I also can't help thinking that the process could be automated and streamlined a bit more, either with new HE tools, or with custom tools.
Logged
"Heroes and Villains" - www.heroes-and-villains.com
Facebook: https://www.facebook.com/HeroesAndVillainsMMORPG
Twitter: @Plan_Z_Studios