> 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/convai-unreal-engine-plugin/features/lip-sync/face-sync-animgraph-node-reference.md).

# Face Sync AnimGraph 节点参考

Convai Face Sync AnimGraph 节点的全部属性参考——应用模式、面部 alpha、平滑、饥饿混合和 blendshape 映射。

该 `Convai Face Sync` 节点（`FAnimNode_ConvaiFaceSync`）是一个动画蓝图节点，位于 AnimGraph 中的姿势源与输出姿势之间。它会从同一 Actor 上的 `Convai Chatbot` 组件读取面部数据，应用上半脸/下半脸 Alpha、可选平滑、数据缺失时的混合以及可选重映射表，然后将生成的曲线值写入输出姿势。

当 `Convai Chatbot Component` 引脚未设置时，节点会自动从所属 Actor 解析其聊天机器人组件。所有标记为“默认隐藏引脚”的属性都可在动画蓝图编辑器的 **细节** 面板中访问。

### 姿势输入与组件连接

| 属性                       | 类型                         | 默认值       | 说明                                                                                          |
| ------------------------ | -------------------------- | --------- | ------------------------------------------------------------------------------------------- |
| `SourcePose`             | `FPoseLink`                | —         | 要添加或应用面部曲线的输入姿势。请在 AnimGraph 中将其连接到前一个节点。                                                   |
| `ConvaiChatbotComponent` | `UConvaiChatbotComponent*` | `nullptr` | 用于读取面部数据的聊天机器人组件引用。当值为 `nullptr`时，节点会自动查找所属 Actor 上的第一个 `UConvaiChatbotComponent` 。默认显示此引脚。 |

### 应用模式

| 属性          | 类型                         | 默认值   | 说明                                                               |
| ----------- | -------------------------- | ----- | ---------------------------------------------------------------- |
| `ApplyMode` | `EConvaiFaceSyncApplyMode` | `Add` | 控制如何将曲线值写入输出姿势。 `Add` 会将 Convai 值叠加到现有曲线值上； `Override` 会完全替换现有值。 |

#### EConvaiFaceSyncApplyMode 的取值

| 值          | 行为                                                                |
| ---------- | ----------------------------------------------------------------- |
| `Add`      | 将 Convai 曲线值添加到源姿势已有的曲线值上。如果身体或待机动画也会驱动面部曲线，并且你希望将它们混合在一起，请使用此模式。 |
| `Override` | 用 Convai 曲线值替换现有曲线值。如果希望动画曲线仅由 Convai 驱动，请使用此模式。                  |

### 面部划分

| 属性                         | 类型              | 默认值   | 说明                                                 |
| -------------------------- | --------------- | ----- | -------------------------------------------------- |
| `UpperFaceBlendshapeNames` | `TArray<FName>` | `[]`  | 视为上半脸形状（眉毛、眼睛、眼睑）的曲线名称。此列表之外的所有曲线均视为下半脸曲线。默认隐藏此引脚。 |
| `UpperFaceAlpha`           | `float`         | `0.8` | 应用于上半脸曲线值的缩放系数。限制在 `[0.0, 1.0]`范围内。默认隐藏此引脚。        |
| `LowerFaceAlpha`           | `float`         | `1.0` | 应用于下半脸曲线值的缩放系数。限制在 `[0.0, 1.0]`范围内。默认隐藏此引脚。        |

当 `UpperFaceBlendshapeNames` 为空时，所有曲线都会应用 `LowerFaceAlpha` 缩放系数。

### 平滑

平滑处理使用指数移动平均（EMA）。速度值在编辑器中限制为 `[0.0, 1.0]` 。 `0.0` 产生的延迟最大（每帧的值只会略微接近目标值）； `1.0` 则会立即完成（不进行平滑，值在一帧内达到目标值）。在 `0.5` 且帧率为 60 fps 时，每条曲线每帧大约会向目标值移动 50%。实用的起始值： `0.3`–`0.5` 适用于平滑且响应灵敏的下半脸； `0.1`–`0.2` 适用于动作更克制的上半脸。

