wiki.sine.space | sinespace

Morph Shapes

From wiki.sine.space
Revision as of 20:57, 11 March 2020 by Lesiar (Talk | contribs) (Creating the Morph Shape)

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


And here, after the changes, is our face morph.

Step 10.jpeg


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

Export FBX From Blender

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.

Step 11.jpeg


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.

Step 12.jpeg


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

Step 13.jpeg


Locate your folder where you exported the modified 2017 Male and import the asset.

Step 14.jpeg


Here our model is now imported into the project.

Step 15.jpeg


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.

Step 16.jpeg


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

Step 17.jpeg


Creating the Vertex Displacement Map

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

Step 18.jpeg


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. Type the name of your morph into the "Original Blendshape" field and untick Incorporate Normal.

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

Step 22.jpeg


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