Commit Graph

367 Commits

Author SHA1 Message Date
Aaron Carlisle
63435d19e9 Merge branch 'blender-v4.2-release' 2024-07-16 02:23:40 -04:00
Aaron Carlisle
a51f293548 Docs: Fix RNA to manual mapping
a39fa10b5b used the 4.3 manual instead of 4.2
2024-07-16 02:20:19 -04:00
Campbell Barton
fd5780e97b PyAPI: add bpy.utils.register_preset_path utility function
Support add-ons including their own preset paths,
needed to resolve #124020.
2024-07-16 15:50:28 +10:00
Thomas Dinges
a39fa10b5b Manual: Update RNA references for 4.2 2024-07-15 17:35:59 +02:00
Campbell Barton
8fdb190278 Cleanup: typos in comments (duplicate words) 2024-07-14 18:55:43 +10:00
Campbell Barton
c4ed24ce9f Merge branch 'blender-v4.2-release' 2024-07-11 17:57:00 +10:00
Campbell Barton
319684d8f6 Extensions: warn when extensions violate module policies
As each extension has it's own package, any modules it includes must be
imported as sub-modules. Warn if extensions are including themselves
in the sys.path as this breaks name-spacing of extensions.

Show these warnings in the add-on & extensions UI.
2024-07-11 17:50:30 +10:00
Campbell Barton
fa46ed2c98 Merge branch 'blender-v4.2-release' 2024-07-11 14:23:41 +10:00
Campbell Barton
9ffc973918 Fix missing check for debug print 2024-07-11 14:22:49 +10:00
Campbell Barton
c9df309f1f Merge branch 'blender-v4.2-release' 2024-07-11 14:18:34 +10:00
Campbell Barton
d13da71db4 Fix the extension add-on reloading when caching the extensions state
When the extensions add-on module was loaded before the add-on was
enabled, the module was detected as having changed since it had no
`__time__` member. Loading the add-on would then reload the module.

Resolve by setting the __time__ when first importing.
2024-07-11 14:12:36 +10:00
Bastien Montagne
385dfb4650 Merge branch 'blender-v4.2-release' 2024-07-08 20:51:48 +02:00
Bastien Montagne
92d5659653 I18N: Update UI translations from git/weblate repository (9735e28dcce47210).
Note that this commit also introduces a new language, Slovenian.
2024-07-08 20:50:07 +02:00
Julian Eisel
7b0ea0f1b4 Sculpt/Paint: New asset based brush management workflow
This is the main merge commit of the brush assets project. The previous
commits did some preparing changes, more tweaks are in the following commits.
Also, a lot of the more general work was already merged into the main branch
over the last two years.

With the new design, quite some things can be removed/replaced:
- There's a unified "Brush" tool now, brush based tools and all special
  handling is removed.
- Old tool and brush icons are unsed now, and their initialization code
  removed here. That means they draw as blank now, and the icon files can be
  removed in a follow up.
- Creation of default brushes is unnecessary since brushes are now bundled in
  the Essentials asset library. Icons/previews are handled as standard asset
  previews.
- Grease pencil eraser options are replaced by a general default eraser brush
  that can be set by the user.

More changes are planned still, see task list issue below.

Main Authors: Bastien Montagne, Brecht Van Lommel, Hans Goudey, Julian Eisel
Additionally involved on the design: Dalai Felinto, Julien Kaspar

Blog Post: https://code.blender.org/2024/07/brush-assets-is-out/

Tasks:
https://projects.blender.org/blender/blender/issues/116337

Reviewed incrementally as part of the brush assets project, see:
https://projects.blender.org/blender/blender/pulls/106303
2024-07-08 17:50:25 +02:00
Campbell Barton
e3d0997065 Merge branch 'blender-v4.2-release' 2024-07-02 16:19:45 +10:00
Andrej730
1f0592b3b1 Docs: corrections to bpy.utils.register_tool
- Replaced `tool` argument with `tool_cls`.
- Removed `space_type` argument that's not present in the method.

Ref: !118900
2024-07-02 16:18:08 +10:00
Campbell Barton
83ce50f2b8 Merge branch 'blender-v4.2-release' 2024-07-02 16:09:45 +10:00
Thomas Barlow
d1cff7974a Fix #108254: Infinite loop in rna_info.BuildRNAInfo(..)
When a registered class has a non-registered superclass,
rna_info.BuildRNAInfo entered an eternal loop.

The while loop in `rna_info.get_py_class_from_rna` was not mutating the
variables within the loop nor the variable in its condition, meaning it
would loop infinitely if the loop didn't exit in its first iteration.

When yielding registered classes in `subclasses_recurse`, the function
was erroneously checking if the class' superclass was registered rather
than checking the class itself, causing registered classes to be skipped
if their superclass was not also registered. If the class to be found
was skipped, the while loop would not exit in its first iteration and
would thus loop infinitely.

