扩展的命令行参数

Command for managing Blender extensions.

选项:

  • -h, —help

    显示帮助信息然后退出

子命令:

包管理

  • list:

    列出所有包。

    sync:

    与远程存储库同步。

    update:

    更新任意过时的包。

    install:

    安装包。

    install-file:

    从文件安装包。

    remove:

    移除包。

存储库管理

  • repo-list:

    列出存储库。

    repo-add:

    添加存储库。

    repo-remove:

    移除存储库。

扩展创建

  • build:

    构建一个包。

    validate:

    验证一个包。

    server-generate:

    从所有的包创建一个列表。

包管理

子命令:list

用法:

  1. blender --command extension list [-h] [-s]

从所有启用的存储库列出包。

选项:

  • -h, —help

    显示帮助信息然后退出

    -s, —sync

    Sync the remote directory before performing the action.

子命令:sync

用法:

  1. blender --command extension sync [-h]

下载远程存储库的包信息。

选项:

  • -h, —help

    显示帮助信息然后退出

子命令:update

用法:

  1. blender --command extension update [-h] [-s]

下载并更新任意过时的包。

选项:

  • -h, —help

    显示帮助信息然后退出

    -s, —sync

    Sync the remote directory before performing the action.

子命令:install

用法:

  1. blender --command extension install [-h] [-s] [-e] [--no-prefs]
  2. PACKAGES

位置参数:

  • PACKAGES:

    The packages to operate on (separated by , without spaces).

选项:

  • -h, —help

    显示帮助信息然后退出

    -s, —sync

    Sync the remote directory before performing the action.

    -e, —enable

    在安装后启用扩展。

    --no-prefs

    Treat the user-preferences as read-only, preventing updates for operations that would otherwise modify them. This means removing extensions or repositories for example, wont update the user-preferences.

子命令:install-file

用法:

  1. blender --command extension install-file [-h] -r REPO [-e] [--no-prefs]
  2. FILE

安装一个包文件到用户存储库。

位置参数:

  • FILE:

    包文件。

选项:

  • -h, —help

    显示帮助信息然后退出

    -r REPO, —repo REPO

    存储库标识符。

    -e, —enable

    在安装后启用扩展。

    --no-prefs

    Treat the user-preferences as read-only, preventing updates for operations that would otherwise modify them. This means removing extensions or repositories for example, wont update the user-preferences.

子命令:remove

用法:

  1. blender --command extension remove [-h] [--no-prefs] PACKAGES

禁用 & 移除包。

位置参数:

  • PACKAGES:

    The packages to operate on (separated by , without spaces).

选项:

  • -h, —help

    显示帮助信息然后退出

    --no-prefs

    Treat the user-preferences as read-only, preventing updates for operations that would otherwise modify them. This means removing extensions or repositories for example, wont update the user-preferences.

存储库管理

子命令:repo-list

用法:

  1. blender --command extension repo-list [-h]

列出所有保存在Blender偏好设置里的存储库。

选项:

  • -h, —help

    显示帮助信息然后退出

子命令:repo-add

用法:

  1. blender --command extension repo-add [-h] [--name NAME]
  2. [--directory DIRECTORY]
  3. [--url URL]
  4. [--access-token ACCESS_TOKEN]
  5. [--source SOURCE]
  6. [--cache BOOLEAN] [--clear-all]
  7. [--no-prefs]
  8. ID

添加新的本地或远程存储库。

位置参数:

  • ID:

    存储库标识符。

