Skip to main content
Version: 4.55.1

Body Morph Guide

The Body Morph Template allows you to bring in your own custom mesh which the user body can morph into. The template comes with several examples that you can play with.

Template Walkthrough

The Body Morph feature allows you to morph the body of a user into another custom mesh which has the same UV map as the standard Body Mesh.

​​In the Objects panel, you’ll find five examples of how you can use this external face mesh feature. You can enable or disable a template by clicking on the checkbox next to them.

You can get the external body mesh in the Body Mesh guide. You can modify it in the 3D editor software of your choice.

Gorilla – Body Morph with Face Blendshapes

In this example, the external body mesh used is a modified version of the standard body mesh model. Rather than using a completely new mesh, this external body mesh has been modified in a 3D modeling software to look like a gorilla’s body. It also uses the standard Lens Studio Skeleton that is built for 3D Body Tracking.

Additionally, a gorilla head is attached to the skeleton of the external body mesh. There are a number of blendshapes associated with this mesh that can be driven by the user’s face.

To see these blendshapes, you will need to select the gorilla head;

  1. in the Objects panel by clicking on Camera.
  2. Select Examples EXPLORE_ME
  3. Select → 01 - External Mesh With Face Blendshapes
  4. Select Gorilla [TRY_ME]
  5. Select 3D Body Tracking
  6. Select gorilla_body, then select Armature
  7. Select Character1_Hips
  8. Select Character1_Spine
  9. Select Character1_Spine1
  10. Select Character1_Spine2
  11. Select Character1_Neck
  12. Select Character1_Head
  13. Select gorilla_head
  14. Finally, select head.

These blendshapes are controlled by the Expression Controller.js script, which reads the user’s face and applies.

To manually modify the blendshapes in order to see what each blendshape controls, navigate to;

  1. Camera first, then select Examples [EXPLORE_ME]
  2. Select 01 - External Mesh With Face Blendshapes
  3. Select Gorilla [TRY_ME]
  4. Disable the SceneObject titled Expression Controller - Gorilla.

Now, when the gorilla’s head mesh is selected in the Objects panel, the blendshapes will be manually adjustable.

Frog – Full Body Mesh With Face Blendshapes

In this example, a Full Body Mesh is used instead of an External Body Mesh. In the Objects panel, navigate to;

  1. Examples [EXPLORE_ME], then select 02 - Full Body Mesh With Face Blendshapes
  2. Select Frog [TRY_ME]
  3. Select 3D Body Tracking
  4. Select Frog Body Mesh
  5. Then, in the Inspector panel, right click on “Frog Full Body Mesh”.
  6. Finally, select “Select”

You are able to change what Body Meshes are visible by replacing the mesh in the “External Mesh” field.

Ostrich & Wolf – External Mesh With Fur And Face Blendshapes

In this example, an External Body Mesh is used. Unlike the previous two examples, this example demonstrates how additional elements can be added to the External Body Mesh to create effects such as fur or feathers.

Elephant – Full Body Mesh with Physics

In this example, a Full Body Mesh is used. Additionally, the Face Mesh leverages the Chain Physics Controller to add physics to the Elephant’s ears and trunk.

Make Your Own Full Body Mesh using Body Morph

This section will explain how to import a custom External Body Mesh and apply it to the user’s body.

In order to upload your own custom External Body Mesh, first download the external body mesh 3D file and import it into the 3D modeling software of your choice.

For this guide, we will be using Blender but you may use any other 3D modeling software of your choice.

​​In order for the External Body Mesh Lens to work properly, we need to adjust the Body Mesh without altering any of the 3D model’s UVs. This can be done in a multitude of ways, but for the purposes of this guide, we will be using Blender’s sculpting tools.

First, if you look at the scene hierarchy, you will see that the head, body, and hands are all separate objects. For ease of editing, let’s join all of these individual meshes into one.

In Blender, this can be accomplished by selecting all of the meshes (this can be done quickly by pressing A on your keyboard) and then pressing CTRL + J (Windows) or CMD + J (mac) to join the meshes. Remember, you can always press F3 and search for any operation you wish to perform on a mesh!

Before continuing, we need to make sure there are no overlapping vertices. Select your mesh, and press tab to enter Edit Mode. Press A to select everything and then press M to merge vertices, and then select “By Distance”.

Now that we have one mesh object, we can perform any number of modifications to it. For this guide, we will increase the size of the Body Mesh’s chest, arms, and stomach.

