Commit Graph

226 Commits

Author SHA1 Message Date
Aaron Carlisle f263b77656 Merge branch 'blender-v4.1-release' 2024-02-19 22:30:58 -05:00
Aaron Carlisle 8437e49da1 Docs: Update rna manual references 2024-02-19 22:30:39 -05:00
Brecht Van Lommel 0f2064bc3b Revert changes from main commits that were merged into blender-v4.1-release
The last good commit was 4bf6a2e564.
2024-02-19 15:59:59 +01:00
Sergey Sharybin a8a05ebba1 Compositor: Switch CPU compositor to Full-Frame
The tiled compositor code is mainly still around, which is only
expected to be a short-lived period. Eventually it will also be
removed.

The OpenCL, Group Buffers, and Chunk size options are already removed.

Pull Request: https://projects.blender.org/blender/blender/pulls/118010
2024-02-14 14:23:49 +01:00
Germano Cavalcante 4618db7f5a Merge branch 'blender-v4.1-release' 2024-02-12 09:52:54 -03:00
Germano Cavalcante a159654ab2 Fix #118103: Warning property alt navigation
"alt_navigation" can also be present in:
- transform.transform
- transform.vert_slide
- transform.edge_slide
- transform.shrink_fatten
2024-02-12 09:33:07 -03:00
Bastien Montagne 0bf9b10a93 Merge branch 'blender-v4.1-release' 2024-02-12 12:09:32 +01:00
Bastien Montagne 9b5f01d00e I18N/UI Messages fixes. 2024-02-12 12:01:02 +01:00
Campbell Barton 3dbbc013de Cleanup: spelling in comments 2024-02-10 22:35:35 +11:00
Sybren A. Stüvel 6729a3f77d Anim: Fix animation baking for Armature props creating a group per prop
Baked armature properties are now placed in a single group "Armature
Custom Properties", instead of creating a new group "Group.nnn" for each
custom property.

This bug was not reported.

Pull Request: https://projects.blender.org/blender/blender/pulls/117993
2024-02-09 12:13:36 +01:00
Sybren A. Stüvel 25bdaf026c Fix #117988: Anim, Crash when baking action
When baking custom properties, avoid keeping references to custom
property values that are known to be impossible to animate anyway.

The crash was caused by custom properties containing collections of ID
properties. Keeping Python references around for too long and then
accessing them caused Blender to crash.

My solution is to only keep track of custom property values that might
be keyable. For some this is certain: floats, ints, bools are keyable,
whereas lists, dicts, etc. are not. However, strings can be the RNA
value for an enum property, which is keyed via its integer
representation. So, the new function `can_be_keyed()` can return `True`,
`False`, or `None`. By skipping those values where it returns `False`
the crash is already resolved, making it good enough for now.

Pull Request: https://projects.blender.org/blender/blender/pulls/117993
2024-02-09 12:13:36 +01:00
Campbell Barton bc5a8f33d8 Cleanup: correct misleading name 2024-02-09 18:18:13 +11:00
Campbell Barton 5affe322cc Correct version bump from 41b63ebda2 2024-02-09 18:15:05 +11:00
Campbell Barton 41b63ebda2 Versioning: add missing version update for renamed key-map
Account for the renamed key-map when loading older saved key-maps &
stored user preferences. [0] missed these changes.

[0]: 661e7e451a
2024-02-09 18:11:12 +11:00
Sybren A. Stüvel 587b977ec7 Fix #117972: Anim, Bake Action errors when both Pose and Object are off
When baking neither Object nor Pose data, the Bake Action operator could
raise a Python exception instead of handling the situation gracefully.
This is now resolved; the regular 'Nothing to Bake' message is shown
instead.
2024-02-08 13:55:01 +01:00
Thomas Dinges 2c784664e2 Docs: Update rna manual references 2024-02-07 11:09:49 +01:00
Damien Picard 5b9c176b68 I18n: extract and disambiguate a few messages
Extract:
- Operators' poll messages, including Python-defined ones.
- Use default translation context for the region toggle pie menu.
- Newly created F-Curve modifiers.
- Newly created video tracker track.
- Grease Pencil UV area status message
- Status messages in the graph slider operators.
- Status message "Text <text.py>" when opening .blend with
  auto-executing Python file.

Disambiguate:
- Track: can mean NLA track, video tracking, a tracking marker, or
  a track constraint.
- Tracking: can mean video tracking, or a track constraint.

Issue reported by Gabriel Gazzán.