The while loop has been modified to iterate through each base rna type
until there is no further base type.

The `subclasses_recurse` function now correctly checks whether the
subclass is registered, not its superclass, when determining if the
subclass should be yielded.

Besides the fix, no functional changes are expected, the generated
Python API docs remain unchanged.

Ref: !108256
2024-07-02 16:03:26 +10:00
Campbell Barton
11b32ed48b Merge branch 'blender-v4.2-release' 2024-07-02 15:07:17 +10:00
Campbell Barton
c29d8326e0 UI: sort add-ons by name
Previously add-ons were sorted by category & name, remove the category
only sorting by name since the category is no longer displayed and
isn't part of extension meta-data. Now the add-ons are sorted by name
(case insensitive).

Details:

- Store add-ons modules sorted to avoid having to sort on every redraw.
- addon_utils.modules() now returns an iterator.
2024-07-02 15:06:14 +10:00
Campbell Barton
14a2e933f4 Merge branch 'blender-v4.2-release' 2024-07-01 15:16:48 +10:00
Campbell Barton
7447f6415e Merge branch 'blender-v4.2-release' 2024-07-01 15:16:39 +10:00
Campbell Barton
67ddb0e1a5 Extensions: detect external changes on startup & loading preferences
Changes to an extensions manifest weren't accounted for.
This was particularly a problem for "System" extensions which aren't
intended to be managed inside Blender however the problem existed for
any changes made outside of Blender.

Now enabled extensions are checked on startup to ensure:

- They are compatible with Blender.
- The Python wheels are synchronized.

Resolves #123645.

Details:

- Any extension incompatibilities prevent the add-on being enabled
  with a message printing the reason for it being disabled.

- Incompatible add-ons are kept enabled in the preferences to avoid
  loosing their own preferences and allow for an upgrade to restore
  compatibility.

- To avoid slowing down Blender's startup:

  - Checks are skipped when no extensions are enabled
    (as is the case for `--factory-startup` & running tests).
  - Compatibility data is cached so in common case,
    the cache is loaded and all enabled extensions `stat` their
    manifests to detect changes without having to parse them.
  - The cache is re-generated if any extensions change or the
    Blender/Python version changes.

- Compatibility data is updated:

  - On startup (when needed).
  - On an explicit "Refresh Local"
    (mainly for developers who may edit the manifest).
  - When refreshing extensions after install/uninstall etc.
    since an incompatible extensions may become compatible
    after an update.
  - When reloading preferences.

- Additional info is shown when the `--debug-python` is enabled,
  if there are ever issues with the extension compatibility cache
  generation not working as expected.

- The behavior for Python wheels has changed so they are only setup
  when the extension is enabled. This was done to simplify startup
  checks and has the benefit that an installed but disabled extension
  never runs code - as the ability to install wheels means it could
  have been imported from other scripts. It also means users can disable
  an extension to avoid wheel version conflicts.

  This does add the complication however that enabling add-on which is
  an extension must first ensure it's wheels are setup.
  See `addon_utils.extensions_refresh(..)`.

