rules_blender
Overview
Bazel rules for Blender
Setup
bazel_dep(name = "rules_blender", version = "{version}")
rules_blender
Rules
blender_export
load("@rules_blender//blender:defs.bzl", "blender_export") blender_export(name, data, out, args, blend_file, format)
A Bazel rule for exporting scenes from a .blend
file.
ATTRIBUTES
Name | Description | Type | Mandatory | Default |
---|---|---|---|---|
name | A unique name for this target. | Name | required | |
data | Additional files associated with the .blend file. | List of labels | optional | [] |
out | The name of the output file. If unspecified, the name of the target will be used. | String | optional | "" |
args | A mapping of parameter names to assignments to pass to bpy.ops.export_scene.gltf | Dictionary: String -> String | optional | {} |
blend_file | The .blend file to export from. | Label | required | |
format | The format to export to. | String | optional | "" |
blender_toolchain
load("@rules_blender//blender:defs.bzl", "blender_toolchain") blender_toolchain(name, blender, is_local)
Define a toolchain for Blender rules.
ATTRIBUTES
Name | Description | Type | Mandatory | Default |
---|---|---|---|---|
name | A unique name for this target. | Name | required | |
blender | The path to a Blender binary. | Label | required | |
is_local | Whether or not the toolchain is backed by a host installed Blender. | Boolean | optional | False |
Blender bzlmod extensions
Module Extensions
blender
blender = use_extension("@rules_blender//blender:extensions.bzl", "blender") blender.local_toolchain(name) blender.toolchain(name, urls, version)
Bzlmod extensions for Blender
TAG CLASSES
local_toolchain
An extension for defining a blender_toolchain
backed by local install on the host. Note that this will only be instantiated for the root module.
Attributes
Name | Description | Type | Mandatory | Default |
---|---|---|---|---|
name | The name of the toolchain. | Name | required |
toolchain
An extension for defining a blender_toolchain
from a download archive.
Attributes
Name | Description | Type | Mandatory | Default |
---|---|---|---|---|
name | The name of the toolchain. | Name | required | |
urls | Url templates to use for downloading Blender. | List of strings | optional | ["https://download.blender.org/release/Blender{major_minor}/blender-{semver}-{platform}.{extension}"] |
version | The version of Blender to download. | String | optional | "4.5.1" |