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, outs, args, blend_file, out_dirs, script)
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 | [] |
| outs | Output files produced by this target. | Dictionary: String -> String | optional | {} |
| args | Any additional arguments to provide tot he export script | Dictionary: String -> String | optional | {} |
| blend_file | The .blend file to export from. | Label | required | |
| out_dirs | Output directories produced by this target. | Dictionary: String -> String | optional | {} |
| script | The exporter script. | Label | required |
blender_test
load("@rules_blender//blender:defs.bzl", "blender_test")
blender_test(name, data, blend_file, script)
A Bazel test rule for performing checks on 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 | [] |
| blend_file | The .blend file to export from. | Label | required | |
| script | The exporter script. | Label | required |
blender_toolchain
load("@rules_blender//blender:defs.bzl", "blender_toolchain")
blender_toolchain(name, blender, bpy, 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 | |
| bpy | The label to a Blender Python API, bpy target. | 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.toolchain(name, urls)
Bzlmod extensions for Blender
TAG CLASSES
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}"] |