Pull Request: https://projects.blender.org/blender/blender/pulls/117855
2024-02-06 17:06:30 +01:00
Andrej730 a8e14af167 bl_i18n_utils - bugs saving translations to py files and finding po strings if context is not present in the file
4 changes in this PR:

1) Fixed bug with saving translations to py files - saving sources and comments it didn't add `repr` for the saved strings which was producing unexpected special characters.

Then these special characters sometimes made `translations.py` invalid (e.g., it was failing to load with some `\u` combinations) or was producing invalid characters in .po files created from the `translations.py`.

2) `find_best_messages_matches` used to fail when current message context wasn't found in the .po file. E.g. there were no messages with context "View3D", "Operator", ... and you would try to edit translation for the element that uses that context. I've added a fallback to empty sets to make sure it won't fail and just return the valid result that there are no matches.

3) added minor typing hint for easier code navigation.

4) added print to make it clear what data is printed.

Pull Request: https://projects.blender.org/blender/blender/pulls/116934
2024-02-06 16:58:47 +01:00
Damien Picard fa77e9142d UI: fix and improve a few messages
- "can not" -> "cannot" in many places (ambiguous, also see
  Writing Style guide).
- "Bezier" -> "Bézier": proper spelling of the eponym.
- Tool keymaps: make "Uv" all caps.
- "FFMPEG" -> "FFmpeg" (official spelling)
- Use MULTIPLICATION SIGN U+00D7 instead of MULTIPLICATION X U+2715.
- "LClick" -> "LMB", "RClick" -> "RMB": this convention is used
  everywhere else.
- "Save rendered the image..." -> "Save the rendered image...": typo.
- "Preserve Current retiming": title case for property.
- Bend status message: punctuation.
- "... class used to define the panel" -> "header": copy-paste error.
- "... class used to define the menu" -> "asset": copy-paste error.
- "Lights user to display objects..." -> "Lights used...": typo.
- "-setaudio require one argument" -> "requires": typo.

Some issues reported by Joan Pujolar and Tamar Mebonia.

Pull Request: https://projects.blender.org/blender/blender/pulls/117856
2024-02-05 17:08:17 +01:00
Bastien Montagne fd0d84095d I18N: Fix missing Danish language.
We had inherited Danish translation file in the repository from over a
decade ago, but it was never since then an active translation, and
therefore was never added back to the current list of known languages.

Since the file exists now and is exposed in Weblate
(translate.blender.org), language entry should be created in our
settings, such that e.g. PO files do get updated with all the others!
2024-02-05 16:47:08 +01:00
Nika Kutsniashvili 2274f58ef2 UI: Remove empty space in Custom Properties panel
Remove empty space in Custom Properties panel, and align buttons in a row.

Pull Request: https://projects.blender.org/blender/blender/pulls/115913
2024-02-05 14:34:14 +01:00
Campbell Barton 63ce2fbc0c Extensions: default to paths in {BLENDER_RESOURCE_PATH_USER}/extensions
Replace: {BLENDER_RESOURCE_PATH_USER}/scripts/extensions
With:    {BLENDER_RESOURCE_PATH_USER}/extensions

This makes more sense as not all extensions are scripts.
2024-02-03 14:17:54 +11:00
Campbell Barton adb304f0ed Extensions: improve UI for adding/removing repositories
- Adding new repositories now differentiates between "Online" & "Local"
  where adding a local repository doesn't prompt for a URL.
- Support removing repositories and their files (uses confirmation
  defaulting to "Cancel" to avoid accidents).
- Show an error icon next to repositories that have invalid settings,
  these repositories are now ignored until the settings are corrected,
  required fields are highlighted red when they're unset & required.
- Rename "directory" to "custom_directory" since an automatic path is
  used when not set - created in the users scripts directory.
- Use toggles for custom-directory & remote URL instead of relying on
  the value to be left an empty string for alternative behavior.
2024-02-02 20:46:45 +11:00
Campbell Barton c9ad858d9d Extensions: update manifest to bl_info conversion
Update extension to bl_info conversion to account for recent changes.
2024-02-01 22:42:24 +11:00
Campbell Barton fb29925158 Extensions: support addon_utils.module_bl_info() for enabled extensions
Add-ons "bl_info" was supported for add-ons which weren't registered,
however the real modules weren't handled causing module_bl_info()
to return dummy values when an extensions add-ons module was passed in.

This caused the minimum Blender version check after enabling an add-on
to do nothing.

