Hi everyone, sorry for the lack of updates recently but life has been a bit crazy. I’m still working on the next version of the engine but i thought in the meantime i’d add a tutorial or two to enable people to add more of their own content.

This tutorial will cover how to add a new shape or shapes to an existing rig. For this example we’re going to use the genesis 2 female rig, but really any rig could do this if you have access to the original mesh. Before we start, software you will need:

Unity 5.5 (https://unity3d.com/get-unity/download/archive) (5.6 won’t work just yet, but will in the new release)



Unity Asset Bundle demo from the first tutorial (https://bitbucket.org/Unity-Technologies/assetbundledemo/downloads)



Daz3d + Genesis 2 Female base + genitals (https://www.daz3d.com/)



Some kind of a text editor. I personally use visual studio which comes with Unity as it formats XML for me.



I’m assuming you’ve read and understood the models 101 tutorial found here.

1. Open up Daz studio, load up the genesis 2 female shape and attach the default genitals to it. If you’re unsure how to do any of this the i’d recommend you spend some time learning Daz studio. Lots of good youtube videos on how to do this. Your scene should look like this:

2. Now we need to merge the genitals with the main mesh. To do this we use the ‘Merge Fitted Figure Geometries’ function. Most Daz users won’t have this setup by default. So to add press F3 (or goto the 'window -> workspace -> customize’. Then on the left pane scroll down to 'Geometry Editing’. Select the merge fitted figures. On the right pane select the menu tab and open up main menu and edit. Then drag the left selection to the right pain under edit. This should add the merge function to your edit menu. Click accept and wait for daz to complete the merge.



3. Once done you should see a message in the middle of the screen like the below picture.

We have to remove the old genitals, so in the scene tab find the item name 'Genesis2FemaleGenitalia’ and press delete. Now we have the base mesh that we can use with the current G2F asset in the sandbox.



4. The sandbox allows you to add one shape or many shapes at a time. I’m going to cover one shape now and then later add on how you do many shapes. Now we simply apply the shape we want, for this tutorial i’m going to apply Victoria 6 as per my morphs. You can apply any shape you want to apply, but ones that change the overall height of the character are a bit more challenging(i’m fixing this in the new version of the engine).



5. Now we can export this mesh to an OBJ file and import into Unity. So goto File -> Export, find a directory to store the file and make sure the 'Save As Type’ is set to Wavefront Object. In the export option dialog make sure the settings are exactly as shown below. Press export!



6. Open up unity and make a new project. Find the exported OBJ and MTL files and import them into the project. Also import the unity asset bundle demo package. Unity should look something like this.



7. Select the mesh in unity and under the import settings make sure that 'Keep Quads’ is switched on. Now make a new asset bundle for your mesh and we should be pretty much done in unity. Right click on the mesh and select 'Asset Bundles -> Build AssetBundles’.



8. We now have a compiled mesh ready to be added to the sandbox, we just need a config file to go with it. To make things easier you can download an example config here. Simply search and replace BUNDLE with the name of your bundle, in this case v6. Search and replace MODEL with the name of your model file in this case v6. Search and replace NAME with the name of your morph in this case Victoria6. The result should look something like this.



Now let me briefly explain the model config is doing.

<Core>

<Name>Genesis 2 Female</Name>

<Bundle>rigs/g2f</Bundle>

<Model>g2f.fbx</Model>

<Mesh>Genesis2Female.Shape</Mesh>

<LocalScale>1.0</LocalScale>

<Gender>Female</Gender>

</Core>

This section allows the sandbox to know that this shape is related to the current G2F rig. This has to be identical to the existing rig for it to work correctly. The sandbox merges all these configs into one big config per rig.

<MeshExtensions>

<MeshExtension>

<BundleName>rigs/v6</BundleName>

<MeshName>Genesis2Female</MeshName>

<ModelName>v6.obj</ModelName>

<MorphName>Victoria6</MorphName>

<Scale>1.00</Scale>

</MeshExtension>

</MeshExtensions>

This part tells the sandbox where the actual mesh is and how to load it into the game. It also tells us if the mesh is smaller or larger than the original rig using the scale value.

<ShapeExtension>

<Name>Victoria6</Name>

<CharacterMorph>Victoria6</CharacterMorph>

<FullBody>true</FullBody>

<Scale>1.00</Scale>

</ShapeExtension>

This section tells the sandbox that this shape is actually a morph and can be added as a blendshape to the existing rig. Again we can tell the sandbox if the morph itself needs to have scale applied. The fullbody flag here tells the clothing and hair system if it it needs to adjust the shape of items to this morph, in this case yes it does.

<CharacterMorphs>

<CharacterMorph>

<Name>Victoria6</Name>

<MorphTarget>Other</MorphTarget>

<BlendShapes>

<BlendShape>

<ShapeKey>Victoria6</ShapeKey>

<MaxValue>100</MaxValue>

</BlendShape>

</BlendShapes>

</CharacterMorph>

</CharacterMorphs>

This section tells the sandbox how to name and add the morph. While it seems like a duplication it’s very relevant when it comes to the import of many morphs at once.

That’s pretty much it. Drop the config file in the StreamingAssets directory and the asset bundle in the StreamingAssets/rigs directory and you should be good to go. You’ll find the new shape slider under the shapes tab(looks like a scalpel) when you’ve selected G2F.

One thing to consider when adding new shapes is that the clothing and hair system has to re-compute morphs for all full body shapes. This can be quite a compute heavy task the first time you load a new morph. So expect an extra 3-5 mins of wait when starting the engine with a new morph for the first time. Once loaded once it’ll be cached for the future.