Before we start changing the Body Mesh, let’s add some more detail to the mesh so that our edits will be more visible. We will do this by adding extra vertices to the mesh using the “Subdivision Surface” modifier.

  1. Select the body mesh, then click on the Modifiers tab (it looks like a wrench) in the Properties panel
  2. Click on “Add Modifier”
  3. Select “Subdivision Surface”.
  4. Lastly, click on the dropdown at the top-right of the “Subdivision Surface” panel that was created and select “Apply”.

You now have a higher-resolution mesh!

Now that we have our Body Mesh ready to edit, let’s switch over to Blender’s Sculpting tab, which can be found at the top of your Blender workspace.

In order to increase the size of the chest, arms, and stomach we will use the “Inflate Tool”.

  1. Select the “Inflate Tool” from the left-hand panel.
  2. After selecting the “Inflate” brush, at the top of the viewport, set “Radius” to 200px,
  3. Set the “Strength” to 1, and turn on symmetry along the X-axis.

Now, using the “Inflate” brush, left-click and drag over the mesh to start editing the mesh.

Lastly, we need to export our creation as a new file we can send to Lens Studio. To do this, click “File” → “Export” → “FBX”

Congrats! You now have an External Body Mesh ready to be imported into Lens Studio.

Applying the external body mesh to a Full Body Mesh

Switch over to Lens Studio and in the Menu click on “File → Import”. Navigate to where the custom External Body Mesh is saved and double click it to begin the importing process.

Once the External Body Mesh is added to the scene, let’s begin the process of applying it to a Full Body Mesh.

Adding full body tracking

  1. First, disable the SceneObject titled “Examples [EXPLORE_ME]”.
  2. Next, create a new SceneObject that is a child of the “Camera”.
  3. Name it “My Full Body Mesh”4. With the new SceneObject selected in the Objects panel, click the plus sign in the top left corner of the Objects panel and add a “Full Body Tracking” Object, which can be found under “Object Tracking 3D”.

Connect the external body mesh to the body tracker

With “Full Body Tracking” selected, perform the following;

  1. Go to the Inspector panel and make sure that “Object Index” is set to 0.
  2. Next, in the “Resources” panel, click on the plus button in the top left corner and select “Full Body Mesh”.
  3. Rename this resource to “My Full Body Mesh”.
  4. With “My Full Body Mesh” selected, go to the Inspector panel and drag-and-drop the custom External Body Mesh into the “External Mesh” dialog box. You now have a Full Body Mesh set up with your custom External Body Mesh.

Visualize the custom mesh in Lens Studio

Now, let’s get the customized Full Body Mesh visible in the scene.

  1. First, select the “3D Body Tracking” asset in the Objects panel.
  2. Click the plus button in the top-left corner.
  3. Add an “Empty Mesh”, and set it to be a child of the “3D Body Tracking" SceneObject.
  4. With the “Empty” SceneObject selected, go to the “Inspector” panel and drag-and-drop the “My Full Body Mesh” asset into the “Mesh” dialog box.
  5. Rename the “Mesh” SceneObject to “My Full Body Mesh”.

Congrats! You should now see your custom External Body Mesh being driven by the user’s pose. In order to get the user’s body texture applied to the mesh, simply replace the Render Mesh Visual’s Material slot with “Body_Texture”.

This process is good for importing a 3D mesh that doesn’t have a skeleton attached to it.The following section will go over a different method of importing an External Body Mesh into the scene.

Make Your Own External Body Mesh With Body Morph

The following section will demonstrate how to import a custom 3D mesh into the Body Morph template and apply it to the user using a Full Body Mesh.

  1. First, in Lens Studio navigate to the “Asset Library” and search for “Stick Figure 3D Model”.
  2. Import the 3D model.
  3. In the Objects panel, disable the “My Full Body Mesh” SceneObject.
  4. Drag and drop the “StickFigure_3DModel” asset into the Objects panel.
  5. Make sure that the “StickFigure_3DModel” is a child of the “3D Body Tracking” asset and the Stick Figure’s position is set to 0,0,0.
  6. Next, click on the “3D Body Tracking” SceneObject in the Objects panel.
  7. In the “Inspector” panel, click on the button titled “Match Hierarchy”. A dialog box will appear showing all the child SceneObjects of the “3D Body Tracking” SceneObject.
  8. Click on the dropdown toggle next to “StickFigure_3DModel”.
  9. Click the dropdown toggle next to “SkeletonObject”, and finally click on “Hips”
  10. Select “OK”. The “Attachment Points” in the “3D Body Tracking” component in the “Inspector” Panel should have been automatically populated with the joints in the “StickFigure_3DModel”.
Was this page helpful?
Yes
No