| 属性                          | 类型      | 默认值     | 说明                                                                                                                  |
| --------------------------- | ------- | ------- | ------------------------------------------------------------------------------------------------------------------- |
| `bEnableLowerFaceSmoothing` | `bool`  | `false` | 为下半脸曲线启用指数移动平均平滑。                                                                                                   |
| `LowerFaceSmoothingSpeed`   | `float` | `1.0`   | 下半脸平滑的 EMA 速度。在编辑器中限制为 `[0.0, 1.0]` ： `0.0` = 延迟最大， `1.0` = 立即完成。仅当 `bEnableLowerFaceSmoothing` 为 `true`时生效。默认隐藏引脚。 |
| `bEnableUpperFaceSmoothing` | `bool`  | `false` | 为上半脸曲线启用指数移动平均平滑。                                                                                                   |
| `UpperFaceSmoothingSpeed`   | `float` | `1.0`   | 上半脸平滑的 EMA 速度。在编辑器中限制为 `[0.0, 1.0]` ： `0.0` = 延迟最大， `1.0` = 立即完成。仅当 `bEnableUpperFaceSmoothing` 为 `true`时生效。默认隐藏引脚。 |

### 缓冲区耗尽混合

当唇形同步缓冲区中的帧用尽时（例如，在语音轮次之间或首帧到达之前），节点会将曲线贡献逐渐混合至零。帧再次可用时，则逐渐恢复曲线贡献。这样可以避免面部表情突然恢复到中性状态后又跳变回来。

| 属性                           | 类型      | 默认值   | 说明                                                   |
| ---------------------------- | ------- | ----- | ---------------------------------------------------- |
| `StarvationBlendInDuration`  | `float` | `0.1` | 曲线贡献从 `0` 混合到 `1` 所需的秒数（帧变为可用时）。设为 `0` 可立即切换。默认隐藏引脚。 |
| `StarvationBlendOutDuration` | `float` | `0.8` | 曲线贡献从 `1` 混合到 `0` 所需的秒数（缓冲区为空时）。设为 `0` 可立即切换。默认隐藏引脚。 |

两个值都按恒定速率生效。过渡中途反向时，所需时间会按比例短于完整过渡。

### 混合形状映射

| 属性                  | 类型                                         | 默认值   | 说明                                                                                                                                  |
| ------------------- | ------------------------------------------ | ----- | ----------------------------------------------------------------------------------------------------------------------------------- |
| `BlendshapeMapping` | `TMap<FName, FConvaiBlendshapeParameters>` | `{}`  | 可选的重新映射表。键为 Convai 中的源曲线名称；值为一个 `FConvaiBlendshapeParameters` 结构体，用于定义目标曲线名称、每个条目的乘数、偏移量、钳制范围和可选覆盖值。为空时，曲线将按 1:1 应用，不进行重新映射。默认隐藏引脚。 |
| `GlobalMultiplier`  | `float`                                    | `1.0` | 应用于所有已映射曲线值的乘数，但条目设置了 `IgnoreGlobalModifiers` 时除外。默认隐藏引脚。                                                                           |
| `GlobalOffset`      | `float`                                    | `0.0` | 添加到所有映射曲线值的偏移量，除非 `IgnoreGlobalModifiers` 在该条目上设为 true。默认隐藏固定值。                                                                     |

#### FConvaiBlendshapeParameters 字段

`FConvaiBlendshapeParameters` 定义每个条目的映射行为。所有字段均可在蓝图中读写。

