Blender目录布局

This page documents the different directories used by Blender (which can be helpful for troubleshooting).

Blender使用三种不同的目录,其具体位置与操作系统相关。

LOCAL

配置和运行时数据位置(用于独立包)。

USER

配置文件位置(通常位于用户的主目录下)

SYSTEM

系统级安装的运行时数据位置(可能是只读的)。

对于系统级安装, SYSTEMUSER 文件夹都是必需的。

对于本地解压的Blender发行版,这些用户配置数据和运行时数据均位于相同的子文件夹下面,允许Blender的多个版本共存而且不会有冲突,可以忽略 USERSYSTEM 文件。这需要用户自行在 LOCAL 目录创建名为 config 的文件夹。

平台相关路径

下面是各个系统的默认文件夹位置:

Linux

LOCAL
./3.4/
USER
$HOME/.config/blender/3.4/
SYSTEM
/usr/share/blender/3.4/

Note

路径 ./3.4/ 相对于Blender可执行文件位置,用于blender.org 官方编译的独立发行版。

Note

如果设置了 $XDG_CONFIG_HOMEUSER 路径会使用该设置:

$XDG_CONFIG_HOME/blender/3.4/

macOS

LOCAL
./3.4/
USER
/Users/$USER/Library/Application Support/Blender/3.4/
SYSTEM
/Library/Application Support/Blender/3.4/

Note

macOS 的Blender二进制文件存储在 ./Blender.app/Contents/MacOS/Blender ,所以数据和配置的本地路径是:

./Blender.app/Contents/Resources/3.4/

Windows

LOCAL
.\3.4\
USER
%USERPROFILE%\AppData\Roaming\Blender Foundation\Blender\3.4\
SYSTEM
%USERPROFILE%\AppData\Roaming\Blender Foundation\Blender\3.4\

Note

For installations from the Window's Store, the USER and SYSTEM directories are inside a special folder resembling: %USERPROFILE%\AppData\Local\Packages\BlenderFoundation.Blender<HASH>\LocalCache\Roaming\Blender Foundation\Blender where "HASH" is a string specific to each instillation.

路径布局

下面的路径布局用于上文讲到的目录。

比方说, ./config/startup.blend 指的可能就是 ~/.blender/|BLENDER_VERSION|/config/startup.blend

./autosave/ ...

自动保存blend文件位置。(仅Windows,其他操作系统位于临时文件目录)。

搜索顺序: LOCAL, USER

./config/ ...

默认值与会话信息。

搜索顺序: LOCAL, USER

./config/startup.blend

启动时载入的默认文件。

./config/userpref.blend

启动时载入的默认设置。

./config/bookmarks.txt

文件浏览器书签。

./config/recent-files.txt

最近打开的文件列表。

./datafiles/ ...

运行时文件。

搜索顺序: LOCAL, USER, SYSTEM

./datafiles/locale/{language}/

用户界面翻译的静态预编译语言文件。

./scripts/ ...

用户界面和工具的Python 脚本。

搜索顺序: LOCAL, USER, SYSTEM

./scripts/addons/*.py

可以在用户设置启用的Python插件,包括导入/导出格式支持、 渲染引擎集成和许多方便的工具。

./scripts/addons/modules/*.py

插件用到的模块(添加到Python 的 sys.path)。

./scripts/addons_contrib/*.py

另一个插件目录,用于社区维护的插件(必须手动创建)。

./scripts/addons_contrib/modules/*.py

addons_contrib 用到的模块(添加到Python的 sys.path)。

./scripts/modules/*.py

包含核心API和工具函数的Python模块,供其他脚本导入(添加到 Python 的 sys.path)。

./scripts/startup/*.py

启动时将自动载入的脚本。

./scripts/presets/{preset}/*.py

预设文件,用于存储用户定义的布料、渲染格式等设置。

./scripts/templates_py/*.py

可以从 文本编辑器 ‣ 模板 ‣ Python 访问的示例脚本。

./scripts/templates_osl/*.osl

可以从 文本编辑器 ‣ 模板 ‣ 开放式着色语言(OSL) 访问的OSL着色器示例。

./python/ ...

绑定的Python发行版。

搜索顺序: LOCAL, SYSTEM

缓存目录

缓存目录用于在本地存储永久chaches。目前它仅用于 资产库 的索引。操作系统不会自动清除此内容。

下面的表格列出了组合键的模拟用法:

  • Linux

    `` $ XDG_CACHE_HOME/BRENDER/如果 $ XDG_CACHE_HOME 设置,否则 $ HOME/.cache/BRENDER/``

  • macOS

    /Library/Chaches/Blender/

  • Windows

    `` % USERPROFILE %AppDataLocalBlender FoundationBlenderCache``

临时目录

临时目录用于存储各种运行时文件(包括渲染层、物理缓存、复制-粘贴缓存和崩溃日志)。

临时目录的选择基于以下优先级:

  • 用户设置 (见 文件路径)。

  • 环境变量 (Windows为 TEMP ,其他平台为 TMP & TMP_DIR)。

  • /tmp/ 目录。

Overriding Default Directories

It's possible to override the default USER and SYSTEM directories using environment variables.

While this shouldn't be needed for typical usage, some specialized use cases may take advantage of this, such as:

  • Using a shared network drives for specific paths.

  • Isolating an instance from the default user files to prevent automated tasks from accessing user configuration.

See 环境变量 for details.