mirror of
https://github.com/blender/blender
synced 2026-09-28 04:04:20 +03:00
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
8 lines
226 B
CMake
8 lines
226 B
CMake
# SPDX-FileCopyrightText: 2025 Blender Authors
|
|
#
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
add_blender_test(
|
|
assets_remote_library_listing_generator_test
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/listing_generator_test.py
|
|
)
|