blender/tools/utils
Sybren A. Stüvel ce34c5de34 Assets: Python code for generating and downloading assets & listings
Part of the remote asset libraries project, see:
https://projects.blender.org/blender/blender/issues/134495

No user visible changes expected.

This commit contains all the Python code necessary integration with
Blender's asset system (so for downloading asset listings, previews, and
the assets themselves), and for the `blender -c asset_listing` CLI
command.

The OpenAPI datamodel generator no longer includes the OpenAPI schema in
the generated code. That was intended to be used by a validation
library, but as it turns out, that couldn't handle the recursive
definitions we need. Now the code just relies on the validation from the
cattrs library, which is good enough for our purpose.

Available CLI commands:

blender -c asset_listing generate:
  Generates the asset listing for all assets in the current directory &
  subdirectories.

blender -c asset_listing download <URL>:
  This is more of a test command, to download the asset listing. The URL
  should point to the root of the asset library, so basically a
  HTTP-exposed version of the same directory in which the `generate`
  command above was given.

  The files are downloaded to `./_asset_download_location`. That way the
  current directory isn't spammed with multiple files.

Downloading includes a time-based 'stamp' for cache-busting, when
requesting the top-level JSON file of a remote asset library's listing.
This stamp is the number of seconds since some point in time, divided by
60, to make it change once per minute. This means that a caching service
like CloudFlare can cache the response, and only forward the query to
our HTTP server once every minute.

Co-authored-by: Julian Eisel <julian@blender.org>

Pull Request: https://projects.blender.org/blender/blender/pulls/153284
2026-02-13 16:32:51 +01:00
..
addr2line_backtrace.py
authors_git_gen.py Cleanup: spelling in comments, strings & vars (make check_spelling_*) 2025-11-29 22:12:24 +11:00
autopep8_clean.py
autopep8_clean_config.py PyAPI: make internal modules explicitly "private" 2025-10-13 09:35:09 +00:00
blend2json.py Cleanup: spelling (make check_spelling_*) 2025-07-20 14:59:19 +10:00
blender_keyconfig_export_permutations.py
blender_merge_format_changes.py UI: Replace contractions with long-form text 2025-08-05 11:16:22 +02:00
blender_theme_as_c.py
credits_git_gen.py Tools: Make git credits stable when sorted by commits 2025-11-07 03:21:36 +00:00
cycles_timeit.py
gdb_struct_repr_c99.py
git_data_canonical_authors.py AUTHORS: add 54 new authors 2026-02-12 21:41:15 +11:00
git_data_sha1_override_authors.py
git_log.py
git_log_review_commits.py
git_log_review_commits_advanced.py
gitea_inactive_developers.py
make_cursor_gui.py
make_generate_datamodels.py Assets: Python code for generating and downloading assets & listings 2026-02-13 16:32:51 +01:00
make_gl_stipple_from_xpm.py
make_shape_2d_from_blend.py