Now the "bl_info" from extension modules is ignored and the bl_info
is created on demand from the manifest.
2024-02-01 17:11:15 +11:00
Campbell Barton 355fd2313d Extensions: detect time-stamp changes to extensions manifest on refresh
- Add a warning when an extensions meta-data is missing.
- Remove the time-stamps from message that time-stamps have changes
  since knowing the exact times isn't helpful.
2024-02-01 17:03:47 +11:00
Campbell Barton dd641d15d0 Fix is_extended method for UI classes (menu, panel, headers... etc)
Appending then removing a draw function caused the is_extended()
method to return true afterwards, resolve by checking if there are
multiple draw functions.
2024-02-01 17:03:42 +11:00
Campbell Barton a8e73616b9 Cleanup: rename add-on related variables for clarity
- Rename info to bl_info, to avoid confusion with extensions manifest,
  which should eventually be accessible in a similar way.
- Rename module_name to addon_module_name to avoid confusion with
  extension repositories name-spaced modules.
- Clarify naming for TOML manifest.
2024-02-01 17:03:40 +11:00
Lukas Tönne 53da2b2d48 Support for enum `items` parameter in `rna_idprop_ui_create`
This is an optional parameter for int properties, which then show up as
enum properties.

Included fix: reset ID properties' enum items when the `items` parameter is `None`.

Example usage:
```python
import rna_prop_ui
# Add a regular int property.
rna_prop_ui.rna_idprop_ui_create(D.objects['Cube'], "test", default=123, min=-3, max=500)
# Change to an enum property with items (min/max are ignored).
rna_prop_ui.rna_idprop_ui_create(D.objects['Cube'], "test", default=0, min=-10, max=10, items=[("APPLES", "Apples", ""), ("ORANGES", "Oranges", "")])
# Switch back to regular int property.
rna_prop_ui.rna_idprop_ui_create(D.objects['Cube'], "test", default=1, min=0, max=10)
```

Pull Request: https://projects.blender.org/blender/blender/pulls/117289
2024-01-31 13:27:15 +01:00
Campbell Barton fb16dbf9ae Extensions: support authors as a list from the TOML manifest
Also fix blank errors caused by catching assertions which resulted
in empty strings.
2024-01-31 17:43:44 +11:00
Campbell Barton 73214e9b26 Extensions: change the manifest filename
Use the name "blender_manifest.toml" for clarity.
2024-01-30 09:42:01 +11:00
Campbell Barton 8841990764 Extensions: use the TOML manifest as a source for extensions `bl_info` 2024-01-25 14:36:20 +11:00
Campbell Barton b686f2a536 UI: show the version as a string for extensions
Extensions use SEMVER, not a tuple of numbers.
2024-01-25 14:36:20 +11:00
Campbell Barton 6aede44fb7 PyAPI: remove checks for add-ons pre 2.8x
This made sense when migrating from 2.7x, now 2.8x add-ons may also
have issues in 4.1 so this check isn't so relevant.
2024-01-25 13:00:48 +11:00
Campbell Barton b8b1189bc4 Cleanup: assign a variable for the extension module with a trailing "."
This is used in enough places to simplify checks.
2024-01-25 13:00:48 +11:00
Campbell Barton 56ccc9cdd9 Fix missing import in 9cc6ee75e7 2024-01-24 17:06:57 +11:00
Campbell Barton 9cc6ee75e7 Extensions: support using a default local user directory
This is needed so extensions repositories can reference
user-script directories without them having hard-coded paths
which will be invalid when upgrading a Blender version.
2024-01-24 16:50:32 +11:00
Campbell Barton 53a8570aec Extensions: enable the package management add-on when enabled
Package management has been moved into addons_contrib so the addon
can be enabled when enabling extension repositories.

This means users can test extension repositories without having to
install a separate add-on.

Additional work is still needed with the server before this is ready
for general testing though.

Part of #117286.
2024-01-24 13:25:27 +11:00
Brecht Van Lommel 2afd9e530a Fix: wrong name in bpy_extras.object_utils, causing API doc build failure 2024-01-19 19:03:33 +01:00
Campbell Barton 7daf900181 Cleanup: spelling in comments, remote debug print 2024-01-19 17:28:14 +11:00
Campbell Barton 665472a18b Extensions: changes to repositories are now accounted for by add-ons
Add-ons using the extension API now follow changes to their
repositories.

- Removing a repository disables and removes associated add-ons.
- Disabling a repository disables the add-on but keeps add-on &
  its preferences.
