Blender目录布局#

This page documents the different directories used by Blender.

This can be helpful for troubleshooting, automation and customization.

用户目录#

User directories store preferences, startup file, installed extensions, presets and more. By default these use the standard configuration folders for each operating system.

Linux#

$HOME/.config/blender/4.2/

If the $XDG_CONFIG_HOME environment variable is set:

$XDG_CONFIG_HOME/blender/4.2/

macOS#

/Users/$USER/Library/Application Support/Blender/4.2/

Windows#

%USERPROFILE%\AppData\Roaming\Blender Foundation\Blender\4.2\

便携安装#

When running Blender from a portable drive, it's possible to keep the configuration files on the same drive to take with you.

To enable this, create a folder named portable at the following locations:

  • Windows: Next to the Blender executable, in the unzipped folder

  • Linux: Next to the Blender executable, in the unzipped folder

  • macOS: Inside the application bundle at Blender.app/Contents/Resources

This folder will then store preferences, startup file, installed extensions and presets.

环境变量#

The BLENDER_USER_RESOURCES environment variable can be set to a custom directory to replace the default user directory.

系统目录#

System directories store files that come bundled with Blender and are required for it to function. This includes scripts, presets, essential assets and more.

Linux#

Archive downloaded from blender.org:

./4.2/

Linux distribution packages:

/usr/share/blender/4.2/

macOS#

./Blender.app/Contents/Resources/4.2/

Windows#

从blender.org下载的Zip文件:

./4.2/

从blender.org下载的安装包:

%ProgramFiles%\Blender Foundation\Blender\4.2\

Microsoft商店安装:

%ProgramFiles%\WindowsApps\BlenderFoundation.Blender<HASH>\Blender\4.2\

环境变量#

BLENDER_SYSTEM_SCRIPTS and BLENDER_SYSTEM_EXTENSIONS environment variables can be used to bundle additional scripts and extensions, that are not part of the regular Blender installation.

Other BLENDER_SYSTEM environment variables can override other system paths, though are not commonly used in practice.

路径布局#

./autosave

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

位于用户目录中。

./config

用户配置与会话信息。

位于用户目录中。

./config/startup.blend

启动时载入的blend文件。

./config/userpref.blend

用户偏好设置。

./config/bookmarks.txt

文件浏览器书签。

./config/recent-files.txt

最近打开的文件列表。

./config/{APP_TEMPLATE_ID}/startup.blend

Startup file for an application template.

./config/{APP_TEMPLATE_ID}/userpref.blend

User preferences file for an application template.

./datafiles

Data files loaded at runtime.

Located in both user and system directories. User data files either override or add to system data files.

./datafiles/colormanagement

默认的 OpenColorIO 配置。

./datafiles/fonts

用户界面字体。

./datafiles/studiolights

Studio light images for 3D viewport.

./extensions

扩展存储库。

Located in both user and system directories. Repositories are loaded from both directories.

./scripts

插件、预设、模板、用户界面、启动脚本。

Located in both user and system directories. Scripts are loaded from both directories.

./scripts/addons/*.py

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

./scripts/addons/modules/*.py

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

./scripts/addons_core/*.py

The add-ons directory which is used for bundled add-ons.

./scripts/addons_core/modules/*.py

Modules for addons_core to use (added to Python's sys.path when it found).

./scripts/modules/*.py

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

./scripts/startup/*.py

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

./scripts/startup/bl_app_templates_user/{APP_TEMPLATE_ID}

Application templates installed in user directories.

./scripts/startup/bl_app_templates_system/{APP_TEMPLATE_ID}

pplication templates automatically loaded from system directories.

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

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

./scripts/templates_py/*.py

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

./scripts/templates_osl/*.osl

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

./python

绑定的Python发行版。

位于系统目录中。

缓存目录#

The cache directory is used to store persistent caches locally. Currently it is only used for the indexing of Asset Libraries. The operating system is not expected to clear this automatically.

将使用以下路径:

  • Linux:

    $XDG_CACHE_HOME/blender/ if $XDG_CACHE_HOME is set, otherwise $HOME/.cache/blender/

  • macOS:

    /Library/Caches/Blender/

  • Windows:

    %USERPROFILE%\AppData\Local\Blender Foundation\Blender\Cache\

临时目录#

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

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

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

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

  • /tmp/ 目录。