wiki.sine.space | sinespace

Morph Shapes

From wiki.sine.space
Revision as of 21:20, 11 March 2020 by Lesiar (Talk | contribs) (Creating the Vertex Displacement Map)

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).


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 double click the Asset folder.

Step 19.jpeg


Then select your work folder. This is where our Morph Displacement Map will be created.

Step 20.jpeg


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 and untick Incorporate Normal.

Shot 21 - Blend Shape field.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.

Step 23.jpeg


Click on your newly generated morph map. Ensure sRGB is off, Read/Write is enabled, Generate Mipmaps off, Wrap Mode is Clamp,

Filter Mode is Point. No compression.

Then click Apply.

Step 24.jpeg


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.

Step 26.jpeg


Rename your game object to something recognisable. Add a Clothing Item Settings component. Ensure the skeleton is set to Base Male.

Tick and expand Body Slider. Then drag the generated morph texture into the Vertex Displacement Map slot.

Step 29.jpeg


Now add a Virtual Good component.

Step 27.jpeg


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

Step 28.jpeg


The Result

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

Step 34.jpeg