- Enabling a repository re-enables add-ons that use it.
- Renaming a repository updates the names of associated add-ons &
  it's preferences.
2024-01-19 17:19:09 +11:00
Campbell Barton 606562c12b Extensions: fix re-registered repos failing to include add-on modules
Enabling & disabling a repository removed it's module from sys.modules
but kept any sub-modules (in this case add-ons).

The problem with this is enabling the add-ons again could reuse the
cached modules which failed to include the add-on in the parent
modules name-space.

This meant `dir(bl_ext.repo_module)` couldn't be used to access
sub-modules.
2024-01-19 17:19:08 +11:00
Alexander Gavrilov b350d7a4c3 Shape Keys: support locking to protect from accidental editing.
It is very common for graphical editors with layers to support
locking individual layers to protect them from accidental edits due
to misclicks. Blender itself already supports locking vertex groups.
This adds lock toggles for shape keys, with lock/unlock all operators.

The flags are checked by sculpt brushes, edit mode transform tools,
and Smooth, Propagate and Blend From Shape operators. This selection
aims to cover operations that only deform the mesh, where the shape
key selection matters.

Topology changing operations always apply to all keys, and thus
incorrect shape key selection is less impactful. Excluding them
from the new feature greatly reduces the patch size.

Pull Request: https://projects.blender.org/blender/blender/pulls/104463
2024-01-18 13:17:24 +01:00
Jeroen Bakker 02d5b8d488 Cleanup: Make format 2024-01-18 13:05:38 +01:00
Bastien Montagne f9c3d51322 I18N: utils: Fix invalid timestamp format in PO files.
Expected format is `%Y-%m-%d %H:%M%z`.

Previous code would not generate the expected format of timestamps for
PO files headers (specifically in the the `POT-Creation-Date` field).

This could lead to some parsers (like e.g. the `sphinx_intl.load_po`
function) failing to load these PO files.

Note: since `datetime` module requires additional gymnastic to get valid
timezone info,switched back to the simpler `time` module here.

All times are expressed in UTC (aka GMT) timezone, since these are also
the values stored for Blender buildtimes.

Reported by @hoanguk in the Blender translations chat, thanks.
2024-01-18 11:20:26 +01:00
Campbell Barton 5149aed4ac PyAPI: improve warnings when addons from extensions repos fail to load 2024-01-17 18:30:16 +11:00
Campbell Barton 0d7225bf0c Cleanup: remove outdated comment
String suggestion now allow the operator list to be searched.
2024-01-17 10:30:04 +11:00
Campbell Barton 489408e8d3 PyAPI: handle sys.exit() from the Python console
This would raise a SystemExit, showing it's stack trace into Python's
code module, then a syntax error on any input immediately afterwards.

Now exception is printed & the input for the Python console is reset.

Address some issues raised by #109435.
2024-01-16 17:17:54 +11:00
Damien Picard 3bd41cf9bc I18n: Go over TIP_ and IFACE_ usages, change to RPT_ when relevant
The previous commit introduced a new `RPT_()` macro to translate
strings which are not tooltips or regular interface elements, but
longer reports or statuses.

This commit uses the new macro to translate many strings all over the
UI.

Most of it is a simple replace from `TIP_()` or `IFACE_()` to
`RPT_()`, but there are some additional changes:
- A few translations inside `BKE_report()` are removed altogether
  because they are already handled by the translation system.
- Messages inside `UI_but_disable()` are no longer translated
  manually, but they are handled by a new regex in the translation
  system.

Pull Request: https://projects.blender.org/blender/blender/pulls/116804

Pull Request: https://projects.blender.org/blender/blender/pulls/116804
2024-01-12 13:37:32 +01:00
Damien Picard 5db82be74f Fix #76101: I18n: add new preference to translate reports
Translation of the UI is currently split into 3 preferences:
interface, tooltips, and new data. The distinction between interface
and tooltips is currently unclear as tooltips also include a lot of
messages not displayed in the actual tooltips on mouse hover.

These include reports to the Info Editor, information in editor
headers and footers, and statuses in panels.

In order to limit the use of `TIP_()` to actual tooltips, this commit
introduces a new preference for this extra information: "Reports".

New translation macros are introduced: `RPT_()` and `CTX_RPT_()`, as
well as their equivalent for the Python API, `pgettext_rpt_()`, to be
imported as `rpt_()`.

Pull Request: https://projects.blender.org/blender/blender/pulls/116804
2024-01-12 13:37:29 +01:00