> For the complete documentation index, see [llms.txt](https://docs.decentraland.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.decentraland.org/creator/content-creator-zh/chuan-dai-wu-yu-biao-qing-dong-zuo/biao-qing-dong-zuo/avatar-rig.md).

# 头像骨架

关于头像骨架的基础知识。

骨架（Rig）是一种虚拟骨骼，可让模型动起来。它由一组具有层级关系的独立骨骼组成，与真实骨骼相似，并遵循父级/子级关系。本文将介绍一些基础的骨架绑定概念，例如骨骼位置、骨骼朝向、变形与非变形骨骼、IK 与 FK 的区别及其用途。有关角色骨架结构、自定义属性和动画设置的信息，请参阅 [骨架功能](https://docs.decentraland.org/creator/content-creator-zh/chuan-dai-wu-yu-biao-qing-dong-zuo/biao-qing-dong-zuo/rig-features.md).

{% hint style="info" %}
**💡 提示**：安装 [Decentraland Tools Blender 插件](https://extensions.blender.org/add-ons/decentraland-tools/)。该插件包含多种实用功能，可帮助你编辑和导出 3D 模型、可穿戴物品和表情动画。
{% endhint %}

## **基础知识**

#### 骨骼位置或枢轴点

虽然骨架并非人体骨骼的精确复制品，但放置数字骨骼时，最好遵循真实骨骼的位置。这样可以确保变形自然流畅。骨骼位置很重要，因为它决定了枢轴点（也就是动作的起始位置）。骨骼放置不当会导致网格变形不佳。下图展示了骨骼位置不同所产生的差异。

![head\_pivot\_rig\_1.0.gif](https://raw.githubusercontent.com/decentraland/documentation-creators/main/images/emotes/head_pivot_rig_1.0.gif)

![head\_pivot\_rig\_2.0.gif](https://raw.githubusercontent.com/decentraland/documentation-creators/main/images/emotes/head_pivot_rig_2.0.gif)

#### 骨骼方向

骨骼的朝向决定其旋转方向，例如正 X 轴、负 Z 轴等。骨骼朝向有多种设置方式，只要整个骨架保持一致即可。例如，如果选择 X 轴作为脊柱前屈的方向，那么腿部采用相同的设置也更合理。骨骼朝向也很重要，因为它会影响镜像行为。通常，右侧骨骼的朝向是左侧骨骼朝向的镜像，反之亦然。

![](https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-dd84fa483bd13a0beae547c04940f0929ad46b1d%2FboneAxis.webp?alt=media)

*打开坐标轴以显示骨骼朝向。*

![](https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-01257994a11800ea01ef0975e92ee07993013015%2Fboneorientation.webp?alt=media)

*坐标轴表示骨骼旋转的方向。*

#### 变形与非变形骨骼

变形骨骼会使网格发生变形，决定模型的运动方式。它们构成基础骨架，且 **绝对不应修改**。以任何方式修改基础骨架都可能破坏骨架绑定，导致动画导出后无法正常工作。因此，基础骨架被移到了单独的图层（最底部的最后一层）。这些骨骼会与网格一起导出，组成骨架。

非变形骨骼不会使网格发生变形，但对于构建稳健的骨架绑定仍然必不可少，可用于设置 [IK、FK](#whats-fk-and-ik-in-a-rig) 和其他自定义属性。非变形骨骼的示例包括控制器、IK 和 FK 骨骼以及脚部设置骨骼。这些骨骼不应导出，仅用于动画制作。

![](https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-ac8a6e866ccbe2eb2601d390940320353661c5eb%2FDeformationBones.webp?alt=media)

*变形骨骼。*

![](https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-6f73216e1d55b29315ba98c7e6308e63ba34ba88%2FNonDeformationBones.webp?alt=media)

*非变形骨骼。*

{% hint style="warning" %}
⚠️ **注意！** **绝对不要修改基础骨架！**
{% endhint %}

![](https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-40cc05986ad8126d9893029c17f4aa040fd4a0a8%2FBaseSkeleton.webp?alt=media)

*基础骨架。*

#### 控制器

良好的做法是，不要通过操纵变形骨骼来制作动画，因为这可能导致骨架绑定出错。相反， **应通过操纵控制器来制作动画。**

控制器本质上是非变形骨骼，因此不会影响网格，可以安全地进行操纵和动画制作。它们通过约束和驱动器控制基础骨架，而不会直接改动基础骨架。控制器通常具有不同的形状和颜色，用作提示以标明其功能和用途，让动画师更容易区分不同骨骼。有些控制器还具有位置、旋转和缩放变换之外的属性，因为可以为其添加自定义属性，例如 IK/FK 切换开关。

还要注意，不能在最初创建控制器设置的软件之外的其他软件中使用该设置。每种软件都有自己的逻辑，而且约束无法导出。

![](https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-433b58253e5229cb7e7cc2f5b8b9fbb168c05a2b%2FRigControls.webp?alt=media) \_不同形状和颜色的控制器。\_

{% hint style="warning" %}
⚠️ **警告**：必须在创建骨架绑定时所用的软件中制作动画。例如，Blender 中的设置无法在 Maya 中使用，反之亦然。
{% endhint %}

#### 骨架绑定中的 FK 和 IK 是什么？

骨架绑定可以采用两种不同的设置，影响模型的运动方式：FK 和 IK。

#### FK——正向运动学

在正向运动学（FK）中，层级中的父级骨骼移动时，其下所有子骨骼也会随之移动。以手臂为例：肩膀旋转时，手臂其余部分也会随之旋转；手臂旋转时，前臂也会跟着运动。使用 FK 制作动画时，必须逐个旋转每根骨骼。这种设置能够精细控制动作，也非常适合制作弧线运动，而弧线运动对于动画流畅自然至关重要。

*层级中的运动方向。*

![](https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-79ba22a29016ddd7933763c8436f94bf6a6ea0cc%2FFK_GIF.webp?alt=media)

*使用 FK 时，必须逐个旋转每根骨骼。*

#### IK——反向运动学

在反向运动学（IK）中，层级中的子级可以影响其父级的运动。仍以手臂为例：移动手部时，手臂其余部分会跟随运动。这也意味着无论肩膀如何移动，手部都会保持在原位。在这种设置中，极向量/极向目标会控制骨骼的弯曲方向。腿部通常采用 IK，这对于制作动画时让脚保持贴地至关重要。

![](https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-8cf1f9096e9b986c22abd982d8ac752dd1c40267%2FIK.webp?alt=media)

*层级中的运动方向。*

![](https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-d5bf8303d056e198578ca1852c726e2616d65b7a%2FIK_last.webp?alt=media)

*使用 IK 时，移动手部会带动整条手臂，同时手部仍会保持在设定位置。极向目标决定肘部的弯曲方向。*


---

# 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.decentraland.org/creator/content-creator-zh/chuan-dai-wu-yu-biao-qing-dong-zuo/biao-qing-dong-zuo/avatar-rig.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.
