Getting Started
1-2-3, and you're ready to go!
- Install
blender
: Check out the official Blender downloads. - Install
uv
: Check out the officialuv
installation guide. - Install
blext
: Just runuv tool install blext
.- For all installation methods, see Installation.
First Extension
cd
to your favorite folder and run:
Now, enter the new extension folder
cd first-extension
blext run
Configuring the Extension
TODO
Adding PyPi Dependencies
Tip
At this point, we strongly suggest familiarizing yourself with the basics of the uv
package manager.
- All
blext
projects are alsouv
projects, which can be managed usinguv
. blext
doesn't "wrap" functionality ofuv
that already works well.
blext
and uv
were designed to be used together, especially when it comes to Python dependencies.
Say you forgot the speed of light.
Luckily, scipy
has your back!
All you need to do is:
import scipy
print(scipy.constants.speed_of_light)
To make import scipy
work inside of your extension, just run:
uv add scipy
That's it!
You can now import scipy
anywhere in your extension code, across platforms.
Analyzing Dependencies
To see which "wheels" in particular are pulled in, run: 1
┃ Name ┃ Version ┃ Platforms ┃ Py|ABI ┃ Size ┃
┡━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━┩
│ numpy │ 1.24.4 │ macosx_11_0_arm… │ cp311|cp311 │ 13.8 MB │
│ numpy │ 1.24.4 │ manylinux_2_17_… │ cp311|cp311 │ 17.3 MB │
│ numpy │ 1.24.4 │ win_amd64 │ cp311|cp311 │ 14.8 MB │
│ scipy │ 1.15.2 │ macosx_12_0_arm… │ cp311|cp311 │ 30.1 MB │
│ scipy │ 1.15.2 │ manylinux_2_17_… │ cp311|cp311 │ 37.6 MB │
│ scipy │ 1.15.2 │ win_amd64 │ cp311|cp311 │ 41.2 MB │
├───────────┼─────────┼──────────────────┼─────────────┼───────────┤
│ =6 wheels │ │ macos-arm64, │ │ =154.9 MB │
│ │ │ windows-x64, │ │ │
│ │ │ linux-x64 │ │ │
└───────────┴─────────┴──────────────────┴─────────────┴───────────┘
-
When a dependency eg.
numpy
is defined in the VFX Reference Platform,blext
won't download or include it in extensions, or show it in the dependency overview.Instead,
blext
will enforce that incompatible version of eg.numpy
are never asked for, even if that makes it impossible to install a requested dependency. ↩↩