For the complete documentation index, see llms.txt. This page is also available as Markdown.

情绪快速开始

为 Convai NPC 构建可工作的情绪管线——挂载 Emotion Controller、分配内置示例配置文件,并在 Play Mode 中验证表情。

我们将把 Emotion Controller 绑定到一个 NPC 上,分配附带的示例配置文件,并在 Play Mode 中查看角色的面部如何对实时 AI 情绪信号作出反应。初始设置不需要自定义资源。

先决条件

开始之前,请确认:

设置 Emotion Controller

1

添加 Emotion Controller

在 Hierarchy 中选择你 NPC 的根 GameObject。在 Inspector 中,点击 Add Component 并搜索 Emotion Controller,或者导航到 Convai → Embodiment → Emotion Controller.

该组件会显示一个 Profile 字段,目前为空。

Unity Inspector showing ConvaiEmotionController added to the NPC root GameObject with the Profile field empty, ready for a profile asset to be assigned
已将 ConvaiEmotionController 添加到 NPC 根对象——在第 3 步分配 EmotionProfile 资源之前,Profile 字段为空。目前还没有启用任何 blendshape 映射。
2

查找附带的示例配置文件

在 Project 窗口中,导航到:

Packages / Convai SDK for Unity / SamplesShared / Resources / Embodiment / Modules / Emotion

你会找到两个资源:

资源
用途

ConvaiSamplesShared_EmotionProfile

为 Reallusion 角色预先配置的表情槽位,平滑、微爆发和中性轮换都已调好。

ConvaiSamplesShared_EmotionTaxonomy

默认的情绪词汇表,已被上面的配置文件引用。

3

分配配置文件

ConvaiSamplesShared_EmotionProfile 从 Project 窗口拖到 Profile 字段中,位于 ConvaiEmotionController 组件上。

Unity Inspector showing ConvaiEmotionController with ConvaiSamplesShared_EmotionProfile assigned to the Profile field
已分配 ConvaiSamplesShared_EmotionProfile——控制器现在已使用为 Reallusion 角色预调好的表情槽位进行配置,并会在 Play Mode 开始后立即驱动 blendshape。
4

进入 Play Mode 并说话

Play。使用你配置好的麦克风与角色对话。随着 AI 回复,请观察 Inspector 中的 ConvaiEmotionController —— Current 读数会实时更新。

工作原理

当你与角色对话时, ConvaiEmotionController 接收后端的情绪信号,通过词汇分类法进行解析(映射 "happy" 设为 "joy"),随时间对强度分数进行平滑处理,并在每一帧将该分数写入角色的面部 blendshape。要了解每个阶段的完整说明,请参见 情绪系统如何工作.

附带的配置文件针对 Reallusion 角色进行了配置。对于其他骨架,请复制该配置文件,并更新每个槽位中的 blendshape 名称,使其与角色的形状匹配。请参见 情绪配置文件情绪输出绑定 了解如何为任何骨架配置槽位。

下一步

快速开始可使用附带的配置文件端到端运行。这些页面介绍了如何调优和扩展该设置。

情绪系统如何工作情绪配置文件情绪输出绑定情绪脚本 API

最后更新于

这有帮助吗?