Blender 目录布局

本页记录了 Blender 使用的不同目录 (对于排查错误有帮助)

Blender 可能会使用三个不同的目录,它们的具体位置取决于平台。

LOCAL:

配置和运行时数据的位置(针对独立捆绑包)。

USER:

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

SYSTEM:

Location of run-time data for system wide installation (may be read-only).

For system installations both SYSTEM and USER directories are needed.

For locally extracted Blender distributions, the user configuration and run-time data are kept in the same subdirectory, allowing multiple Blender versions to run without conflict, ignoring the USER and SYSTEM files. This requires you to create a folder named config in the LOCAL directory.

Platform Dependent Paths

Here are the default locations for each system:

Linux

LOCAL:
./3.6/
USER:
$HOME/.config/blender/3.6/
SYSTEM:
/usr/share/blender/3.6/

Note

The path ./3.6/ is relative to the Blender executable and is used for self-contained bundles distributed by official blender.org builds.

Note

The USER path will use $XDG_CONFIG_HOME if it is set:

$XDG_CONFIG_HOME/blender/3.6/

macOS

LOCAL:
./3.6/
USER:
/Users/$USER/Library/Application Support/Blender/3.6/
SYSTEM:
/Library/Application Support/Blender/3.6/

Note

macOS stores the Blender binary in ./Blender.app/Contents/MacOS/Blender. The local path to data and config is:

./Blender.app/Contents/Resources/3.6/

Windows

LOCAL:
.\3.6\
USER:
%USERPROFILE%\AppData\Roaming\Blender Foundation\Blender\3.6\
SYSTEM:
%USERPROFILE%\AppData\Roaming\Blender Foundation\Blender\3.6\

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

路径布局

This is the path layout which is used within the directories described above.

Where ./config/startup.blend could be ~/.blender/|BLENDER_VERSION|/config/startup.blend for example.

./autosave/ ...

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

搜索顺序:LOCAL, USER

./config/ ...

Defaults & session info.

搜索顺序:LOCAL, USER

./config/startup.blend

Default file to load on startup.

./config/userpref.blend

Default preferences to load on startup.

./config/bookmarks.txt

文件浏览器书签。

./config/recent-files.txt

最近打开的文件列表。

./datafiles/ ...

运行时文件。

搜索顺序:LOCAL, USER, SYSTEM

./datafiles/locale/{language}/

Static precompiled language files for UI translation.

./scripts/ ...

Python scripts for the user interface and tools.

搜索顺序:LOCAL, USER, SYSTEM

./scripts/addons/*.py

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

./scripts/addons/modules/*.py

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

./scripts/addons_contrib/*.py

Another add-ons directory which is used for community maintained add-ons (must be manually created).

./scripts/addons_contrib/modules/*.py

Modules for addons_contrib to use (added to Python's 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

本地缓存目录

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

将使用以下路径:

  • Linux:

    如果设置了 $XDG_CACHE_HOME ``,则为 ``$XDG_CACHE_HOME ``,否则 ``$HOME/.cache/blender/

  • macOS:

    /Library/Caches/Blender/

  • Windows:

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

临时目录

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

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

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

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

  • /tmp/ 目录。

覆盖默认目录

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.