Flamenco/addon
Sybren A. Stüvel 3b4da656c9 Add-on: cache manager info in a JSON file
Instead of storing the cached manager info in the Blender preferences,
store the info in a JSON file. The file is located in the user prefs
folder (`~/.config/blender/{version}/config` on Linux).

This also reduces the number of 'refresh' operators to a single one, which
then fetches all necessary info from the Manager.

This fixes an issue (reported via chat) where worker tags were sometimes
not retained across file saves.
2024-03-04 13:08:53 +01:00
..
flamenco Add-on: cache manager info in a JSON file 2024-03-04 13:08:53 +01:00
.openapi-generator-ignore Addon: start of framework for API communication 2022-03-01 17:28:24 +01:00
mypy.ini Addon: Upgrade Python version to 3.10 2022-03-25 14:10:26 +01:00
openapi-generator-cli.jar Proof of concept to test a generated Python OpenAPI client 2022-03-01 17:28:24 +01:00
poetry.lock Addon: Upgrade Python version to 3.10 2022-03-25 14:10:26 +01:00
pyproject.toml Addon: Upgrade Python version to 3.10 2022-03-25 14:10:26 +01:00
README.md Addon: cleanup, prefix TYPE_CHECKING imports with underscores 2022-03-14 16:35:21 +01:00

Flamenco 3 Blender add-on

Setting up development environment

~/workspace/blender-git/build_linux/bin/3.1/python/bin/python3.9 -m venv --upgrade-deps venv
. ./venv/bin/activate
pip install poetry
poetry install

Generating the OpenAPI client

  1. Make sure Java is installed (so java --version shows something sensible).
  2. In the root directory of the repository, run make generate-py

Type annotations and lazy imports

This add-on tries to only load Python packages from wheel files when necessary. Loading things from wheels is tricky, as they basically pollute the sys.modules dictionary and thus can "leak" to other add-ons. This can cause conflicts when, for example, another add-on is using a different version of the same package.

The result is that sometimes there are some strange hoops to jump through. The most obvious one is for type annotations. This is why you'll see code like:

if TYPE_CHECKING:
    from .bat_interface import _PackThread
else:
    _PackThread = object

This makes it possible to declare a function with def func() -> _PackThread, without having to load bat_interface immediately at import time.