Expressions/zh-hant: Difference between revisions

From VRChat Wiki
雨可韓韓 Yucohanhan (talk | contribs)
No edit summary
雨可韓韓 Yucohanhan (talk | contribs)
No edit summary
 
(44 intermediate revisions by the same user not shown)
Line 63: Line 63:
==表情參數==
==表情參數==


表情參數(Expression Parameters)可透過表情選單、[[Special:MyLanguage/Contacts|Contact Receiver]]、[[Special:MyLanguage/Open Sound Control|OSC]]、[[Special:MyLanguage/parameter drivers|Parameter Driver]] 或 [[Special:MyLanguage/physbones|PhysBone]] 元件來控制角色功能。這些參數接著會對應至角色 FX、手勢(Gesture)或動作控制器中的 Animator Controller 參數。
'''表情參數'''('''Expression Parameters''')可透過表情選單、[[Special:MyLanguage/Contacts|Contact Receiver]]、[[Special:MyLanguage/Open Sound Control|OSC]]、[[Special:MyLanguage/parameter drivers|Parameter Driver]] 或 [[Special:MyLanguage/physbones|PhysBone]] 元件來控制角色功能。這些參數接著會對應至角色 FX、手勢(Gesture)或動作控制器中的 Animator Controller 參數。


<span id="Settings"></span>
<span id="Settings"></span>
Line 75: Line 75:
* '''Synced'''('''同步'''):控制該數值是否會傳送給其他用戶。
* '''Synced'''('''同步'''):控制該數值是否會傳送給其他用戶。


<div lang="en" dir="ltr" class="mw-content-ltr">
預設情況下,自訂參數會使用 VRChat '''Playable''' 同步模式進行同步。當控制類型的控制項處於被開啟狀態時,則會暫時改用較快速的 '''IK''' 同步模式。
By default, custom parameter sync uses VRChat's ''Playable'' sync mode. Puppet controls temporarily use faster ''IK'' sync while they are actively open.
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
<span id="Built-in_parameters"></span>
=== Built-in parameters ===
===內建參數===
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
VRChat 也提供內建的 Animator 參數。這些參數不需要額外加入 Expression 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.
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
內建參數處於唯讀模式,無法由用戶任意修改。要觸發內建參數,只需在 '''Playable Layer'''('''可播放層''')的 '''Animator Controller''' 中使用對應名稱建立參數,VRChat 便會在執行期間自動更新其數值。這些參數不會被設定到'''子 Animator'''('''Sub-Animator''')上,而只會設定於 Playable Layer 的 Animator。
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.
</div>


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


<div lang="en" dir="ltr" class="mw-content-ltr">
* <code>Viseme</code>(Int):由唇形同步(Lip Sync)控制,數值範圍從 <code>0</code>(靜音)到 <code>14</code>(母音「u」)。當 Avatar Descriptor 的 Lip Sync 設定為 '''Viseme Blend Shape''' '''Viseme Parameter Only''' 時啟用。
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).
* <code>Voice</code>(Float):感知到的麥克風音量,範圍從 <code>0.0</code> 到 <code>1.0</code>,會受到距離及音罩(Earmuffs)設定影響。
</div>
* <code>VelocityX</code>、<code>VelocityY</code>、<code>VelocityZ</code>、<code>VelocityMagnitude</code>(Float):沿各軸向及總體的移動速度(單位為公尺 / 秒)。本地端不會計算遊玩空間移動,而遠端則會計算。
* <code>Upright</code>(Float):趴臥時為 <code>0</code>,站立時為 <code>1</code>。
* <code>Grounded</code>(Bool):表示用戶是否接觸地面。
* <code>MuteSelf</code>(Bool):表示用戶是否已將自己的麥克風靜音。
* <code>Earmuffs</code>(Bool):表示用戶是否已啟用耳罩功能。
* <code>IsOnFriendsList</code>(Bool):表示檢視者是否為角色穿戴者的好友(在本地端永遠顯示為 False)。
* <code>ScaleFactor</code>、<code>ScaleFactorInverse</code>、<code>EyeHeightAsMeters</code>、<code>EyeHeightAsPercent</code>(Float):與角色縮放相關的參數。由於 <code>EyeHeightAsMeters</code> 為線性數值,且不受上傳時身高影響,因此建議用於需要感知角色尺寸的系統。


