# Snapchat

### Platform features

* [Paint layers](#paint-layers)
* [Morphing](#morphing)
* [Body and face tracking](#lens-studio)
* [3d accessories](#3d-accessories)

## Preparation

Work must be carried out using the following software:

* **Blender** - no specific version (final model placement with all textures and skeleton)&#x20;
* **Photoshop** - no specific version
* **Lens Studio v4.19** (setting up a ready-made model for AR)
* Chose[ reference ](/platform-basics/choosing-references.md)

{% hint style="warning" %}
**"It is necessary to use only "Lens Studio version 4.19. Older or newer versions are strictly prohibited to use**
{% endhint %}

## Model quality

It is very important that the model is made as qualitatively as possible.&#x20;

* The model must be well-detailed&#x20;
* fully comply with platform standards
* follow chosen style  &#x20;

<div><figure><img src="/files/4DRlXn8KVeSHSHrnIjnx" alt=""><figcaption><p>poor quality work</p></figcaption></figure> <figure><img src="/files/1OHGNVmw2x2JGLTvG1CX" alt=""><figcaption><p>quality work</p></figcaption></figure></div>

## Model preparation

### Modelling&#x20;

The model can be created in any software you like, but in the end, the model **must be** in Blender.\
All elements like external pockets; buttons; fasteners; belts etc. **should be sewn** into the model itself and made with textures as in the image below.

<figure><img src="/files/CEn7lTStGsyH8TBUAEIZ" alt=""><figcaption><p>The way is required to build your mesh</p></figcaption></figure>

Here we have a shirt with body armour, the body armour is one piece with the shirt, i.e. the body armour is **not a separate** mesh that was connected to the shirt's mesh after all.

In this image, you can see that all the straps on the body armour are made through textures, as is the body armour itself; the collar and many of the large folds.

{% hint style="info" %}
**"Models should NOT have internal volume!"**&#x20;
{% endhint %}

The image below shows an example of a shirt sleeve, the shirt on the **left has volume**, the shirt on the **right has no volume**.

<figure><img src="https://lh5.googleusercontent.com/Yw75SCbpqrSTHI_3dlc3OtehLofJAbyi2CcYK0zEt2M88jbi0Tp2kZvLU0cRzgZad0IUHOQqB_boHXRT_OfrVeABdzjSdpciFT6FvZas23WQHcpnwI4n892J_HF6KbtUVzIsjpfVfZuJB0j43cY7txhQ6o2L20sRArwUZ1tyDqocO1GgEql2cfEIU82H" alt=""><figcaption><p>Internal volume examples</p></figcaption></figure>

<details>

<summary>Restriction on polygon quantity:</summary>

* **Headwear** - 10,000 triangles&#x20;
* **Tops** (jackets, T-shirts, etc.) - 20,000 triangles&#x20;
* **Bottoms** (Pants, shorts, etc.) - 15,000 triangles&#x20;
* **Shoes** - 5,000 triangles&#x20;
* **Full Suits** - 35,000 triangles&#x20;
* **Accessories** - 5,000 triangles

</details>

### 3D Accessories

Snapchat accessories are separate objects with their own textures and materials.&#x20;

{% hint style="info" %}
You can find more information [here](/platform-basics/3d-accessories.md)
{% endhint %}

### **UV Layout**

UV Layout uses general standards. No unique features on Snapchat here.

{% hint style="info" %}
Check general UV Layout requirements [here](/platform-basics/uv-layouting.md).
{% endhint %}

### Texturing

Texturing can be done in any program convenient for you, as long as the result is 3 textures:&#x20;

**Albedo**

**Normal**

**ORM** texture is a texture that contains metallic and roughness textures, splited into <mark style="color:red;">**R**</mark><mark style="color:green;">**G**</mark><mark style="color:blue;">**B**</mark> channels.

ORM texture is required by the platform.&#x20;

Using metallic and roughness textures separately won't work in the right way

<div align="left"><figure><img src="/files/hNCv1DJibVhpklVdiXh0" alt=""><figcaption><p>("<strong>Roughness</strong> is the <mark style="color:green;"><strong>G</strong></mark> channel; <strong>Metalness</strong> is the <mark style="color:blue;"><strong>B</strong></mark> channel")</p></figcaption></figure></div>

<figure><img src="/files/zAPUENjHZfitdnahtWlE" alt=""><figcaption><p>Shader setup in Lens Studio</p></figcaption></figure>

**Opacity** (optional) sometimes can be used, but requires splitting into different materials for proper work.

{% hint style="info" %}
**"The resolution of all textures is always the same - 2048 x 2048, each texture is no more than 800kb in JPG or PNG format!"**
{% endhint %}

### **Materials**

* The material **must** be created in Blender
* It must **not** have **any extra** nodes

<figure><img src="https://lh5.googleusercontent.com/IXdnvVR4llO2YpjLZuZYnuzpM5X7ImDatH1goxp6W2V_54aukwNX3RYy4LjynVo5nfKir19SxrJbNWaoBoqim3IOTlWdUHeLkO7dDAQc6pejYJzCpkDffoxnY4cW3icTjuH-LU7ysplPSTcWLPRKc2A96Qolgc5K9OHXOWrAwugUdUPeXVMEddl4OH_j" alt=""><figcaption><p>Shader setup in Blender</p></figcaption></figure>

### **Rigging**

{% hint style="info" %}
**"All models must have a skeleton, except hats and masks"**
{% endhint %}

You **don't need to create** bones from scratch, you need to take the ready-made bones from this "[link](https://disk.yandex.ru/d/W5-V0JYaDNMuHQ)" and apply them to your model, this is mandatory.&#x20;

The meshes that are originally placed on the bones **must be removed**. It is also forbidden to change the size of the bones, you **must** adjust your model to the size of these bones.

<figure><img src="https://lh4.googleusercontent.com/3UoUHcbTUH25KT-jvP-XEFRajnlx5e7VeArbx6qgtOW7pdYBis5PeXYDpHMdSpO5qSnXpB97w9DrukOgyF18FatklSU4_zcAqnfa-L6pd6T3GJ7s33C3ZXw75ua0T6-cQ2plCntk3N_3vX1huKACjRAMMz3Erbpjg79CtZtfGoQhZaTHI_g2VEMiHMET" alt=""><figcaption><p>Armature and default body</p></figcaption></figure>

{% hint style="danger" %}
**"The name of the 'inner' bones, highlighted in the list below, should be unchanged!"**
{% endhint %}

<details>

<summary>Armature</summary>

Skeleton

* Character1\_Hips
  * Character1\_Spine
    * Character1\_Spine1
      * Character1\_Spine2
        * Character1\_Neck
          * Character1\_Head
        * Character1\_LeftShoulder
          * Character1\_LeftArm
            * Character1\_LeftForeArm
              * Character1\_LeftHand
        * Character1\_RightShoulder
          * Character1\_RightArm
            * Character1\_RightForeArm
              * Character1\_RightHand
  * Character1\_LeftUpLeg
    * Character1\_LeftLeg
      * Character1\_LeftFoot
        * Character1\_LeftToeBase
  * Character1\_RightUpLeg
    * Character1\_RightLeg
      * Character1\_RightFoot
        * Character1\_RightToeBase

</details>

{% hint style="warning" %}
**"The bones must be in the T-position!"**
{% endhint %}

### Paint layers

Paint layers use general standards. No unique features on Snapchat here.

{% hint style="info" %}
Check general Paint Layers requirements [here](/platform-basics/paint-layers.md).
{% endhint %}

### Naming

Naming uses general standards. No unique features on Snapchat here.

{% hint style="info" %}
Check general Naming requirements [here](/platform-basics/naming-convention.md).
{% endhint %}

### Morphing

Morphing for the Snapchat requierments:

* Then you want to **hide** part of the mesh - scale it to 0 and move down to -1000, this will help you avoid revealing geometry while the skeleton is moving in Lens Studio.

{% hint style="info" %}
Check general Morphing requirements [here](/platform-basics/morphing.md).
{% endhint %}

### Mask

Customuse platform also requires adding masks to your designs. Here is how it looks like and works:

<figure><img src="/files/JzmG0UiiDM4eGJIn1czi" alt=""><figcaption><p>Masks for clothes and head assets</p></figcaption></figure>

There are  two types of masks:

1. **Full body** **mask** for - shirts, pants, costumes, body accessories, etc.
2. **Head mask** for - masks, hats, caps, face accessories, etc.

{% hint style="warning" %}
It is important to keep name of mask - **"mask"**
{% endhint %}

Here is a list of steps on how you should add a mask to your design:

1. Download masks from [here](https://gitlab.com/customuse/contributor-program/-/tree/master/SNA%20-%20Snapchat/mask).

   <figure><img src="/files/vDyiS5xCGU0vFgXlEbXe" alt=""><figcaption></figcaption></figure>
2. Add mask mesh to your design file.&#x20;

   <figure><img src="/files/VkXN32mRW7FAFYIdGTMb" alt=""><figcaption></figcaption></figure>
3. Adjust your outfit so every ending of your mesh will fit mask well. **DO NOT** edit mask in any way, edit asset.

   <figure><img src="/files/N5gJFea0Jn34g2SnpK1p" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Fitting endings of mesh is enough, clipping mask and asset is normal if it is in the middle and not on the ending of the mesh.&#x20;
{% endhint %}

4. Making vertex color mask on mask mesh. Mask with black color to hide parts of body which are located under asset in this way:&#x20;

   <figure><img src="/files/jxSiMfGBGT963ItrmfMt" alt=""><figcaption></figcaption></figure>
5. After all these steps save **ONLY** blend file and save/update your GLB file and all will be done, **you don't need to add a mask anywhere else**.

### **Exporting**&#x20;

You will need to export your model with bones in **FBX** format.

To import your model into Lens Studio you will need **FBX** format.

{% hint style="warning" %}
**"Be sure to clean out any excess files from your Blender file before exporting to FBX and GLB format"**
{% endhint %}

## **Lens Studio**

**Body tracking**

Suitable for body and hand assets

{% hint style="info" %}
Guide on the official Snapchat [website](https://docs.snap.com/lens-studio/references/guides/lens-features/tracking/body/object-tracking-3d#3d-body-tracking)
{% endhint %}

**Head tracking**

Suitable for headwear and face masks

{% hint style="info" %}
Guide on the official Snapchat [website](https://docs.snap.com/lens-studio/references/guides/lens-features/tracking/face/face-effects/head-attached-3d-objects#import-your-3d-object)&#x20;
{% endhint %}

### **Adding scripts**

In the end of lens preparation, you need to add 4 scripts

Adding scripts to **mesh :**

* Update texture (On Start) - Replaces the main mesh texture with the given one.
* Update shapes (On Start) - Configure shape keys for the lens.
* Add **getShapes** script to object tab first and rename it to original name, after that add it to appeared slot under update shapes script

<div align="left"><figure><img src="/files/K5XY6y0YJSAdcVCXkXYF" alt=""><figcaption></figcaption></figure></div>

Adding scripts to **Screen Image:**

* Initialize Helpers (On Awake)  - Helps other scripts to work.
* Update Watermark (On Start) - Sets a custom watermark logo for the lens.

<figure><img src="/files/fXhC6Xuf6dWT83wqxzhG" alt=""><figcaption><p>Adding scripts guide</p></figcaption></figure>

{% hint style="info" %}
Recent version of scripts can be found here - <https://gitlab.com/customuse/contributor-program/-/tree/master/SNA%20-%20Snapchat/scripts>
{% endhint %}

## **Final check and** [**upload**](/introduction/contributor-hub.md)

<details>

<summary>Checklists</summary>

#### Blender

1. Checking the names of meshes, materials, models, textures, etc.

#### Paint layers

1. Check paint layers, their order, and dimensions. Check that the non\_paint layer (if there is one) does not overlap other layers

#### Lens studio

1. Check if the model "sits" correctly due to the bones on the person in the preview&#x20;
2. Check that the textures in the project folder are in the “public” folder, and in lens studio, they are in the root with other files&#x20;
3. Make sure that all the necessary scripts (watermark, shapekeys etc) are connected to the lens

#### Customuse

1. Checking whether the model looks correct in the “Customuse” viewer&#x20;
2. Checking if the paint layers are working correctly&#x20;
3. Check how the superimposed image looks on top of the model (stickers, third-party pictures, etc. By UV scan)

</details>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wiki.customuse.com/guidelines/snapchat.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
