> 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/chang-jing-bian-ji-qi/gou-jian/import-items.md).

# 导入自定义资源

导入你自己的 3D 模型、图片、声音等，用于你的场景。

你可以将自己的 3D 模型导入场景编辑器。你可以从互联网上大量免费或付费资源中挑选模型，或者创建自己的自定义模型。你也可以导入其他资源，如图片、音频文件和视频。

{% embed url="<https://www.youtube.com/watch?v=UepXpH-k0EI>" %}

## 导入资源

要将 3D 模型、图片、音频文件或视频从本地磁盘导入到你的场景中：

1. 将文件直接拖到底部面板上。你也可以点击 **+ 导入资源** 按钮，在底部面板左上角，从你的本地驱动器中选择。

![](https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-5948f0f1cc9c6dcf332a8b5398abf3a03bfa5a6b%2Fimport-assets.png?alt=media\&token=b446baae-3ec1-4e75-aa08-a4083655a06c)

2. 检查模型缩略图并点击 **导入**。导入多个资源时，使用箭头按钮逐个切换每个资源。

![](https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-40d2f049b11f39a8ff535565ffb2c47f1366e916%2Fimport-confirmation.png?alt=media\&token=76a7552f-b366-4f71-8d48-d2dae1092a0e)

现在你可以在 **本地资源** 选项卡中找到你的资源。资源会按类型分文件夹存放：3D 模型位于 *assets/Models* 文件夹中，图片位于 *assets/Images*，音频文件位于 *assets/Audio*，视频位于 *assets/Video*.

内置免费资源包中的项目存放在 *assets/asset-packs/*&#x4E2D;，编辑器中创建的自定义项目存放在 *assets/custom/*。较旧的场景可能会将用户导入的内容存放在 *assets/scene/* 中。你的场景代码可以使用所有这些路径，只需引用资源所在的文件夹即可。

* 对于 3D 模型，将 `.glb` 或 `.gltf` 文件拖到画布上，以将它们作为场景中的项目添加。
* 你也可以将图片、音频或视频文件拖到画布上。编辑器会创建一个现成的项目，并且已经指向你的文件：

  * 一个 `.png`, `.jpg` 或 `.jpeg` 文件会变成一个 **图片** 项目。
  * 一个 `.mp3`, `.ogg` 或 `.wav` 文件会变成一个环境音效项目。
  * 一个 `.mp4` 文件会变成一个 **视频屏幕** 项目。

  新项目会以文件名命名，并具有与资源包中对应项目相同的组件和设置，因此你可以立即在检查器中对其进行调整。
* 任何资源也都可以拖到场景中已存在项目的字段上。例如，你可以将一个 `.mp3` 文件拖到 *路径* 字段上，适 *音频源* 组件。

{% hint style="info" %}
**💡 提示**：你也可以将文件直接粘贴到项目的 `assets` 文件夹中，无论是从 Finder、Explorer 还是其他位置。复制完成后不久，它们会单独显示在 **本地资源** 选项卡中。如果它们没有出现，请点击 **刷新** 旁边的 **导入资源** 按钮。

<img src="https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-b1d21406bc228bc4e5def5af418231be27f50405%2Frefresh-assets.png?alt=media" alt="" data-size="original">
{% endhint %}

### 支持的格式

#### 音频

支持以下音频格式：

* *.mp3*
* *.wav*
* *.ogg*

#### 图片

支持以下图片格式：

* *.png*
* *.jpg*
* *.jpeg*

#### 视频

支持以下视频格式：

* *.mp4*

#### 3D 模型

支持以下 3D 模型格式：

* *.glTF*
* *.glb*

两者都可以包含外部纹理图像文件，或者外部二进制（*.bin*）文件。

你可以使用各种不同的编辑器和工具将其他格式转换为这些格式。参见 [3D 建模](/creator/content-creator-zh/3d-jian-mo-yu-dong-hua/3d-models.md) 以获取建议和技巧。

模型中的所有材质都需要是 *基础材质* 或 *PBR*，并且所有纹理的尺寸都需要是 2 的幂（例如：256、512）。参见 [场景限制](/creator/content-creator-zh/chang-jing-sdk7/you-hua/scene-limitations.md) 了解详情。

任何导入的文件，不论类型，若要在场景中可用，其大小必须小于 50 MB。不支持更大的文件。

**免费的 3D 模型库**

除了自己构建 3D 模型外，你还可以从一些免费或付费资源库中下载，或者使用 AI 工具生成。参见 [实用资源](/creator/content-creator-zh/chang-jing-sdk7/ru-men/useful-resources.md) 以获取推荐的资源库和生成式 AI 工具列表。

{% hint style="warning" %}
**📔 注意**：请注意你下载的内容所带有的许可限制。
{% endhint %}

请注意，在这些网站中的一些上，你可以选择要下载模型的格式。始终选择 *.glTF* 或 *.glb* 格式（如果可用）。如果不可用，你必须先将它们转换为 *.glTF* 或 *.glb* ，然后才能在场景中使用它们。为此，我们建议将它们导入 Blender，并使用可用的 *.glTF* 导出插件之一导出。

### 碰撞体

你可能会发现，在运行预览时，玩家可以穿过你导入的 3D 模型。这很可能是因为这些模型缺少一个 *碰撞网格* 来定义碰撞几何体。参见 [碰撞体](/creator/content-creator-zh/3d-jian-mo-yu-dong-hua/colliders.md) 了解更多详情和说明。

{% hint style="info" %}
**💡 提示**：与其编辑模型来添加一个 *碰撞网格*，不如采用更简单的替代方案，即添加一个 *隐形墙* 智能项目，形状大致相同，用来代替它。
{% endhint %}

### 动画

如果导入的模型包含动画，模型中打包的第一个动画将会循环播放。

请注意，你无法控制动画何时开始或停止，也无法控制在有多个动画时播放哪一个。

如果场景中有多个玩家，他们彼此看到的动画可能不同步。

要改变这种行为，你可以包含一个 **动画器** 组件遍历所有玩家。详见 [让任意项目变为智能项目](/creator/content-creator-zh/chang-jing-bian-ji-qi/jiao-hu-xing/make-any-item-smart.md) ，让无代码工具使你的项目具有交互性。


---

# 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/chang-jing-bian-ji-qi/gou-jian/import-items.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.
