Commit graph

850 commits

Author SHA1 Message Date
Aaron Carlisle
cc91a79238 Docs: Update RNA to user manual URL mapping 2026-09-27 21:45:32 -04:00
Dalai Felinto
e67acc8bf8 Revert "Assets: Add Webpage meta-data field"
This reverts commit 90b85d5d17.

While this feature was properly implemented, and "built to spec", the
decision to have it was bit rushed (by me).

For now we will not have this feature in 5.3. In the future we can
support this while adding more guardrails when users click on a link
that sends them to a non blender.org url.

I talked to Guillermo about it.
2026-09-21 14:35:01 +02:00
Xury Greer
124f9cb247 Cleanup: Spelling in scripts/modules directory
Fix the following misspellings:

"ilisting" -> "listing"
"FINISHED_SUCCESFULLY" -> "FINISHED_SUCCESSFULLY"
"Therefor" -> "Therefore"
"non-conditinally" -> "non-conditionally"

Pull Request: https://projects.blender.org/blender/blender/pulls/163929
2026-09-15 11:24:39 +02:00
Sybren A. Stüvel
f8a67ec427 Fix #163662: Blender cli: asset_listing download fails
Fix two issues in the asset listing downloader CLI command:

- Add missing argument for the `RemoteAssetListingDownloader()`
  constructor (issue introduced in a9e061dc90).
- Gracefully handle the case where the `__main__` module has no
  `__file__` attribute.

Pull Request: https://projects.blender.org/blender/blender/pulls/163742
2026-09-10 14:14:23 +02:00
Guillermo Venegas
bad8871dc5 UI: Add UILayout::property_split_factor static value
This adds the `UILayout::property_split_factor` property which contains
the split factor used in the layout system, and avoids to use the this
as raw value all over the place.

Pull Request: https://projects.blender.org/blender/blender/pulls/163393
2026-09-09 00:27:44 +02:00
Campbell Barton
f4f16d48ea UI: add an "auto_keymap" argument to WindowManager.popover
Accelerator keys could only be enabled from "WM_OT_call_panel",
popovers created from Python had no way to assign them.

Ref !163632
2026-09-08 00:20:49 +00:00
Campbell Barton
20ca120140 PyAPI: add bpy.path.is_autoexec
Expose the excluded paths check used by the file selector's
"Trusted Source" option so scripts can match its behavior.

Ref !163464
2026-09-03 09:04:18 +00:00
Campbell Barton
df1ac28c55 Cleanup: spelling in comments and strings (make check_spelling_*)
Also replace `nullptr` with None in RNA strings.

Ref !163076
2026-08-25 13:46:22 +10:00
Starz099
89d03cea47 Fix #161843: Missing "Generic Tool: Annotate" in the key map editor
Expose these generic keymaps in keymap_hierarchy.py

Ref !161963
2026-08-25 09:12:38 +10:00
Aadidev Soni
4641b05b16 Fix #162496: non-null RNA argument type hints
Panels incorrectly documented the context argument as `Context | None`.

Ref !162996
2026-08-23 11:56:17 +10:00
Guillermo Venegas
90b85d5d17 Assets: Add Webpage meta-data field
This adds the optional Webpage Asset Meta-data Field so asset authors
can set a custom URL where users can learn more about the asset.

See #162674

Pull Request: https://projects.blender.org/blender/blender/pulls/162809
2026-08-21 16:42:33 +02:00
Jerry Wei
6ecfe4e810 Paint: Migrate unified paint flag from scene / mode level to brush level
This PR moves the controls of "Use Unified xxx" (such as Use Unified
Size) from the scene / mode level to the brush level, meaning each brush
can have this option toggled on and off separately. It used to be that
every brush shares the same toggle state.

I moved the `UNIFIED_xxx` flags from `UnifiedPaintSettings` to `Brush`.
Ialso added relevant RNA properties and hooked them up to Python
scripts.

