模型功能

From VRChat Wiki
This page is a translated version of the page Expressions and the translation is 25% complete.
查看 · 编辑这是有关 VRChat 官方内容的页面!
VRCWiki 团队 审核。如果你想为此页面做出贡献,请阅读贡献指南
圆盘菜单中的模型功能示例。

模型功能是 VRChat 虚拟形象的特性之一。它由自定义菜单组成,允许玩家在自己的虚拟形象上使能动作或开关,以便灵活便捷地访问虚拟形象的特有功能。

更多信息请参阅 Avatar Creators Docs

模型功能菜单

游戏内的模型功能菜单可在圆盘菜单中找到,也可从快捷菜单主菜单中的模型功能侧边栏打开。该操作适用于所有 VRChat 版本。对虚拟形象的模型功能的操作将会全局同步到同一平台上的全部玩家,并可配置为跨平台同步

SDK 中的模型功能

模型功能可通过 VRChat SDK 中的各种参数来编辑。

基础模型功能

当没有配置任何模型功能时,包含一些基础动画的默认模型功能菜单会被自动添加到虚拟形象之中。这些动画包含:

  • Wave(挥手)
  • Clap(鼓掌)
  • Point(指差)
  • Cheer(欢呼)
  • Dance(跳舞)
  • Backflip(后空翻)
  • Die(死亡)
  • Sadness(伤心)

自定义模型功能

欲添加自定义模型功能,可以在 Unity 中创建 Expression Menu(模型功能目录)资产(Asset)和 Expression Parameters(模型功能参数)资产,并将它们指定到 VRChat Avatar Descriptor 脚本的 Expressions 部分。Expression Menu 控制游戏菜单中显示哪些控制功能,而 Expression Parameters 则定义这些控制功能所改变的值的名称、类型、默认值以及同步行为。

每一个自定义参数都可被标记为 Saved(储存)和 Synced(同步)。标记为同步的自定义参数计入模型的 256 比特(bit)同步配额。一个虚拟形象最多可以定义 8192 个自定义参数。资产中的参数也可通过Contact Receiversparameter driversPhysBonesOSC更改。

SDK 也包括了一个 Default Parameters(默认参数)按钮。它用于还原 VRChat 默认 AV3 控制器使用的三个参数别名:VRCEmote, VRCFaceBlendH以及VRCFaceBlendV

控制项(Controls)

每页最多可以有 8 个控制项。当创建时,可选择以下 Type(类型):

  • Button(按钮):按下时设定值,并在 VRChat 发送变更后重置。
  • Toggle(开关):开启时设定值,关闭时重置值。
  • Sub Menu(子菜单):打开另一个模型功能菜单。该项可在打开子菜单时设定值(可选)。
  • Two Axis Puppet:水平和垂直方向的两个浮点数输入,范围在-1.01.0之间。
  • Four Axis Puppet:对应四个方向的四个浮点数输入,范围在0.01.0之间。
  • Radial Puppet:单个浮点数输入,范围在0.01.0之间。
Puppet Menu Example
Example of the Action Menu and Face Mirror in use. (Animated GIF)

As you move your joystick, touchpad, or mouse in different directions, you change animation parameters to blend between moods (e.g., "happy" and "surprised"). Any parameter can be controlled from this menu.

You can open one menu on either hand (or both). By default, flick to select an option. In Action Menu settings, you can choose to use the Trigger. To back out of a selection in the Expressions menu, pull the trigger.

When a puppet control is open, VRChat synchronizes its live values with the faster IK sync mode. After it is closed, the frozen value remains until it is changed again.

Expression Parameter

Expression Parameters are used to control avatar features via expression menu, contact receiver, OSC, parameter drivers or physbones. These parameters are then mapped to Animator Controller parameters in your avatar's FX, Gesture, or Action controllers.

Settings

Each entry in the Expression Parameters asset stores:

  • Name, which must match the Animator parameter name exactly.
  • Type, which can be Bool, Int, or Float.
  • Default, which is used when the avatar is reset.
  • Saved, which controls whether the value persists between sessions.
  • Synced, which controls whether the value is sent to other users.

By default, custom parameter sync uses VRChat's Playable sync mode. Puppet controls temporarily use faster IK sync while they are actively open.

Built-in parameters

VRChat also provides built-in Animator parameters. These do not need to be added to the Expression Parameters asset, and they do not count toward the custom parameter budget.