| 字段                      | 类型              | 默认值     | 说明                                                                                                                               |
| ----------------------- | --------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------- |
| `TargetNames`           | `TArray<FName>` | `[]`    | 要写入源值的骨骼网格体目标曲线名称。单个源曲线可以映射到多个目标曲线。                                                                                              |
| `Multiplyer`            | `float`         | `1.0`   | 每个条目单独应用的缩放系数，应用于 `GlobalMultiplier` 之前（除非 `IgnoreGlobalModifiers` 为 `true`）。注意：源代码中的字段名称有拼写错误：它是 `Multiplyer`，而不是 `Multiplier`. |
| `Offset`                | `float`         | `0.0`   | 缩放后添加的每条目偏移量。                                                                                                                    |
| `UseOverrideValue`      | `bool`          | `false` | 当 `true`时，无论传入数据如何，曲线都会设为 `OverrideValue` 。适用于将曲线固定为某个值。                                                                         |
| `OverrideValue`         | `float`         | `0.0`   | 当 `UseOverrideValue` 为 `true`.                                                                                                   |
| `IgnoreGlobalModifiers` | `bool`          | `false` | 当 `true`, `GlobalMultiplier` 和 `GlobalOffset` 不会应用于此条目。                                                                          |
| `ClampMinValue`         | `float`         | `0.0`   | 经过所有缩放和偏移后，曲线允许达到的最小值。                                                                                                           |
| `ClampMaxValue`         | `float`         | `1.0`   | 经过所有缩放和偏移后，曲线允许达到的最大值。                                                                                                           |

### 命令行覆盖

启动时传入 `-LipSyncAnim*` 标志，即可覆盖下列可调属性。在 `Initialize_AnyThread` 中，每个 PIE 会话只解析一次覆盖值，且其优先级高于动画蓝图中设置的值。命令行中未设置的标志将使用 `UPROPERTY` 值。

| 标志                                       | 类型                  | 示例                                           |
| ---------------------------------------- | ------------------- | -------------------------------------------- |
| `-LipSyncAnimUpperFaceAlpha`             | `float`             | `-LipSyncAnimUpperFaceAlpha=0.5`             |
| `-LipSyncAnimLowerFaceAlpha`             | `float`             | `-LipSyncAnimLowerFaceAlpha=0.8`             |
| `-LipSyncAnimStarvationBlendInDuration`  | `float`             | `-LipSyncAnimStarvationBlendInDuration=0.05` |
| `-LipSyncAnimStarvationBlendOutDuration` | `float`             | `-LipSyncAnimStarvationBlendOutDuration=1.2` |
| `-LipSyncAnimGlobalMultiplier`           | `float`             | `-LipSyncAnimGlobalMultiplier=1.2`           |
| `-LipSyncAnimGlobalOffset`               | `float`             | `-LipSyncAnimGlobalOffset=0.0`               |
| `-LipSyncAnimLowerFaceSmoothingSpeed`    | `float`             | `-LipSyncAnimLowerFaceSmoothingSpeed=0.4`    |
| `-LipSyncAnimUpperFaceSmoothingSpeed`    | `float`             | `-LipSyncAnimUpperFaceSmoothingSpeed=0.2`    |
| `-LipSyncAnimEnableLowerFaceSmoothing`   | `bool` (`1`/`true`) | `-LipSyncAnimEnableLowerFaceSmoothing=1`     |
| `-LipSyncAnimEnableUpperFaceSmoothing`   | `bool` (`1`/`true`) | `-LipSyncAnimEnableUpperFaceSmoothing=1`     |
| `-LipSyncAnimBypassSmoothing`            | `bool` (`1`/`true`) | `-LipSyncAnimBypassSmoothing=1`              |
| `-LipSyncAnimBypassStarvationBlend`      | `bool` (`1`/`true`) | `-LipSyncAnimBypassStarvationBlend=1`        |
| `-LipSyncAnimApplyMode`                  | `Add` 或 `Override`  | `-LipSyncAnimApplyMode=Override`             |

{% hint style="info" %}
命令行覆盖按进程生效。在开发过程中，无需编辑并重新编译动画蓝图，即可使用这些选项调整口型同步行为。编辑器重启后，这些设置不会保留。
{% endhint %}

### 相关参考

{% content-ref url="/pages/8b7003d8fdf40c7b56b0fd2a54376bfc5105903c" %}
[Face Sync 组件参考](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/features/lip-sync/face-sync-component-reference.md)
{% endcontent-ref %}

{% content-ref url="/pages/1d4e6a68b8b0634dd00381e03cb9447a556b758c" %}
[口型同步使用示例](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/features/lip-sync/lip-sync-usage-examples.md)
{% endcontent-ref %}


---

# 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/convai-unreal-engine-plugin/features/lip-sync/face-sync-animgraph-node-reference.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.