Resolves #138469

Pull Request: https://projects.blender.org/blender/blender/pulls/159382
2026-08-18 00:21:23 +02:00
Campbell Barton
3eb7bf0f32 UI: expose all keymaps in the preferences
Many key maps were missing from the preferences,
expose them based on updated tests (see !162440).

Also ensure "Generic" tool keymaps use an "EMPTY" space type,
since they are shared between spaces.

Ref !162440
2026-08-11 16:43:06 +10:00
Damien Picard
fa663e3b59 I18n: Translate color management using a new translation context
Many UI messages are extracted from the OpenColorIO config, including
color spaces and families, displays, views, view transforms, and
looks.

The risk of a translation collision between these data and other
messages is quite high, especially if using an OCIO config other than
the built-in one.

This commit changes extraction and translation so that all these
strings are translated with the new "Color Management" translation
context. It does not reuse the existing "Color" context, in the
unlikely event of a collision with other color-related stuff in the
UI.

Suggested by Bastien Montagne while reviewing !160883.

Pull Request: https://projects.blender.org/blender/blender/pulls/161053
2026-08-10 19:03:11 +02:00
robberyman
30bfa9ff2e Fix #162350: Correct documentation type-hints for pointer type returns
Removed check for pointer return types, so pointer return types
use `T | None` unless `PROP_NEVER_NULL` is set.

This corrects the return type for UILayout.panel_prop(),
although many functions will now be documented as `T | None`,
requiring `PROP_NEVER_NULL` to be set to correct generated docs.

Ref !162390
2026-08-07 17:33:34 +10:00
Damien Picard
f0562f12ec Cleanup: Make legacy add-on support property static
Legacy add-ons have a support level property, which can be Official,
Community, or Testing. This was used prior to 4.2 to filter add-ons,
but is no longer exposed in the UI.

The Testing level may or may not be available, depending on the stage
in the development cycle. This makes it appear and disappear
frequently from the translation files, which causes unneeded work for
translators.

This commit removes the Testing level entirely, making the property
items static. This should not be an issue because no built-in add-on
uses the Testing level anyway since the contrib repository was
archived.

Pull Request: https://projects.blender.org/blender/blender/pulls/162235
2026-08-06 18:20:41 +02:00
Dalai Felinto
a9e061dc90 Asset Library: Authentication token support
This introduces access tokens to Asset Libraries.

* The access tokens use the same Bearer Authentication as used by
extensions.

* This reset the token if "use_auth_token" is disabled. Actually it set
it to random values and then set it to null, to avoid it lingering in
memory. This could also be implemented for extensions repository.

Pull Request: https://projects.blender.org/blender/blender/pulls/162163
2026-08-06 12:39:09 +02:00
Bastien Montagne
ec3c9ad3ff I18N tools: fix wrong handling of the }} format escape sequence.
`}` needs to also be considered as a 'potential start of token', to
allow its proper handling, especially in RTL processing code.