<div lang="en" dir="ltr" class="mw-content-ltr">
每個內建參數都有其對應的同步類型,用來決定何時將數值傳送給遠端用戶:
=== Network synchronization ===
* '''IK''':用於由追蹤資料衍生的數值,例如手勢、移動速度及是否接觸地面等。
</div>
* '''Speech''':用於與語音相關的數值,例如唇形同步及語音音量。
* '''Playable''':用於表示用戶狀態的數值,例如麥克風靜音、音罩、追蹤類型及角色縮放等。
* '''None''':用於僅限本地端使用的數值,例如 <code>IsLocal</code> 與 <code>PreviewMode</code>


<div lang="en" dir="ltr" class="mw-content-ltr">
<span id="Network_synchronization"></span>
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.
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
只有已被同步的表情參數以及部分內建參數會透過網路傳送。每個角色所同步的完整資料包括:
For reliable late-joiner support, a recommended pattern is to split animator logic using the <code>IsLocal</code> 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.
* '''IK 目標''':包含頭部、下顎與雙手的位置資料;桌面模式與三點追蹤皆會同步這些資料。全身追蹤則額外同步臀部與雙腳的位置資料。使用 Index 控制器的用戶還會同步手指位置。
</div>
* '''已同步的表情參數''':只有標記為 Synced 的參數會被傳送。數值會經過量化處理:Int 類型以 0 至 255 的範圍同步;Float 類型以 −1 至 1 之間、每 1/127 為單位的數值同步;Bool 類型則同步為 true 或 false。
* '''內建 VRC 參數''':包括手勢、移動速度、語音以及其他執行期間參數。
* '''PhysBones''':姿勢位置資料會傳送給稍後加入房間的用戶。


<div lang="en" dir="ltr" class="mw-content-ltr">
為了確保後加入房間的用戶也能正確看到角色狀態,建議採用以 <code>IsLocal</code> 參數分離 Animator 邏輯的設計模式:本地端(<code>IsLocal = True</code>)圖層負責處理 Contact、Parameter Driver 以及所有邏輯運算,並將結果寫入已同步參數;遠端(<code>IsLocal = False</code>)圖層則只讀取這些已同步參數,並根據其值播放正確的視覺表現。這種做法可避免依賴不會同步的本地事件或邏輯,同時確保後加入房間的用戶能夠正確還原並顯示角色目前的狀態。
=== Gestures and facial expressions ===
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
<span id="Gestures_and_facial_expressions"></span>
The built-in <code>GestureLeft</code> and <code>GestureRight</code> parameters identify the user's hand gesture, while <code>GestureLeftWeight</code> and <code>GestureRightWeight</code> 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.
=== 手勢與臉部表情 ===
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
內建的 <code>GestureLeft</code> 與 <code>GestureRight</code> 參數用於識別用戶的手勢,而 <code>GestureLeftWeight</code> 與 <code>GestureRightWeight</code> 則提供類比扳機鍵的按壓程度。在 Humanoid 角色上,'''Gesture Playable Layer''''''手勢可播放層''')通常用於控制手勢,而臉部表情則通常透過 FX 圖層中的 Blendshape、材質屬性或其他非 Humanoid 動畫來驅動。
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.
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
在具備手指追蹤功能的控制器上,由於手指追蹤預設會覆蓋動畫的效果,因此創作者可使用 Tracking Control 狀態行為(State Behavior),在需要時將相關手指的控制方式由 '''Tracking'''('''追蹤''')切換為 '''Animation'''('''動畫''')模式。
== Expression Parameter Mismatching==
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
<span id="Expression_Parameter_Mismatching"></span>
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 <u>advanced</u> setups. The same conversion behavior can also be used with built-in VRChat Animator parameters.
==表情參數不相符==
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
表情參數不相符(Expression Parameter Mismatching)是指當表情參數與本機動畫控制(Animator Controller)參數之間使用不同的參數類型。雖然建議保持參數類型一致,但系統仍支援類型不相符的設定,並會依照特定規則在不同類型之間自動轉換數值。這種做法在某些 <u>Advanced</u> 配置中可能相當實用。同樣的轉換機制也適用於 VRChat 內建的動畫參數。
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.
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
Unity 的 Animator 系統在底層實際上使用 Float 來處理所有參數類型,而 VRChat 則會將已同步的自訂表情參數儲存為更精簡、適合網路傳輸的格式。Unity 與 VRCSDK 的使用者介面允許創作者為了方便而選擇不同的參數類型,但在底層仍可進行數值轉換。這代表參數並非以 C# 意義上的型別轉換方式運作,而是在不同系統之間以不相符的參數類型進行對應。這種行為也受到熱門工具如 Av3Emulator 與 Gesture Manager 的支援。
===Expression Parameter Bool===
 