选项:

  • -h, —help

    显示帮助信息然后退出

    --name NAME

    要显示在界面内的名称(可选)。

    --directory DIRECTORY

    The directory where the repository stores local files (optional). When omitted a directory in the users directory is automatically selected.

    --url URL

    The URL, for remote repositories (optional). When omitted the repository is considered “local” as it is not connected to an external repository, where packages may be installed by file or managed manually.

    --access-token ACCESS_TOKEN

    The access token to use for remote repositories which require a token.

    --source SOURCE

    The type of source in (‘USER’, ‘SYSTEM’). System repositories are managed outside of Blender and are considered read-only.

    --cache BOOLEAN

    使用包缓存(默认为 1 )。

    --clear-all

    Clear all repositories before adding, simplifies test setup.

    --no-prefs

    Treat the user-preferences as read-only, preventing updates for operations that would otherwise modify them. This means removing extensions or repositories for example, wont update the user-preferences.

子命令:repo-remove

用法:

  1. blender --command extension repo-remove [-h] [--no-prefs] ID

移除一个存储库。

位置参数:

  • ID:

    存储库标识符。

选项:

  • -h, —help

    显示帮助信息然后退出

    --no-prefs

    Treat the user-preferences as read-only, preventing updates for operations that would otherwise modify them. This means removing extensions or repositories for example, wont update the user-preferences.

扩展创建

子命令:build

用法:

  1. blender --command extension build [-h] [--source-dir SOURCE_DIR]
  2. [--output-dir OUTPUT_DIR]
  3. [--output-filepath OUTPUT_FILEPATH]
  4. [--valid-tags VALID_TAGS_JSON]
  5. [--split-platforms] [--verbose]

在当前目录下构建一个包。

选项:

  • -h, —help

    显示帮助信息然后退出

    --source-dir SOURCE_DIR

    The package source directory containing a blender_manifest.toml manifest.

    Default’s to the current directory.

    --output-dir OUTPUT_DIR

    包输出目录。

    Default’s to the current directory.

    --output-filepath OUTPUT_FILEPATH

    包输出文件路径(需包含一个 .zip 扩展名)。

    Defaults to {id}-{version}.zip using values from the manifest.

    --valid-tags VALID_TAGS_JSON

    Reference a file path containing valid tags lists.

    If you wish to reference custom tags a .json file can be used. The contents must be a dictionary of lists where the key matches the extension type.

    • 例如:

      {"add-ons": ["Example", "Another"], "theme": ["Other", "Tags"]}

    To disable validating tags, pass in an empty path --valid-tags="".

    --split-platforms

    Build a separate package for each platform. Adding the platform as a file name suffix (before the extension).

    This can be useful to reduce the upload size of packages that bundle large platform-specific modules (*.whl files).

    --verbose

    Include verbose output.

子命令:validate

用法:

  1. blender --command extension validate [-h]
  2. [--valid-tags VALID_TAGS_JSON]
  3. [SOURCE_PATH]

Validate the package meta-data in the current directory.

位置参数:

  • SOURCE_PATH:

    The package source path (either directory containing package files or the package archive). This path must containing a blender_manifest.toml manifest.

    Defaults to the current directory.

选项:

  • -h, —help

    显示帮助信息然后退出

    --valid-tags VALID_TAGS_JSON

    Reference a file path containing valid tags lists.

    If you wish to reference custom tags a .json file can be used. The contents must be a dictionary of lists where the key matches the extension type.

    • 例如:

      {"add-ons": ["Example", "Another"], "theme": ["Other", "Tags"]}

    To disable validating tags, pass in an empty path --valid-tags="".

子命令:server-generate

用法:

  1. blender --command extension server-generate [-h] --repo-dir REPO_DIR
  2. [--html]
  3. [--html-template HTML_TEMPLATE_FILE]

Generate a listing of all packages stored in a directory. This can be used to host packages which only requires static-file hosting.

选项:

  • -h, —help

    显示帮助信息然后退出

    --repo-dir REPO_DIR

    远程存储库目录。

    --html

    Create a HTML file (index.html) as well as the repository JSON to support browsing extensions online with static-hosting.

    --html-template HTML_TEMPLATE_FILE

    An optional HTML file path to override the default HTML template with your own.

    The following keys will be replaced with generated contents:

    • ${body} is replaced the extensions contents.

    • ${date} is replaced the creation date.