See also:
https://projects.blender.org/llm-test/llm-reports/src/branch/main/llm_review/log_2026_w32.md#i18n-fix-another-batch-of-issues-with-ltr-and-formatting-tokens-handling
2026-08-06 10:13:54 +02:00
Bastien Montagne
94f0d0930d make format 2026-08-04 17:57:34 +02:00
Bastien Montagne
ae7543b68d I18N: Fix another batch of issues with LTR and formatting tokens handling
Fix some logical mistakes and edge-conditions issues, in particular when
handling escaped sequences (\', \", {{, %%, etc.), also in relations
with handling of formatting tokens.

See also:
https://projects.blender.org/llm-test/llm-reports/src/branch/main/llm_review/log_2026_w31.md#i18n-refactor-handling-of-fomratting-tokens-add-checks-for--syntax
https://projects.blender.org/llm-test/llm-reports/src/branch/main/llm_review/log_2026_w31.md#fix-several-issues-in-recent-i18n-tooling-improvements-on-formatting-handling
2026-08-04 17:18:19 +02:00
Campbell Barton
e80b691142 Fix #161928: Core add-ons loaded after extensions in 5.2
Own regression [0] broke extensions that depend on core
extensions to have already been loaded.

Note that prior to 5.2, toggling a core add-on would re-order it
last - so depending on the load order wasn't reliable.

Nevertheless, order core add-ons first matching the default order in 5.1
and prior to account for extensions that depended on this load order.

[0]: 274e52fad2
2026-08-04 05:12:59 +00:00
Bastien Montagne
c92b7f829d Fix several issues in recent i18n tooling improvements on formatting handling.
Fixes one logical error, and two off-by-one index errors:
- `{}` syntax handling of explicit identifiers was broken in two
  different ways.
- For RTL languages, the closing `'`/`"` in e.g. `"Warning: '%s'.` was
  not included in the protected `LTR` block.

See also
https://projects.blender.org/llm-test/llm-reports/src/branch/main/llm_review/log_2026_w31.md#i18n-refactor-handling-of-fomratting-tokens-add-checks-for--syntax
2026-07-31 12:59:55 +02:00
Bastien Montagne
dcb7a69b5d I18N: Refactor handling of fomratting tokens, add checks for {} syntax.
This commit makes fairly extensive changes to how the code parses and
handles formatting tokens (both 'printf' and 'format' syntaxes), and the
escaping of LTR sequences in RTL languages pre-processing. It should also
be noticiably more performant.
* Factorize formatting tokens parsing into a new utils (`FormatToken` in
  `utils_format.py`). Improve its parsing logic by skipping blocks of
  text until the next potential token, and using a cheaper logic to find
  this potential token starting index.
* Implement same 'skipping' logic in RTL escape code
  (`protect_format_seq` in `utils_rtl.py`).
* Use this new FormatToken API both in code validating translated
  messages (`I18nMessages::check`) and handling RTL languages
  (`I18nMessages::rtl_process`).

Note: A WIP version of these changes was used to fix #161681 in Blender
5.2 (see !162050).
2026-07-29 11:55:36 +02:00
Sybren A. Stüvel
22c6712a5e Assets: encode minimal/until Blender versions in asset blend file name
Add support for setting the minimal/until Blender versions for assets
with markers in the filename. This makes it possible to replace assets
for newer versions of Blender, while keeping the older versions around
for backward compatibility.

The minimal required version of Blender can be encoded in the filename
by using a `@bX_Y` marker, for example `filename@b5_3.blend` if the
assets in that file require Blender 5.3 or newer. This also has an
effect on the file `filename.blend` if it exists, as assets from that
file will get their 'until' field set to 5.3 as well.

A concrete example with three files:

- `filename.blend`: used on Blender versions older than 5.3.
- `filename@b5_3.blend`: used from 5.3 until 6.0 (exclusive).
- `filename@b6_0.blend`: used from 6.0 onward.

This naming scheme has the advantage that the `filename.blend` file
itself does not have to change (and thus does not need re-downloading)
when a successor is added to the library. The only thing that changes is
its asset listing.

Finer granularity than major & minor versions is not possible, so this
does not work to replace an asset between versions 5.3.0 and 5.3.1.

Blender 5.2 already supports the `min` and `until` fields that this
mechanism sets. This PR just adds the functionality to the listing
generator, so that Blender 5.3's generator can be used in a way that
hides incompatible assets from Blender 5.2.

The `min` field is set to the maximum of the marker and the version of
Blender that was used to write the file. So when a file
`filename@b5_3.blend` was written with Blender 5.4, it will still
require Blender 5.4. The generator will log a warning when this occurs.
In this example, the assets in `filename.blend` will be used until 5.3,
as per the marker in the filename.

Pull Request: https://projects.blender.org/blender/blender/pulls/161998
2026-07-28 16:35:49 +02:00
Sybren A. Stüvel
ec2f9a34b1 Assets: download previews of online assets in parallel
Download 5 previews in parallel, so that if one request hangs, only
that thumbnail takes a long time (or times out) while others can still
download. This should have a significant effect on download speed of
the previews when on a not-so-fast or not-so-reliable connection.

Asset downloads are still serialized. This can easily be adjusted if
need be, by changing `num_parallel_downloads=1` to the desired number
in `download_asset_file()`.

This introduces multi-threaded downloading to the
`BackgroundDownloader` in `_bpy_internal.http.downloader`.

Download deduplication is now  handled by the background process, as
that knows exactly what's still queued and what's already downloading.
It's a necessity to do this there, because the bg process manages the
download threads, and thus has the source of truth of what downloads
and cancellations are in flight.

Futhermore, some busy-waiting loops were removed, and inter-thread
signalling improved, as their impact will be significantly greater
with multiple download threads running.

No Python threads were added to the Blender process. All the threaded
work happens in the background process.

Pull Request: https://projects.blender.org/blender/blender/pulls/161913
2026-07-28 16:23:21 +02:00
Sybren A. Stüvel
d7e2f50aac Fix: failure to download an asset thumbnail would cause Blender to error
Failure to download an asset thumbnail, such that Blender would not get
an HTTP response, would cause a failed assertion and cause Blender's
bookkeeping to go out of sync.

This commit fixes that, and now the thumbnail's "loading" indicator is
replaced with the generic icon of its ID type. On asset browser refresh,
another download is attempted.

Pull Request: https://projects.blender.org/blender/blender/pulls/162040
2026-07-28 16:15:53 +02:00
Sybren A. Stüvel
7db6503f86 Fix: race conditions in HTTP downloader
Fix race condition between main & background process when cancelling
and re-queueing downloads. This could make the downloader skip
downloads, as a re-queue of the same download would be cancelled along
with the original.

The main process keeps track of pending cancellations, so that
re-queued downloads are handled properly even when the previous
cancellation still has to be handled by the background process.

The background process now also emits 'was cancelled' reports for
queued-but-not-yet-started downloads, which means that any download
request sent to the background either gets completed or gets an error
reported. Before this PR, cancellation of queued-but-not-started
downloads would be silent. This guaranteed messaging of cancellations
is what makes the main process' bookkeeping work.

One minor API change: when queued downloads are cancelled,
`BackgroundDownloader.all_downloads_done` now flips at cancel time
rather than when the report round-trips via the background process. So
even when there is still a pending download (that is scheduled for
cancellation), the `BackgroundDownloader` will say that they're all
'done'. In a sense it's still true, and shutting down the downloader
at that time will simply cancel those about-to-be-canceled-anyway
downloads.

`BackgroundDownloader._num_pending_downloads` is no longer explicitly
tracked, but rather derived from the number of 'on done' callbacks.
This reduces the bookkeeping to one source of truth.

Pull Request: https://projects.blender.org/blender/blender/pulls/161977
2026-07-28 15:23:09 +02:00
Sybren A. Stüvel
b9dc2c7ca4 Assets: download online previews in LIFO fashion
When browsing online assets, download the last-requested preview
first. This ensures that, when scrolling through the assets, the
previews that are scrolled into view get priority over previews that
are scrolled out of view.

This introduces an optional keyword-only parameter to
`http.BackgroundDownloader.queue_download(queue_side=QueueSide)`,
where `QueueSide` is an enum with values `FRONT` and `BACK`.

The asset downloader always uses `BACK` for FIFO behaviour, and the
preview downloader always uses `FRONT` for LIFO behaviour.

This causes preview images in the asset browser to be downloaded
bottom-to-top (speaking visually here). This can be adjusted in
Blender's C++ code by requesting the thumbnails in the opposite order.

As an alternative implementation, a priority queue was discussed.
Previews that are scrolled out of view could then get a lower
priority. This means that Blender would have to track which previews
are requested for download, as well as track how many windows are
showing certain previews (because "scrolled out of view in one asset
browser" doesn't always mean "no longer visible"). Simply downloading
the previews in LIFO order was considerably simpler, and likely
sufficient.

Pull Request: https://projects.blender.org/blender/blender/pulls/161897
2026-07-27 10:45:48 +02:00
Campbell Barton
6ca49c2e43 Cleanup: remove unused variables, wrap long lines 2026-07-15 10:40:58 +10:00
quackarooni
a61d53274b Fix: Preferences: "Global" keymap items not aligned with other keymap items
Keymap items drawn under any "... (Global)" subsection
are misaligned from keymap items under other subsections of a keymap.

This was caused by the indented layout getting passed to later
recursive calls of `draw_km`, which makes the indentation get
doubled the deeper it goes.

This patch tweaks the drawing code so that those are now aligned,
and indentation behaves more predictably.

Pull Request: https://projects.blender.org/blender/blender/pulls/157129
2026-07-13 04:45:44 +02:00
Campbell Barton
1b3a4329aa Fix: use of undefined variable listing_downloader.py
Assign variable needed for logging, oversight in !158659.

Ref !161246
2026-07-10 11:35:03 +10:00
Sybren A. Stüvel
561a7c046e Cleanup: move shutil import in asset library listing downloader code
Just moving the `import` statement to where it should be.

No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/161267
2026-07-09 17:08:13 +02:00
Julian Eisel
468a45c767 Merge branch 'blender-v5.2-release' 2026-07-07 19:27:55 +02:00
Sybren A. Stüvel
18f7719010 Fix #161128: asset downloading can write to unwanted locations
This fixes two related issues:

1. System files could be replaced when downloading assets. A malicious
   asset listing could be constructed that overwrites its own files when
   specific assets are downloaded. This was dangerous, because the
   listing downloader performs various safety checks while the asset
   downloader doesn't (because it's not made for downloading the
   listing). The asset downloader now refuses to download any file when
   that would potentially overwrite a 'system file' (listing file, file
   hash database, those kind of files).
2. Converting asset paths from the listing to a relative path, so they
   can safely be concatenated to the local asset cache path, is now more
   thorough. It now also properly handles Windows paths that are
   drive-relative; these were considered 'relative' by Python's
   PureWindowsPath.is_absolute(), but still can cause the downloaded
   file to escape the path it is meant to be saved to.

Pull Request: https://projects.blender.org/blender/blender/pulls/161198
2026-07-07 19:24:34 +02:00
Julian Eisel
dc74b08bf7 Merge branch 'blender-v5.2-release' 2026-07-07 18:02:02 +02:00
Sybren A. Stüvel
fa9002c39d Fix #160631: Empty remote asset library gets stuck in loading state
When downloading the asset library listing, the downloader was waiting
for all pages (`_v1/assets-xxxxx.json`) to be downloaded. When there are
no such files at all, because the library is empty, it would wait
forever.

This is now fixed by doing a "shutdown if done" check after the
downloading of the `_v1/asset-index.json` file as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/161149
2026-07-07 17:15:04 +02:00
Pablo Vazquez
0e5263ff5b UI: Replace use of Info, Warning, and Error icons
Instead of reusing `ERROR` for both warnings and errors, and the Info
Editor icon for "info" label comments, use the new icons from !161002.

* Use `STATUS_WARNING` when the code refers to simple warnings, the
  feature might still work.
* Use `STATUS_ERROR` when the code refers to incompatibility, broken
  functionality, general errors.
* Use `STATUS_INFO` for every info label. Keep `INFO` for the editor.
* Sometimes `WARNING_LARGE` was used, that should only be used for
  dialogs. Use the regular warning instead, it looks almost the same.
* When extra contrast is needed, the filled version is used.

Mostly no big visual changes, other than warnings that were meant as
actual errors using the proper icon now.

See !161038 for details and screenshots.

Pull Request: https://projects.blender.org/blender/blender/pulls/161038
2026-07-05 14:27:56 +02:00
Campbell Barton
2e534f5a2e Merge branch 'blender-v5.2-release' 2026-07-05 15:46:06 +10:00
Campbell Barton
4fade04611 Cleanup: spelling in comments (make check_spelling_*)
Also replace `@` with `\` for doxygen commands (blender convention).

Ref !161080
2026-07-05 14:23:11 +10:00
Campbell Barton
7999ed8656 Docs: explain why add-ons use a single MTIME check to detect change
Prompted by !161022 which proposes to check all sub-modules.
2026-07-05 12:40:11 +10:00
Bastien Montagne
bd8a7759de Merge branch 'blender-v5.2-release' 2026-07-01 17:15:33 +02:00
Damien Picard
af9a95a7cd I18n: Translate OCIO view transforms
OpenColorIO configs include view transforms in addition to views. They
are redundant in some cases but not always, in particular descriptions
missing from views.
This commit adds translation for them.

Issue found while looking at !160883.

Pull Request: https://projects.blender.org/blender/blender/pulls/160922
2026-07-01 17:12:43 +02:00
Bastien Montagne
1d2c1ff0bc Merge branch 'blender-v5.2-release' 2026-07-01 11:08:44 +02:00
Damien Picard
530ceecde2 I18n: Translate color space menus
Color space UI was changed in Blender 5.2. Since then menus and
submenus are no longer translated, though the labels and descriptions
are still extracted from the OpenColorIO config.

This commit adds translation for color space names and descriptions
(menu entries), as well as families (submenus).

Families need to be extracted from the OCIO config, and translated
when showing menus, but they may be composed of multiple path
components representing submenus, so each component is extracted and
translated independently.

Reported by Ye Gui in #43295.

Pull Request: https://projects.blender.org/blender/blender/pulls/160883
2026-07-01 11:06:57 +02:00
Sybren A. Stüvel
3251b71a82 Merge remote-tracking branch 'origin/blender-v5.2-release' 2026-06-15 18:16:28 +02:00
Sybren A. Stüvel
f9b2fe9493 Fix #160104: bl_versions in Remote Asset Library listing is inconsistent
Change `required: [from]` to `required: [min]`, as `min` is the actual
field name.

Some history: I wanted to use `from`+`until`, but then realized that
`from` is a Python keyword, and so the code generated from the spec
would have to be mangled (it would become `from_` I think). Since
leading/trailing underscores are often used to denote private fields, I
didn't want to go there, and changed it to `min` instead. I just forgot
to update the `required` list.

As for using `max` (instead of `until`, to match it with `min`), I
intentionally chose not to use that, as to me it reads as "the maximum
version of Blender that is still compatible". Since the field has the
first version of Blender that is NOT compatible, I used `until` instead.

Pull Request: https://projects.blender.org/blender/blender/pulls/160151
2026-06-15 18:15:28 +02:00
Campbell Barton
ebfe79af0e Cleanup: spelling in comments & strings (make check_spelling_*) 2026-06-10 10:43:12 +10:00
Bastien Montagne
4969324328 I18N: Improve handling of formatting sequences protection to RTL languages.
Improve handling of the `printf` `%`-based syntax, and add basic support
for most common cases of the more modern `format` `{}`-based syntax.

Related to !159529 and #159496.

Pull Request: https://projects.blender.org/blender/blender/pulls/159569
2026-06-05 16:58:46 +02:00
Aaron Carlisle
29232053cf Docs: Update RNA / User Manual Mappings 2026-06-04 20:27:10 -04:00
Julian Eisel
bfa08e97e0 Fix: Error when downloading already downloaded asset
The function to let the Blender asset system know that the file download
request was handled was missing a parameter. So it would fail and the
asset potentially not be recognized as "available".
2026-06-04 14:33:33 +02:00