Built-in parameters are read-only. They are added directly to a playable layer's Animator Controller by name, and VRChat updates them automatically at runtime. They are not set on sub-animators, only on playable-layer animators.

Additional built-in parameters include:

  • Viseme (Int) — Set by lip sync from 0 (silence) to 14 (the "u" vowel) when the Avatar Descriptor's Lip Sync is set to Viseme Blend Shape or Viseme Parameter Only.
  • Voice (Float) — Perceived microphone volume from 0.0 to 1.0, affected by distance and earmuff settings.
  • VelocityX, VelocityY, VelocityZ, VelocityMagnitude (Float) — Movement speed in m/s along each axis and total magnitude. Locally, playspace movement does not count; remotely, it does.
  • Upright (Float) — 0 when prone, 1 when standing.
  • Grounded (Bool) — Whether the user is touching the ground.
  • MuteSelf (Bool) — Whether the user's microphone is muted.
  • Earmuffs (Bool) — Whether the user has earmuffs enabled.
  • IsOnFriendsList (Bool) — Whether the viewer is friends with the avatar's wearer (shows False locally).
  • ScaleFactor, ScaleFactorInverse, EyeHeightAsMeters, EyeHeightAsPercent (Float) — Scaling-related parameters for avatar scaling. EyeHeightAsMeters is recommended for scale-aware systems because it is linear and does not depend on upload height.

Each built-in parameter has a sync type determining when it is sent to remote users: IK for tracking-derived values (gestures, velocity, grounded), Speech for voice-related values (viseme, voice), Playable for user-state values (mute, earmuffs, tracking type, scale), or None for local-only values (IsLocal, PreviewMode).

Network synchronization

Only synced expression parameters and certain built-in parameters are sent over the network. The full list of data sent for each avatar includes:

  • IK targets — Head, jaw, and hands for desktop and 3-point tracking; additionally hip and feet for full-body tracking. Index controller users also sync finger positions.
  • Synced expression parameters — Only parameters marked as Synced are transmitted. Values are quantized: Int values sync in the range 0–255, Float values sync as multiples of 1/127 between −1 and 1, and Bools sync as true or false.
  • Built-in VRC parameters — Including gestures, velocity, voice, and other runtime parameters.
  • PhysBones — Pose position data is sent to late joiners.

For reliable late-joiner support, a recommended pattern is to split animator logic using the IsLocal parameter: local-side layers handle contacts, parameter drivers, and all logic, then set synced parameters, while remote-side layers only read those synced parameters to play the correct visualization.

Gestures and facial expressions

The built-in GestureLeft and GestureRight parameters identify the user's hand gesture, while GestureLeftWeight and GestureRightWeight expose analog trigger pressure. On humanoid avatars, the Gesture playable layer is commonly used for hand poses, while facial expressions are often driven from the FX layer with blendshapes, material properties, or other non-humanoid animations.

On tracked controllers where finger tracking overrides animation by default, creators can use a Tracking Control state behavior to switch the relevant fingers from Tracking to Animation when needed.

Expression Parameter Mismatching

Expression Parameter Mismatching refers to the practice of using different parameter types between your Expression Parameters and your local Animator Controller parameters. While it is recommended to keep parameter types consistent, mismatching is supported and the system will convert values between types according to specific rules. This can be useful in certain advanced setups. The same conversion behavior can also be used with built-in VRChat Animator parameters.

Unity's Animator system uses floats on the backend for all parameter types, while VRChat stores synced custom parameters in compact network-friendly formats. The user interface in Unity and the VRCSDK lets creators choose parameter types for convenience, but under the hood, value conversion is possible. This means that parameters are not being cast in the C# sense, but rather mismatched across systems. This behavior is also supported by popular tools such as Av3Emulator and Gesture Manager.

Expression Parameter Bool

Animator Controller Parameter
Type Expression Bool = False Expression Bool = True
Bool → Bool Bool = False Bool = True
Bool → Int Int = 0 Int = 1
Bool → Float Float = 0.0 Float = 1.0

Expression Parameter Int

Animator Controller Parameter
Type Behaviour
Int → Bool Any Int value that isn't 0 sets bool to True
Int → Int Expected Behaviour
Int → Float Straight Conversion: e.g. Int = 2 → Float = 2.0

Expression Parameter Float

Animator Controller Parameter
Type Behaviour
Float → Bool Any Float value that isn't 0 sets bool to True
Float → Int Rounded Conversion: ≥0.5 → 1 ; <0.5 → 0
Float → Float Expected Behaviour

Resources

See also

References