> 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 的区别及其用途。关于角色绑定结构、自定义属性以及动画设置的信息可以在 [绑定功能](/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 %}

## **基础知识**

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

尽管 rig 并不是人体骨架的完全复制，但在放置数字骨骼时，遵循现实中的骨骼位置是个好习惯。这样做是为了确保变形真实而流畅。骨骼位置很重要，因为它决定了枢轴点（动作开始的地方）。骨骼放置错误会导致网格变形不佳。下方图片展示了骨骼位置的差异。

![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 等。只要在整个 rig 中保持一致，就可以用很多不同的方式来设置。例如，如果选择 X 轴作为脊柱前屈动作的方向，那么腿部也使用同样的设置就很合理。朝向也很重要，因为它会影响镜像行为。也就是说，通常右侧的朝向是左侧朝向的镜像版本，反之亦然。

![](https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-0ca8cf13d59ffd63b35554c9926c95b15a858756%2FboneAxis.gif?alt=media\&token=574f8999-a571-4bff-ad7f-ae8ecc5dcede)

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

![](https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-d88dffc01ac9a2cef8e92560d1d474b5ea5b678e%2Fboneorientation.gif?alt=media\&token=e32aa456-ddf2-4e25-aba8-ddcce1e7dea3)

*坐标轴就是骨骼旋转的方向。*

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

变形骨骼会让网格发生形变，它们负责模型的移动方式。那就是基础骨架，而且它 **绝对不应该被编辑**。对它做任何改动都可能破坏 rig，而且导出后动画将无法工作。出于这个原因，这个基础 rig 被移动到了它自己的图层中（最底部的最后一层）。这些骨骼就是会随网格一起导出的骨架。

非变形骨骼不会让网格发生形变，但它们在一个稳健的 rig 中仍然是必需的，并用于 [IK、FK](#what’s-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-617f8ee76a78ef3cdf9ddb35a1643e6c2d3ec4a9%2FDeformationBones.png?alt=media\&token=a513e3c9-baed-414d-bdee-8e5584cfc176)

*变形骨骼。*

![](https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-dd1eef74806715dfab5aa4ed780e20037c643cb4%2FNonDeformationBones.png?alt=media\&token=a4dc0c97-aa2a-4e7d-893f-58407603718b)

*非变形骨骼。*

{% hint style="warning" %}
⚠️ **注意！** **不要编辑基础骨架！**
{% endhint %}

![](https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-efdebcd044a259066f57ea9b43add79cff6cd69c%2FBaseSkeleton.png?alt=media\&token=b17fd1ad-a941-471a-bd50-122ffdd7de0f)

*基础骨架。*

#### 控制器

按照最佳实践，rig 不应该通过操纵变形骨骼来制作动画，因为这可能会导致 rig 失效。相反， **动画应该通过操纵控制器来完成。**

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

同时还要注意，无法在与创建时不同的软件中使用这套控制器设置。每个软件都有自己的逻辑，而且约束无法导出。

![](https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-5a35cfafed8502560e922a62958e0791b8f196d5%2FRigControls.png?alt=media\&token=fb5cd3e4-2268-4aae-b8de-7a6346b02ec5) \_控制器及其不同的形状和颜色。\_

{% hint style="warning" %}
⚠️ **警告**: rig 必须在创建它的软件中进行动画制作。例如，不能把 Blender 的设置用到 Maya 中，反之亦然。
{% endhint %}

#### rig 中的 FK 和 IK 是什么？

一个 rig 可以使用两种不同的设置，它们会影响其运动方式：FK 和 IK。

#### FK - 前向运动学

在前向运动学（FK）中，层级中的父级会带动其下所有子骨骼一起移动。以手臂为例：当肩膀旋转时，整条手臂也会随之旋转；当上臂旋转时，前臂会跟随其动作。在使用 FK 制作动画时，每根骨骼都必须单独旋转。这种设置对动作有很强的控制力，非常适合弧线运动，而弧线运动对流畅动画至关重要。

*层级中的运动方向。*

![](https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-e80fd8aee4e2111128bd3a0532630b69e9ce7afe%2FFK_GIF.gif?alt=media\&token=4b2b8658-ba7f-4a55-b34a-784e370e592f)

*在 FK 中，每根骨骼都必须单独旋转。*

#### IK - 反向运动学

在反向运动学（IK）中，层级中的子级可以影响其父级的运动。以手臂为例，当手在周围移动时，整条手臂都会跟随这个动作。这也意味着，无论肩膀如何移动，手都会保持在它的位置。在这种设置中，pole vector / pole target 会控制骨骼弯曲的方向。腿部通常使用 IK，这对于动画时让脚保持在地面高度非常重要。

![](https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-b740a0f922dfa3bca875d87f15c9809274b124e5%2FIK.png?alt=media\&token=c32e03ab-21b9-42a7-a2c7-1793fbd8aff8)

*层级中的运动方向。*

![](https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-c98257d54f76eecf00cd6d398d4634d0e9dc1251%2FIK_last.gif?alt=media\&token=66a9072c-f8e1-4053-ac8f-76fcf79df9f4)

*在 IK 中，手会带动整条手臂移动，并且还能保持它的位置。pole target 驱动肘部弯曲的方向。*


---

# 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.
