Creating morph targets for custom cloth meshes
From RexWiki
This tutorial requires you to have Singular inversions’ Facegen customizer (http://www.facegen.com/customizer.htm ). Last steps of the tutorial are 3D Studio Max specific but most of the other 3D packages use quite similar process for morph targets (also known as blend shapes in other 3D programs).
You also need the following tools from Singular inversions:
fileconvert, addanimatemorph, tri2egm and egm2tri
There is a section for using customizer for entire bodies here (see Using Customizer for entire bodies): http://www.facegen.com/customizer_help.htm
For Realxtend avatars we used a slightly modified process from the tutorial above.
The process is quite slow if you type all the commands by hand so it may be a good idea to create bat files for your avatar if you’re going to make many cloth pieces. This will speed up the process significantly. However it is a good idea to make sure everything works correctly with a test cloth.
Presteps:
- Create a copy of your customizer folder and name it to something else. I’ll call it BodyCustomizer during this tutorial
- The Singular inversion’s tutorial mentions using a special CustomizerBig.exe. You can try using it but it may cause some trouble on older machines and may not work with diff –type morphs. The basic customizer.exe should work just fine for this tutorial.
- Delete all folders with src_ and proj prefixes. You should be left with data folder and some other files.
3D-model
- Export your avatar model that you want to have your cloths on in .obj file format. This will be the base for all morphs.
- Export every morph target in .obj format.
- convert all morhp targets and the basemesh from .obj to .tri format using the fileconvert tool. Example > fileconvert obj-tri basemesh
- Add morph targets to your basemesh using the addanimatemorph tool. Use diff –morph type.
Example >addanimatemorph diff basemesh.tri fatBody.tri "make fatter" baseWithMorphs.tri )
- Add rest of the morph targets on the same tri file. Example >addanimatemorph diff baseWithMorphs.tri thinBody.tri "make thinner)
- Now you should have a tri file that contains all the morph targets you exported (baseWithMorphs.tri in this example)
- You can check the morphs using the facegen demo. Launch it from the command line >facegendemo baseWithMorphs.tri. Remember to make sure that you’ve added facegen to your windows’ PATH so the demo launches works from the commandline.
- Convert your tri file that contains all the morphs to a .egm file using the tri2egm tool. Example > tri2egm baseWithMorphs.tri baseWithMorphs.egm
- Make copies of your original basemesh.tri and baseWithMorphs.egm files
- Rename these copied files to InternalMeanFace.egm and InternalMeanFace.tri
- Copy both of the files to your new Customizer’s /data path (for example bodyCustomizer/data/)
FaceGen Customizer
- Open Customizer, create a new project and name it
- Click next until the programs asks for a meanface model
- Choose your InternalMeanFace.tri that you made in the previous steps to the ‘re-scaled/re-oriented mean face’
- Use the same InternalMeanFace.tri for the ‘imported registered models’ setting
- Click next until the program asks for seam vertex. Don’t add any seams and just click next
- Click next until the programs wants to create cache files. Click Start Integration button and wait until the processing is finished. This should take about 5-10 minutes per morph target
- Go to Geometry integration and add your cloths using the add button. Remember to use skin material type for all clothes.
- Once you’ve added all the clothes you want into the list, click the Start Integration button to process them. You can also add more clothes later if you want. You’ll just need to process them again
- After the processing there should be a new folder called csamYouProjectName. It should have .tri .fr3d and .egm files for each of the cloths you processed. We’ll only need the .tri and .egm files.
Morph targets to 3D Studio Max
- Create new morphs files for the cloths using > egm2tri shirt.tri shirt.egm shirtMorphed.tri
- Make sure that the new .tri file contains morphs using the demo. Example > facegendemo shirtMorphed.tri Morphs should be in the ‘Morph’ tab. Names of the morphs are not usually correct anymore.
- Convert each of the morphs back to .tri files using the FgMorph tool. For example > Fgmorph –d 0 1 shirtMorphed.tri shirtFatMorph.tri.
In the example
–d = diff morph type
0 = morph target’s ID. You can print out all the IDs by typing > Fgmorph yourfilename.tri
1 = at what percentage the morph is used. 1 equals 100% and 0 equals 0%
- Repeat the previous step to all of your morph targets
- Convert each of the morphtargets back to .obj so your 3D modeling package can open them. For example > fileconvert tri-obj shirtFatMorph shirtFatMorphOBJ
- Now you can launch 3D studio max and import each of the morphs back to your base mesh scene (the same scene that was used for exporting the base and its morphs). If you’re using 3D studio, you can use the Morpher modifier and add all the imported morph targets to it.
Now you should have a scene where you have a base avatar and cloth models with same morph targets. The clothes can now be exported to RealXtend. Just remember to make sure that your exporter has morph target export enabled. If you want to use the RealXtend body modification sliders then your morphs should be named correctly.
RealXtend basic male and female uses the following names:
fat-arms-lower
fat-arms-upper
fat-legs-lower
fat-legs-upper
fat-body-lower
fat-body-upper
thin-arms-lower
thin-arms-upper
thin-legs-lower
thin-legs-upper
thin-body-lower
thin-body-upper
muscular-arms-lower
muscular-arms-upper
muscular-legs-lower
muscular-legs-upper
muscular-body-lower
muscular-body-upper
Female has also the following extra morphs:
shape-hip-wide
shape-hip-narrow
shape-breasts-small
shape-breasts-large
shape-body-pear
|