</div>
<span id="Expression_Parameter_Bool"></span>
===表情參數 Bool===
{| class="wikitable"
{| class="wikitable"
|+<span lang="en" dir="ltr" class="mw-content-ltr">Animator Controller Parameter</span>
|+動畫控制參數
!<span lang="en" dir="ltr" class="mw-content-ltr">Type</span>
!類型
!<span lang="en" dir="ltr" class="mw-content-ltr">Expression Bool = False</span>
!Expression Bool = False
!<span lang="en" dir="ltr" class="mw-content-ltr">Expression Bool = True</span>
!Expression Bool = True
|-
|-
|Bool → Bool
|Bool → Bool
Line 169: Line 147:
|Float = 1.0
|Float = 1.0
|}
|}
<div lang="en" dir="ltr" class="mw-content-ltr">
<span id="Expression_Parameter_Int"></span>
===Expression Parameter Int===
===表情參數 Int===
</div>
{| class="wikitable"
{| class="wikitable"
|+<span lang="en" dir="ltr" class="mw-content-ltr">Animator Controller Parameter</span>
|+動畫控制參數
!<span lang="en" dir="ltr" class="mw-content-ltr">Type</span>
!類型
!<span lang="en" dir="ltr" class="mw-content-ltr">Behaviour</span>
!行為
|-
|-
|Int → Bool
|Int → Bool
|<span lang="en" dir="ltr" class="mw-content-ltr">Any Int value that isn't 0 sets bool to True</span>
|任何不為 0 的 Int 值都會將 Bool 設為 True
|-
|-
|Int → Int
|Int → Int
|<span lang="en" dir="ltr" class="mw-content-ltr">Expected Behaviour</span>
|預期行為
|-
|-
|Int → Float
|Int → Float
|<span lang="en" dir="ltr" class="mw-content-ltr">Straight Conversion: e.g. Int = 2 → Float = 2.0</span>
|直接轉換:例如 Int = 2 → Float = 2.0
|}
|}
<div lang="en" dir="ltr" class="mw-content-ltr">
<span id="Expression_Parameter_Float"></span>
===Expression Parameter Float===
===表情參數 Float===
</div>
{| class="wikitable"
{| class="wikitable"
|+<span lang="en" dir="ltr" class="mw-content-ltr">Animator Controller Parameter</span>
|+動畫控制參數
!<span lang="en" dir="ltr" class="mw-content-ltr">Type</span>
!類型
!<span lang="en" dir="ltr" class="mw-content-ltr">Behaviour</span>
!行為
|-
|-
|Float → Bool
|Float → Bool
|<span lang="en" dir="ltr" class="mw-content-ltr">Any Float value that isn't 0 sets bool to True</span>
|任何不為 0 的 Float 值都會將 Bool 設為 True
|-
|-
|Float → Int
|Float → Int
|<span lang="en" dir="ltr" class="mw-content-ltr">Rounded Conversion: ≥0.5 → 1 ; <0.5 → 0</span>
|四捨五入轉換:≥ 0.5 → 1< 0.5 → 0
|-
|-
|Float → Float
|Float → Float
|<span lang="en" dir="ltr" class="mw-content-ltr">Expected Behaviour</span>
|預期行為
|}
|}
<div lang="en" dir="ltr" class="mw-content-ltr">
<span id="Resources"></span>
==Resources==
==官方資源==
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
* 發布在 VRChat 上的 {{VRC link|https://vrchat.com/home/world/wrld_6168d07b-f55c-40bc-8077-749dde39983c|Avatar 3.0 Hub}} 世界。
*{{VRC link|https://vrchat.com/home/world/wrld_6168d07b-f55c-40bc-8077-749dde39983c|Avatar 3.0 Hub}} world on VRChat
* 發布在 VRChat 創作者文件上的[https://creators.vrchat.com/avatars/expression-menu-and-controls/ 表情選單與控制]
*[https://creators.vrchat.com/avatars/expression-menu-and-controls/ Expression Menu and Controls] on Creator Docs
* 發布在 VRChat 創作者文件上的[https://docs.vrchat.com/docs/action-menu#expression-menu 動作選單 - 表情選單]
*[https://docs.vrchat.com/docs/action-menu#expression-menu Action Menu - Expression Menu] on Creator Docs
* 發布在 VRChat 創作者文件上的[https://creators.vrchat.com/avatars/animator-parameters/ 表情參數]
*[https://creators.vrchat.com/avatars/animator-parameters/ Animator Parameters] on Creator Docs
* 發布在 VRChat 創作者文件上的[https://creators.vrchat.com/avatars/playable-layers Playable Layers]
*[https://creators.vrchat.com/avatars/playable-layers Playable Layers] on Creator Docs
* 發布在 VRChat 創作者文件上的[https://creators.vrchat.com/avatars/state-behaviors/ 狀態行為]
*[https://creators.vrchat.com/avatars/state-behaviors/ State Behaviors] on Creator Docs
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
<span id="See_also"></span>
==See also==
==參見==
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
*[[Special:MyLanguage/Avatars|角色]]
*[[Special:MyLanguage/Avatars|Avatars]]
**[[Special:MyLanguage/Avatar Dynamics|角色互動]]
**[[Special:MyLanguage/Avatar Dynamics|Avatar Dynamics]]
*[[Special:MyLanguage/Action Menu|動作選單]]
*[[Special:MyLanguage/Action Menu|Action Menu]]
*[[Special:MyLanguage/VRChat SDK|VRChat SDK]]
*[[Special:MyLanguage/VRChat SDK|VRChat SDK]]
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
<span id="References"></span>
==References==
==參考資料==
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
* [https://vrc.school/docs/Avatars/Expressions-Menu-Params VRC School: Expressions Menu and Parameters]
* [https://vrc.school/docs/Avatars/Expressions-Menu-Params VRC School: Expressions Menu and Parameters]
* [https://vrc.school/docs/Avatars/Gestures VRC School: Hand Gestures/Facial Expressions]
* [https://vrc.school/docs/Avatars/Gestures VRC School: Hand Gestures/Facial Expressions]
Line 237: Line 205:
* [https://vrc.school/docs/Other/Network-Sync VRC School: Network Sync]
* [https://vrc.school/docs/Other/Network-Sync VRC School: Network Sync]
* [https://vrc.school/docs/Other/Parameter-Mismatching VRC School: Expression Parameter Mismatching]
* [https://vrc.school/docs/Other/Parameter-Mismatching VRC School: Expression Parameter Mismatching]
</div>


[[Category:Avatar features{{#translation:}}]]
[[Category:Avatar features{{#translation:}}]]

Latest revision as of 06:54, 4 June 2026

查看 · 編輯這是與 VRChat 官方資訊有關的頁面!
它已經由 VRCWiki 團隊審核並批准。透過閱讀貢獻指南,以瞭解如何為此頁面貢獻。
動作選單中的表情選單範例。

表情」(Expressions),是在 VRChat 中的角色(Avatar)功能之一,其由用戶自訂的選單所組成,可讓用戶在角色上啟用各種動作或切換功能,旨在以靈活且方便的方式快速存取角色的獨特功能。

更多資訊請參閱關於角色的創作者文件

表情選單

遊戲內的表情選單,可透過動作選單(Action Menu)存取,也可透過快速選單(Quick Menu)主選單(Main Menu)中的表情標籤頁存取。這種操作方式適用於所有平台的 VRChat。角色表情的變化會同步給同一平台上的其他用戶,並可設定跨平臺同步

SDK 中的表情

表情功能可透過 VRChat SDK 中的各種參數進行編輯。

基礎表情

當未設定任何表情功能時,系統會自動為角色加入包含基礎動畫的預設表情選單,其中包含以下動畫:

  • 揮手(Wave)
  • 鼓掌(Clap)
  • 指向(Point)
  • 歡呼(Cheer)
  • 跳舞(Dance)
  • 後空翻(Backflip)
  • 死亡(Die)
  • 悲傷(Sadness)

自訂表情

若要新增自訂表情,請先在 Unity 中建立 Expression Menu表情選單)資產與 Expression Parameters表情參數)資產,然後在 VRChat Avatar Descriptor 的 Expressions 區段中指派這些資產。Expression Menu 用於定義哪些控制項會顯示於遊戲內選單,而 Expression Parameters 則用於定義這些控制項所變更之數值的名稱、類型、預設值,以及同步行為。

每個自訂參數都可以設定是否 Saved儲存)及 Synced同步)。已同步的自訂參數會計入角色的 256 位元同步預算,而單一角色最多可定義 8192 個自訂參數。此資產中的參數也可以由 Contact ReceiverParameter DriverPhysBone 以及 OSC 進行變更。

SDK 也提供了一個 Default Parameters預設參數)按鈕。按鈕會還原 VRChat 預設 AV3 控制器所使用的三個別名參數:VRCEmoteVRCFaceBlendHVRCFaceBlendV

控制

每個頁面最多可建立 8 個控制項。建立控制項時,可選擇以下類型:

  • Button按鈕):按下時瞬間設定指定數值,並在 VRChat 傳送變更後立即自動重設。
  • Toggle切換):啟用時設定指定數值,停用時則重設該數值。
  • Sub Menu子選單):下設另一個表情選單,並可選擇在該子選單開啟期間設定特定參數。
  • Two Axis Puppet雙軸控制):透過水平與垂直輸入控制兩個浮點數參數,通常範圍為 -1.01.0
  • Four Axis Puppet四軸控制):控制四個浮點數參數,分別對應四個方向,通常範圍為 0.01.0
  • Radial Puppet環形控制):以環狀滑塊控制一個浮點數參數,範圍為 0.01.0

控制選單範例
動作選單與臉部鏡子的使用範例。(動畫 GIF)

當你向不同方向移動搖桿、觸控板或滑鼠時,將會改變其動畫參數,以此來表現不同表情,或在不同表情之間進行混合(例如「開心」與「驚訝」)。任何參數都可以透過此選單進行控制。

你可以在任一隻手上開啟一個選單(或同時在兩隻手上開啟)。預設情況下,可透過快速撥動來選擇選項;你也可以在動作選單設定中改為使用扳機鍵進行選擇。若要返回表情選單的上一層,請按下扳機鍵。

當屬於控制類型的控制項被開啟時,VRChat 會使用較快速的 IK 同步模式即時同步其數值。控制項關閉後,當前數值會維持不變,直到再次被修改為止。

表情參數

表情參數Expression Parameters)可透過表情選單、Contact ReceiverOSCParameter DriverPhysBone 元件來控制角色功能。這些參數接著會對應至角色 FX、手勢(Gesture)或動作控制器中的 Animator Controller 參數。

設定

Expression Parameters 資產中的每個項目都會儲存以下資訊:

  • Name名稱):必須與 Animator 參數名稱完全一致。
  • Type類型):可為 BoolIntFloat
  • Default預設):當角色重設時的預設值。
  • Saved儲存):控制該數值是否會在不同工作階段之間保留。
  • Synced同步):控制該數值是否會傳送給其他用戶。

預設情況下,自訂參數會使用 VRChat 的 Playable 同步模式進行同步。當控制類型的控制項處於被開啟狀態時,則會暫時改用較快速的 IK 同步模式。

內建參數

VRChat 也提供內建的 Animator 參數。這些參數不需要額外加入 Expression Parameters 資產中,且不會計入自訂參數的預算限制。

內建參數處於唯讀模式,無法由用戶任意修改。要觸發內建參數,只需在 Playable Layer可播放層)的 Animator Controller 中使用對應名稱建立參數,VRChat 便會在執行期間自動更新其數值。這些參數不會被設定到子 AnimatorSub-Animator)上,而只會設定於 Playable Layer 的 Animator。

其他內建參數包括:

  • Viseme(Int):由唇形同步(Lip Sync)控制,數值範圍從 0(靜音)到 14(母音「u」)。當 Avatar Descriptor 的 Lip Sync 設定為 Viseme Blend ShapeViseme Parameter Only 時啟用。
  • Voice(Float):感知到的麥克風音量,範圍從 0.01.0,會受到距離及音罩(Earmuffs)設定影響。
  • VelocityXVelocityYVelocityZVelocityMagnitude(Float):沿各軸向及總體的移動速度(單位為公尺 / 秒)。本地端不會計算遊玩空間移動,而遠端則會計算。
  • Upright(Float):趴臥時為 0,站立時為 1
  • Grounded(Bool):表示用戶是否接觸地面。
  • MuteSelf(Bool):表示用戶是否已將自己的麥克風靜音。
  • Earmuffs(Bool):表示用戶是否已啟用耳罩功能。
  • IsOnFriendsList(Bool):表示檢視者是否為角色穿戴者的好友(在本地端永遠顯示為 False)。
  • ScaleFactorScaleFactorInverseEyeHeightAsMetersEyeHeightAsPercent(Float):與角色縮放相關的參數。由於 EyeHeightAsMeters 為線性數值,且不受上傳時身高影響,因此建議用於需要感知角色尺寸的系統。

每個內建參數都有其對應的同步類型,用來決定何時將數值傳送給遠端用戶:

  • IK:用於由追蹤資料衍生的數值,例如手勢、移動速度及是否接觸地面等。
  • Speech:用於與語音相關的數值,例如唇形同步及語音音量。
  • Playable:用於表示用戶狀態的數值,例如麥克風靜音、音罩、追蹤類型及角色縮放等。
  • None:用於僅限本地端使用的數值,例如 IsLocalPreviewMode

網路同步

只有已被同步的表情參數以及部分內建參數會透過網路傳送。每個角色所同步的完整資料包括:

  • IK 目標:包含頭部、下顎與雙手的位置資料;桌面模式與三點追蹤皆會同步這些資料。全身追蹤則額外同步臀部與雙腳的位置資料。使用 Index 控制器的用戶還會同步手指位置。
  • 已同步的表情參數:只有標記為 Synced 的參數會被傳送。數值會經過量化處理:Int 類型以 0 至 255 的範圍同步;Float 類型以 −1 至 1 之間、每 1/127 為單位的數值同步;Bool 類型則同步為 true 或 false。
  • 內建 VRC 參數:包括手勢、移動速度、語音以及其他執行期間參數。
  • PhysBones:姿勢位置資料會傳送給稍後加入房間的用戶。

為了確保後加入房間的用戶也能正確看到角色狀態,建議採用以 IsLocal 參數分離 Animator 邏輯的設計模式:本地端(IsLocal = True)圖層負責處理 Contact、Parameter Driver 以及所有邏輯運算,並將結果寫入已同步參數;遠端(IsLocal = False)圖層則只讀取這些已同步參數,並根據其值播放正確的視覺表現。這種做法可避免依賴不會同步的本地事件或邏輯,同時確保後加入房間的用戶能夠正確還原並顯示角色目前的狀態。

手勢與臉部表情

內建的 GestureLeftGestureRight 參數用於識別用戶的手勢,而 GestureLeftWeightGestureRightWeight 則提供類比扳機鍵的按壓程度。在 Humanoid 角色上,Gesture Playable Layer手勢可播放層)通常用於控制手勢,而臉部表情則通常透過 FX 圖層中的 Blendshape、材質屬性或其他非 Humanoid 動畫來驅動。

在具備手指追蹤功能的控制器上,由於手指追蹤預設會覆蓋動畫的效果,因此創作者可使用 Tracking Control 狀態行為(State Behavior),在需要時將相關手指的控制方式由 Tracking追蹤)切換為 Animation動畫)模式。

表情參數不相符

表情參數不相符(Expression Parameter Mismatching)是指當表情參數與本機動畫控制(Animator Controller)參數之間使用不同的參數類型。雖然建議保持參數類型一致,但系統仍支援類型不相符的設定,並會依照特定規則在不同類型之間自動轉換數值。這種做法在某些 Advanced 配置中可能相當實用。同樣的轉換機制也適用於 VRChat 內建的動畫參數。

Unity 的 Animator 系統在底層實際上使用 Float 來處理所有參數類型,而 VRChat 則會將已同步的自訂表情參數儲存為更精簡、適合網路傳輸的格式。Unity 與 VRCSDK 的使用者介面允許創作者為了方便而選擇不同的參數類型,但在底層仍可進行數值轉換。這代表參數並非以 C# 意義上的型別轉換方式運作,而是在不同系統之間以不相符的參數類型進行對應。這種行為也受到熱門工具如 Av3Emulator 與 Gesture Manager 的支援。

表情參數 Bool

動畫控制參數
類型 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

表情參數 Int

動畫控制參數
類型 行為
Int → Bool 任何不為 0 的 Int 值都會將 Bool 設為 True。
Int → Int 預期行為
Int → Float 直接轉換:例如 Int = 2 → Float = 2.0

表情參數 Float

動畫控制參數
類型 行為
Float → Bool 任何不為 0 的 Float 值都會將 Bool 設為 True
Float → Int 四捨五入轉換:≥ 0.5 → 1;< 0.5 → 0
Float → Float 預期行為

官方資源

參見

參考資料