See code-comments for further details.
2024-07-01 15:08:14 +10:00
Campbell Barton
350b8047c6 Extensions: move the wheel_manager out of the extensions add-on
Move wheel management to a generic private module, prepare addon_utils
to handle changes to repositories on load (needed to resolve #123645).
2024-07-01 10:07:16 +10:00
Campbell Barton
72e5254669 Merge branch 'blender-v4.2-release' 2024-06-29 22:15:34 +10:00
Andrej730
87844ae24d Fix bl_text_utils/external_editor.py broken __all__
Ref: !123910
2024-06-29 22:14:37 +10:00
Dalai Felinto
b528aca711 Merge remote-tracking branch 'origin/blender-v4.2-release' 2024-06-28 11:46:45 +02:00
Damien Picard
92c026c39b I18n: Fix multi-context message extraction regex
The BLT_I18N_MSGID_MULTI_CTXT() macro allows extracting a single
message into up to 16 different contexts. The regex to do that was
slightly wrong because it did not account for the macro potentially
ending with a ",".

The contexts for "New" were also sorted.

Pull Request: https://projects.blender.org/blender/blender/pulls/123793
2024-06-28 10:42:47 +02:00
Campbell Barton
ac8da6c72e Extensions: move junction_module to a private location
bpy_extras is part of the public API where as the junction_module
is part of the internal implementation of extensions.
Move to "_bpy_internal".
2024-06-28 14:30:11 +10:00
Campbell Barton
f1bfaaf2f7 Merge branch 'blender-v4.2-release' 2024-06-27 21:26:23 +10:00
Campbell Barton
fb94028d10 Merge branch 'blender-v4.2-release' 2024-06-27 21:26:21 +10:00
Campbell Barton
42e1239ba8 Core: support restricting the types an XML preset may load
Prevent potential problems from untrusted XML (typically themes)
traversing into data outside the intended targets.

From what I can tell it's not currently possible but changes to RNA
could allow for this which would likely go by unnoticed.

Further details in code-comments.
2024-06-27 21:21:07 +10:00
Campbell Barton
65d0f365a9 Cleanup: correct misleading name of internal function 2024-06-27 21:01:15 +10:00
Campbell Barton
66e422f33d Merge branch 'blender-v4.2-release' 2024-06-26 14:27:40 +10:00
Campbell Barton
96906536db Extensions: add a Python API for user editable extension directories
Provide a convenient way to access a writable directory for extensions.
This will typically be accessed via:

  bpy.utils.extension_path_user(__package__, create=True)

This API is provided as some extensions on extensions.blender.org
are writing into the extensions own directory which is error prone:

- The extensions own directory is removed when upgrading.
- Users may not have write access to the extensions directory,
  especially with "System" repositories which may be on shared network
  drives for example.

These directories are only removed when:

- Uninstalling the extension.
- Removing the repository and its files.
2024-06-26 14:23:17 +10:00
Brecht Van Lommel
eab14b0a0c Merge branch 'blender-v4.2-release' 2024-06-14 16:56:00 +02:00
Damien Picard
4719ce5d56 I18n: Allow translation of extension tags and permissions
The new extension system introduces tags, similar to categories from
legacy add-ons, and permissions. A hardcoded list is supported for
each, available in the docs:
- https://docs.blender.org/manual/en/dev/advanced/extensions/tags.html
- https://developer.blender.org/docs/features/extensions/schema/

This change allows extraction of these new metadata to the translation
files.

In order to disambiguate the new messages, tags use the new "Script"
translation context. Permissions are lower case, so there is a low
risk of collision, and they use the default context.

While the tags are defined per-platform, with extensions.blender.org
being the only one available currently, they are extracted as a single
list.

Pull Request: https://projects.blender.org/blender/blender/pulls/123150
2024-06-14 16:35:54 +02:00
Sybren A. Stüvel
2162af9e7b Merge remote-tracking branch 'origin/blender-v4.2-release' 2024-06-13 15:11:00 +02:00
Christoph Lendenfeld
9dcc63b76c Fix #122372: Keyingsets not keying custom properties of type EnumProperty
The issue was that when applying the keyingsets
`Whole Character` and `LocRotScale & Custom Properties` the
enum property of a rigify rig was not keyed.
The reason it was not keyed was just because
it was not specified in the compatible types in the keying set.
The fix is to just add `bpy.types.EnumProperty` to the list.

Pull Request: https://projects.blender.org/blender/blender/pulls/122377
2024-06-13 13:17:32 +02:00
Bastien Montagne
de713122f3 Merge branch 'blender-v4.2-release' 2024-06-13 12:17:10 +02:00
Dalai Felinto
77a69d04f2 Extensions: Changes to the translatable tags table
* Drop the repository - let's combine tags in a single list (per type)
  to avoid duplications in the future.

* Give a more sensitive name for tthe property, to avoid tags.tags.
2024-06-13 10:17:10 +02:00
Omar Emara
cbabe2d3ef Compositor: Remove Auto Render option
This patch removes the Auto Render option from the compositor. This is
done for the following reason:

- The option didn't really work except in the case of transforming an
  object. So it wasn't really reliable.
- It made little sense to use since the introduction of the Viewport
  Compositor.
- It had a number of UX issues, including the fact that it can't be used
  with animation playback, and the fact that rendering can get in the
  way of the UI depending on the preferences for temporary editors.

Pull Request: https://projects.blender.org/blender/blender/pulls/123132
2024-06-13 07:29:37 +02:00
Campbell Barton
8112ee47d9 Merge branch 'blender-v4.2-release' 2024-06-12 12:49:59 +10:00
Campbell Barton
eaa3f4c034 Cleanup: double-quote plain text strings 2024-06-12 10:56:12 +10:00
Aras Pranckevicius
165a929196 Merge branch 'blender-v4.2-release' 2024-06-11 19:15:07 +03:00
Dalai Felinto
188b6fd3d0 Extensions: List of tags to be used for translation
Internal module used for translation.

Pull Request: https://projects.blender.org/blender/blender/pulls/123069
2024-06-11 17:42:56 +02:00
Bastien Montagne
96228e516a Merge branch 'blender-v4.2-release' 2024-06-11 15:14:41 +02:00
Damien Picard
f9c2758c85 Actually extract n_() message
Forgot to commit the actual functional part...

Pull Request: https://projects.blender.org/blender/blender/pulls/122971
2024-06-11 15:09:14 +02:00
Aaron Carlisle
80faafb0ac Merge branch 'blender-v4.2-release' 2024-06-10 23:56:46 -04:00
Aaron Carlisle
38df2148f5 Docs: Update rna manual references 2024-06-10 23:55:55 -04:00