Commit Graph

240 Commits

Author SHA1 Message Date
Harley Acheson
57729aa8bb UI: Improved Operator to Delete Custom Keyconfigs
Changes to python operators that add and remove custom keyconfigs.
Removal gets poll function, separate name and description, and
confirmation.

Pull Request: https://projects.blender.org/blender/blender/pulls/118778
2024-03-14 22:40:04 +01:00
Thomas Dinges
ed20c9e302 Merge branch 'blender-v4.1-release' 2024-03-13 15:22:20 +01:00
Thomas Dinges
f911d4217b Release: Update manual references. 2024-03-13 15:11:22 +01:00
Jacques Lucke
653108068d Merge branch 'blender-v4.1-release' 2024-03-13 10:39:48 +01:00
Jacques Lucke
5c65dba14c Cleanup: make format 2024-03-13 10:39:22 +01:00
Jesse Yurkovich
3762ead281 Merge branch 'blender-v4.1-release' 2024-03-12 21:23:58 -07:00
Jesse Yurkovich
0b19f1f4a0 Fix #119030: Only access Location node input when available
Our `node_shader_utils.py` module needs to be updated to account for API
changes made during the 4.0 release cycle [1].

Here we need to guard against accessing the "Location" node input if not
dealing with the appropriate type of Mapping node.

[1] e4ad58114b9d56fe838396a97fe09aff32c79c6a

Pull Request: https://projects.blender.org/blender/blender/pulls/119354
2024-03-13 05:22:43 +01:00
Campbell Barton
9372e0dfe0 CLI: support defining custom commands via C++ & Python API
Add support for add-ons to define commands using the new argument
`-c` or `--command`.

Commands behave as follows:

- Passing in a command enables background mode without the need to pass
  in `--background`.
- All arguments following the command are passed to the command
  (without the need to use the `--` argument).
- Add-ons can define their own commands via
  `bpy.utils.register_cli_command` (see examples in API docs).
- Passing in `--command help` lists all available commands.

Ref !119115
2024-03-08 11:10:13 +11:00
Omar Emara
eb91828aab GPU: Add maximum image units to GPU capabilities
This patch adds the maximum number of supported image units to the GPU
capabilities module. Currently, the GPU module assume a maximum of 8
units, so the patch is not currently particularly useful, but we can
consider committing it for the future anyways.

Pull Request: https://projects.blender.org/blender/blender/pulls/119057
2024-03-05 07:25:20 +01:00
Sebastian Parborg
6290ead143 Merge branch 'blender-v4.1-release' 2024-03-04 16:53:54 +01:00
Bastien Montagne
afb5cb440b Fix/tweak UI messages (typos etc.). 2024-03-04 11:17:55 +01:00
Jacques Lucke
b879772004 Merge branch 'blender-v4.1-release' 2024-03-01 22:40:23 +01:00
Jacques Lucke
8f36281787 Nodes: expose ordering of links in multi input socket in Python
This fixes #116096 and is based on #115249 with some changes.

This patch contains three changes:
* `NodeSocket.links` in the Python API gives the links in the correct order.
* `NodeLink.multi_input_sort_id` gives read-only access to an id that's used
  for sorting. Note that for historical reasons the highest id is the first link.
* `NodeLink.swap_multi_input_sort_id(other_link)` provides a safe way to
  change the order of links connected to a multi-input socket.

Co-authored-by: Adrian Bibby Walther <adrianbibbywalther@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/118987
2024-03-01 22:36:10 +01:00
Campbell Barton
86954de57a RNA: move the read-only extension "directory" to RNA
This allows it to be exposed in the user interface when the
custom-directory is disabled without having to use a label which can't
handle non UTF-8 characters which file-paths can contain.
2024-02-23 14:57:05 +11:00
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 4bf6a2e564ad2.
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
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
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 41b63ebda2b264165feee1f7c4c0113eb76c8bd9 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]: 661e7e451a0eadd7955a6074a79d570ac4ce2927
2024-02-09 18:11:12 +11:00
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 9cc6ee75e7bad264c4bbcb274add5c71abf113d5 2024-01-24 17:06:57 +11:00