wiki.sine.space | sinespace

Morph Shapes

From wiki.sine.space
Revision as of 00:23, 12 March 2020 by Lesiar (Talk | contribs) (Prequisites)

Jump to: navigation, search

MORPH SHAPES TUTORIAL

Prequisites

You are expected to have installed Unity and a valid Editor Pack installed correctly ( called SDK on Unity’s Asset Store).

Unity version used for tutorial: 2017.4.36f1

Editor Pack/SDK: 14.415.8463-nightly (shows as "Intended for Unity Version 2017.3"). [Download here.]

See our XMPP Chat Client page for more information.

Creating the Morph Shape

You will be using our avatar model in your 3D modelling tool of choice. You will find it included in our Editor Pack.

Here we use Blender which is free to use. This is the default start scene in Blender.

Delete cube, lights and cameras - we don't need those.

Shot 01 - New Blender scene.jpg


Go to File and Import, then pick FBX.

Shot 02 - Import of our avi.jpg


Here is the import window.

Shot 03 - Locating the avi.jpg


You should see this. Click off and on the model and click the Collections icon here:

Shot 04 - Avi loaded.jpg


Now delete the existing Morph Keys.

Shot 05 - Delete shape keys.jpg


We now add two morph keys - clicking the plus sign. The first will be our 'Basis' and the second our new morph.

While on that new morph, double click to rename

Shot 06 - Create 2 new shape keys.jpg


Now ensure the value is set to 1.

Shot 07 - Rename the morph.jpg


Now switch to Sculting mode.

Shot 08 - Switch to Sculpt mode.jpg


Here is our starting point.

Step 9.jpeg


After my changes here is our face morph.

Shot 09 - the new morph.jpg


That's it for the Blender part. Now we export to FBX.

Export FBX From Blender

Go to File then Export then FBX.

Shot 10 - Export the file.jpg


Make sure your export settings are the same as this. Do ensure !Expermintal! Apply Transform is checked and Bake Animation is unchecked.

Then click Export.

Shot 11 - Export settings.jpg

Import FBX into Unity

Now we switch to Unity. Here we have an empty scene ready and a work folder created called "Morph Tutorial Folder".

You of course, should use your own recognisable name.

Shot 12 - New unity scene.jpg


With this folder selected, right click in the empty right hand pane of your project and select Import Asset.

Shot 13 - Import the new fbx.jpg


Locate your folder where you exported the modified 2017 Male into. First go to Assets.

Shot 14 - Go to folder.jpg


Then go to your work folder and import the model.

Shot 15 - Locate fbx.jpg


Here our model is now imported into the project.

Shot 16 - Model imported.jpg

Checking Our Morph Has Imported

Drag the model into the scene/hierarchy and expand the model to see its child objects. Check the mesh has a skinned renderer and that you

can see your morph name.

Shot 17 - Checking the morph.jpg


Dialling this to 100 will reveal your morph. Leave it set at 100.

Shot 18 - Successful import.jpg

Creating the Vertex Displacement Map

Open the menu item: Sinespace->Tools->Custom Shapes->Create Body Morph Texture

Shot 19 - Creating the displacement map.jpg


Now click into the Assets folder and then into your work folder.

Shot 19a - Locate folder.jpg


You will now see the Create Morph Map dialog box.

Step 21.jpeg


Drag the mesh (from the project) into the top slot.

Put a checkmark into Preview and Overwrite Silently then click Bake Map.

Shot 20 - Drag malebody to slot.jpg


Type the name of your morph into the "Original Blendshape" field.

Shot 21 - Blend Shape field.jpg


Uncheck Incorporate Normal.

Shot 22 - Uncheck normal.jpg


Set preview options.

Shot 23 - Set preview options.jpg


In your project search box, type 2017 and drag the 2017 Male file into the Alternative Avatar slot.

Shot 24 - Alernative Avatar drag.jpg


Click on your work folder in the project and then click Bake Map.

Shot 25 - Bake map.jpg


A preview of your morph will show in the scene. Move the original out of the way to compare that they are the same.

Shot 26 - Worked.jpg


Now click on the new displacement map in your project work folder. Ensure sRGB is off, Read/Write is enabled, Generate Mipmaps off, Wrap Mode is Clamp,

Filter Mode is Point. No compression.

Then click Apply.

Shot 27 - Modify map properties.jpg


You might see some very subtle pastel RGB shadings but Unity cannot show the preview properly for the morph map generated.

Here's what it looks like in Krita.

Step 25.jpeg

Creating The Virtual Good

Now we get to the final step - creating the virtual good. Right click an empty part of the hierarchy and create an empty game object.

Shot 28 - Create empty game object.jpg


Rename your game object to something recognisable. Add a Clothing Item Settings component.

Shot 29 - Add clothing script.jpg


Tick and expand Body Slider. Then drag the generated morph texture into the Vertex Displacement Map slot. Ensure the skeleton is set to Base Male.

Shot 30 - Drag map to slot.jpg


Add a virtual good component.

Shot 31 - Add VG.jpg


Set the type to Clothing and the category to Clothes / Body / Morphs.

Shot 32 - VG 2.jpg


After completing that, drag your item from the hierarchy to your project. Right clik it then select Upload to Sinespace.

Shot 33 - VG3.jpg

The Result

Here's the finished item in world, called "Morph Tutorial" and is available free in the shop.

Step 34.jpeg