> For the complete documentation index, see [llms.txt](https://docs.convai.com/api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/unity-plugin-beta-overview/getting-started/setup/add-lip-sync-to-your-character/lip-sync-profiles-and-mappings/creating-a-profile.md). Agents can also search and read this documentation through its [MCP server](https://docs.convai.com/api-docs/~gitbook/mcp).

# 创建配置文件

在 Unity 中创建并注册自定义 Lip Sync 配置文件，了解配置文件字段，并为你的项目配置受支持的传输格式。

## 简介

A **口型同步配置文件** 定义角色设置在口型同步系统中使用的通道架构。在大多数情况下，内置配置文件已足够。不过，您可能希望创建自定义配置文件资源，以便更好地组织项目、使用项目专属标识符，或在编辑器工作流中覆盖受支持传输格式的表示方式。

本页将介绍配置文件检查器、配置文件注册表，以及如何正确创建自定义配置文件。

***

## 开始之前

目前，Convai 仅支持以下传输格式：

| 传输格式           | 支持的架构     |
| -------------- | --------- |
| `arkit`        | ARKit     |
| `mha`          | MetaHuman |
| `cc4_extended` | CC4 扩展    |

这一点很重要，因为创建新的配置文件资源并 **不会** 创建新的传输格式。

自定义配置文件可帮助您：

* 重命名或重新整理受支持的架构
* 为项目使用自定义配置文件 ID
* 将自定义配置文件指向某种受支持的格式

自定义配置文件不能用于引入一个全新的传输值，超出 `arkit`, `mha`或 `cc4_extended`.

***

## 了解配置文件检查器

选择 `ConvaiLipSyncProfileAsset`后，检查器会分为三个主要区域。

<figure><img src="https://2402152281-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEtUJA212Zc1S9ACc8T4l%2Fuploads%2FJF9rLN3rkUK9iBm13CTM%2Fimage.png?alt=media&amp;token=605ce6d8-0143-4616-b030-ec849b4f782d" alt=""><figcaption></figcaption></figure>

### 运行时标识

此部分用于控制配置文件在内部的标识方式。

**配置文件 ID**\
运行时用于标识配置文件的唯一规范化字符串。

此 ID 用于：

* 配置文件目录查询
* 地图定位
* 注册表合并
* 组件配置

请谨慎选择。一旦其他资源引用了此 ID，更改它可能会导致这些引用失效。

### 编辑器标签

**显示名称**\
这是下拉列表和编辑器工具中显示的易读标签。

它不会直接影响运行时行为，但对易用性很重要。请使用清晰的名称，让团队成员一眼就能识别。

### 传输格式

此部分用于确定配置文件解析为哪种受支持的传输格式。

**覆盖默认令牌**\
禁用时，配置文件会使用自身的 `Profile ID` 作为传输令牌。

启用后，配置文件可以使用其他受支持的传输令牌。如果您希望使用自定义内部配置文件 ID，但仍需要将配置文件解析为某种内置支持格式，此选项会很有用。

**传输令牌**\
传输令牌必须是当前支持的值之一：

* `arkit`
* `mha`
* `cc4_extended`

例如，ID 为 `my_metahuman_variant` 的配置文件仍可使用 `mha` 传输令牌。

***

## 创建自定义配置文件

{% stepper %}
{% step %}
**创建配置文件资源**

在 Unity Project 窗口中，创建新的配置文件资源：

```
Create > Convai > LipSync > Profile Asset
```

为其指定一个描述性名称，例如：

```
ConvaiLipSyncProfile_MyCharacter
```

{% endstep %}

{% step %}
**设置配置文件 ID**

在 **Runtime Identity** 部分中，输入唯一 ID。

示例：

```
my_character
```

使用小写字母、数字和下划线。避免使用空格。
{% endstep %}

{% step %}
**设置显示名称**

在 **Editor Label** 部分中，输入应显示在 Inspector 中的名称。

示例：

```
我的角色
```

{% endstep %}

{% step %}
**设置传输格式**

选择此配置文件应使用哪种受支持的 Lip Sync 架构。

示例：

* 对 ARKit 兼容的混合形状布局，使用 `arkit` 。
* 对 MetaHuman 骨架，使用 `mha` 。
* 对 CC4 Extended 骨架，使用 `cc4_extended` 。

如果自定义配置文件 ID 与这些受支持的令牌都不匹配，请启用 **Override default token** 并手动输入正确的受支持传输令牌。
{% endstep %}
{% endstepper %}

***

## 了解配置文件注册表

配置文件通过 **Profile Registry** 资源进行发现。

注册表是一种 `ConvaiLipSyncProfileRegistryAsset` 资源，其中包含一个或多个配置文件引用，以及用于运行时合并的优先级值。

<figure><img src="https://2402152281-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEtUJA212Zc1S9ACc8T4l%2Fuploads%2F5QNVpe0mUYShI7W1i5sH%2Fimage.png?alt=media&amp;token=217fa1b8-7464-4c0d-bf40-262428e06217" alt=""><figcaption></figcaption></figure>

#### 注册表字段

| 字段       | 说明              |
| -------- | --------------- |
| **优先级**  | 决定加载和覆盖顺序       |
| **配置文件** | 注册表中包含的配置文件资源列表 |

内置注册表使用的优先级为 `0`。你自己的自定义注册表应使用更高的值，例如 `1`，这样它就会在内置集合之后合并。

### 注册配置文件

{% stepper %}
{% step %}
**创建配置文件注册表**

在 Project 窗口中创建注册表资源：

```
Create > Convai > LipSync > Profile Registry Asset
```

为其命名，例如：

```
MyProjectProfileRegistry
```

{% endstep %}

{% step %}
**设置注册表优先级**

将 **Priority** 设置为高于内置注册表的值。

建议的起始值：

```
1
```

{% endstep %}

{% step %}
**将配置文件添加到注册表**

将新建的 `ConvaiLipSyncProfileAsset` 添加到 **Profiles** 列表中。
{% endstep %}

{% step %}
**将注册表放置在正确的 Resources 路径下**

要让 SDK 自动发现该注册表，必须将其放在以下路径下：

```
Resources/LipSync/ProfileRegistries/
```

将资源保存在该位置后，Unity 会在下次域重新加载或刷新 Play Mode 时将其纳入。
{% endstep %}
{% endstepper %}

## 运行时发现机制的工作原理

唇形同步配置文件目录初始化时，会执行以下操作：

1. 加载内置注册表
2. 扫描 `Resources/LipSync/ProfileRegistries/`
3. 按优先级排序
4. 将发现的所有配置文件合并到一个运行时目录中

如果两个注册表定义了相同的 `Profile ID`，则优先级较高的定义会替换优先级较低的定义，并记录一条警告。

***

## 重要限制

创建自定义配置文件时，请注意以下几点：

### 配置文件 ID 应视为永久不变

配置文件一旦被地图、注册表或组件引用，更改其 ID 可能会导致这些引用失效，且不会有明显提示。

### 传输格式是固定的

仅支持以下传输格式：

* `arkit`
* `mha`
* `cc4_extended`

输入完全自定义的值并不会新增对其他格式的支持。

### 注册表优先级会影响替换行为

如果两个注册表定义了相同的配置文件 ID，优先级较高的定义会替换较早加载的定义。重复 ID 之间不会合并。

***

## 下一步

创建并注册配置文件后，下一步是创建或指定一个以该配置文件为目标的地图。

请继续阅读 [**创建自定义地图**](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/unity-plugin-beta-overview/getting-started/setup/add-lip-sync-to-your-character/lip-sync-profiles-and-mappings/creating-a-custom-map.md) 以定义该配置文件如何驱动角色实际的混合形状。

## 总结

自定义配置文件主要用于在项目中整理和识别受支持的口型同步架构。它让你可以灵活地命名和组织项目，同时仍遵循当前支持的传输格式。

如果你的角色需要自定义路由到网格混合变形，请接下来创建一个映射。

{% hint style="info" %}
**需要帮助？** 如有疑问，请访问 [**Convai 开发者论坛**](https://forum.convai.com/).
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/unity-plugin-beta-overview/getting-started/setup/add-lip-sync-to-your-character/lip-sync-profiles-and-mappings/creating-a-profile.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
