Commit Graph

2122 Commits

Author SHA1 Message Date
Campbell Barton 7629abe435 4.2LTS: Extensions: forward any errors setting up wheels to reports
When actions on extensions failed setup extensions, errors weren't
forwarded to the user and were only visible in the terminal.

---

Back ported from fb3fe458bf

Pull Request: https://projects.blender.org/blender/blender/pulls/139017
2025-05-19 10:13:01 +02:00
Sergey Sharybin af21da1282 Move tests/data and assets to the main repository
This change moves the tests data files and publish folder of assets
repository to the main blender.git repository as LFS files.

The goal of this change is to eliminate toil of modifying tests,
cherry-picking changes to LFS branches, adding tests as part of a
PR which brings new features or fixes.

More detailed explanation and conversation can be found in the
design task.

Ref #137215

Co-authored-by: Brecht Van Lommel <brecht@blender.org>

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

Pull Request: https://projects.blender.org/blender/blender/pulls/138487
2025-05-06 13:42:47 +02:00
Falk David 7140dace7a Fix #136538: Grease Pencil: Remove unused "Sample Color" keymap
This was meant to be used by GPv3, but ended up also being called
from GPv2 Draw Mode.
Removes the entry since it's not doing anything.

Pull Request: https://projects.blender.org/blender/blender/pulls/136599
2025-04-11 13:31:58 +02:00
Brecht Van Lommel 1c953fca2e Fix: Blender as Python Module shared library directory wrong
This could affect for example the USD and MaterialX Python modules
that are now bundled, and need appropriate paths to their libraries.

Ref #134676

Pull Request: https://projects.blender.org/blender/blender/pulls/134937
2025-03-13 14:36:39 +01:00
Campbell Barton 1f892ff92d Fix #83819: Toolbar tooltip missing with custom-keymap
When accessing the key-map for tooltips it's important to use
the final "user" keymap, combine from "active" & "default".

Using the active keyconfig would only keys from key-maps that had
been modified.
2025-03-12 16:15:21 +01:00
Alaska 5fc636c67a Fix #135294: Improve missing VR support error message on macOS
This commit improves the error message explaining why VR isn't
supported on the macOS platform.

Pull Request: https://projects.blender.org/blender/blender/pulls/135302
2025-03-12 16:14:29 +01:00
Campbell Barton 51b3864ae0 Fix #131947: Error closing prefs while installing extensions on WIN32
Using `signal.SIGINT` to send a signal to a sub-process isn't supported
on WIN32, replace with `signal.CTRL_BREAK_EVENT`.
2025-02-14 17:32:46 +01:00
Christoph Lendenfeld 6e0232fc71 Fix: Error when baking custom properties of unavailable addon
When baking an Action on an object which has custom properties that come
from an addon or python script that isn't loaded, the baking would fail with:
```
TypeError: Cannot assign a 'dict' value to the existing 'hops' Group IDProperty
```

This comes from an addon that isn't present or loaded on a users machine.
The fix is to check for `IDProperty` and skip those.

Pull Request: https://projects.blender.org/blender/blender/pulls/129057
2025-02-14 17:27:11 +01:00
Christoph Lendenfeld e30a332dcb Fix #131495: Pose Library error with enum values
Enums in Blender evaluate to a string, so trying to add them to a pose
failed with an error because FCurves only accept numbers.

The fix is to modify the data path and split the property name off.
By evaluating that we arrive at the bone, from which we can call `get(property_name)`
to get the int value.

Pull Request: https://projects.blender.org/blender/blender/pulls/132124
2025-01-14 13:51:53 +01:00
Campbell Barton 3ee045724f Refactor: adjust the URL/file-system data iterators for extensions
The logic to generalize over downloading a URL or reading data from
the file-system included static values in the iterator along with the
data being read - so the caller could access the total expected size of
the data being read. While this worked, the result didn't read well.

Now these iterators yield the data being read, a new type has been
added for the caller to read the size hint from.

Also correct invalid doc-string.
2025-01-14 13:50:52 +01:00
Campbell Barton 813aff7288 Cleanup: replace Generator type with Iterator where appropriate 2025-01-14 13:47:16 +01:00
Campbell Barton 0b57585607 Extensions: suppress resource leak warning on WIN32
Accessing the internal extensions command would warn that the processes
stdout wasn't closed on completion. While it's harmless at the moment,
ensure it's closed using a context manager.
2025-01-14 13:46:21 +01:00
Christoph Lendenfeld 5710f38199 Fix #129416: Wrong Bone Selection Set used for selection
The issue was that when using a specific selection set,
the property `selection_set_index` is set to a specific index.
That index would persist to the next call of the operator
when trying to call it from the selection set list. The fix is to explicitly reset the
index to -1 when calling the operator from the list, because
that means the active selection set will be used.

Pull Request: https://projects.blender.org/blender/blender/pulls/131675
2025-01-14 12:12:10 +01:00
Christoph Lendenfeld 5753900970 Fix #130053: ALT+H in weight paint not unhiding bones
When in bone selection mode of during weight painting,
pressing ALT+H would unhide faces instead of bones.
Removing the keymap entry fixes that, while still allowing
unhiding of faces in face mask mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/131104
2024-12-10 14:03:14 +01:00
Campbell Barton 3ab3157fdd Fix error enabling extensions with an empty wheel list
Regression in [0] caused extensions with an empty wheel list
to raise an unhandled exception when extracting the Python
version from the wheel list.

Besides resolving this error, account for errors using the wheel
list since it isn't type checked in this code-path.

[0]: cfc10b0232
2024-12-10 14:00:41 +01:00
Campbell Barton 948ddd86dc Extensions: use replace exists with lexists to check a path can be used
Without this, a broken symbolic-link wasn't removed, causing renaming
to fail.
2024-12-10 14:00:16 +01:00
Campbell Barton 0eabdc27f2 Extensions: suppress noisy prints for extension wheel filtering
These messages could flood the output even when extension installation
succeeded. Only show them when Python debugging is enabled.
2024-12-10 13:59:35 +01:00
Campbell Barton 19a8ec2709 Correct error printing error in f03fba614d 2024-12-10 13:59:05 +01:00
Campbell Barton 14d0339678 Fix #130211: Unhandled error installing extensions when renaming fails
Add error handling for rare but possible failures on installation.

- Account for the destination extension directory being a file.
- Handle the exception if renaming the temporary directory fails.
2024-12-10 13:57:54 +01:00
Campbell Barton bce84bcbcc Fix failure to reinstall an extension uninstalling the extension
When an extension could could be removed but it's directory could be
renamed, the install operation would fail anyway.

Resolve by completing the installation when the directory can be moved.

Report as part of #129884.
2024-12-10 13:50:26 +01:00
Julien Duroure a5a8cd9e6a glTF exporter: Fix crash when animation on not used material
(And when exporting using KHR_animation_pointer)
2024-12-10 13:49:35 +01:00
Julien Duroure 383b780b97 glTF exporter: Fix debug logging
Set INFO level if user set debug to whatever value not used to set logging level
2024-12-10 13:48:03 +01:00
Julien Duroure a8714eaa3d glTF exporter: Fix crash with extra channel 2024-12-10 13:35:11 +01:00
Campbell Barton 9991116bdd Fix #130561: incorrect Python compatibility checks for wheels
Regression in [0] caused wheels with an older Python version
that used CPython's stable ABI to be considered incompatible.

Resolve using the stable ABI for version checks.

[0]: cfc10b0232
2024-12-10 13:10:34 +01:00
Campbell Barton 68df34ecf0 Extensions: fix building packages containing macos universal wheels 2024-12-10 13:09:46 +01:00
Campbell Barton bdc8d6963e Tests: correct hard coded version string in extensions test 2024-12-10 13:08:04 +01:00
Philipp Oeser 2c4470fad7 Cleanup: make format
Pull Request: https://projects.blender.org/blender/blender/pulls/130266
2024-11-14 12:04:37 +01:00
Pratik Borhade 97f46556fb Fix #130059: Rigify Limb menu disppears for some rotation fields
Caused by 78b9218c98
Undefined `iface_` is used, this terminates execution of further UI panel draw
code. Fix this by importing iface_ from module.

Pull Request: https://projects.blender.org/blender/blender/pulls/130063
2024-11-14 11:28:03 +01:00
Campbell Barton 69b85ae972 Fix #130024: addon_utils.enable(..) doesn't setup extensions wheels
addon_utils.enable/disable now handle wheels so that the functions can
be used with extension add-ons.

A new argument `refresh_handled` supports scripts handing refresh
themselves which is needed to avoid refreshing many times in cases
when there are multiple calls to enable/disable.

This is mostly useful for internal operations.
2024-11-14 11:28:03 +01:00
Campbell Barton 567c061aaf Fix missing extensions refresh after the repository config changed
Enabling/disabling a repository was not refreshing its wheels or
compatibility data.
2024-11-14 11:28:02 +01:00
Campbell Barton a2e69961f2 Fix missing wheel refresh after updating extensions
Applying all available updates wasn't re-synchronizing wheels.
2024-11-14 11:28:02 +01:00
Campbell Barton fa4688451a Tests: add tests to ensure literal paths are properly handled
Add tests to ensure literal paths are handled properly
(created as part of the fix for #129724).
2024-11-14 11:28:02 +01:00
Campbell Barton b6f9d12510 Extensions: quote paths in error messages, improve missing file error 2024-11-14 11:28:02 +01:00
Campbell Barton 102f93faf2 Fix #129724: building extensions fails with non empty paths 2024-11-14 11:28:02 +01:00
Campbell Barton 5699f0ea32 Fix error installing extensions with wheels
Error in [0] caused versions not to match when enabling
extensions after installation or upgrade.

[0]: a3a3dda563
2024-11-14 11:28:02 +01:00
Campbell Barton cfc10b0232 Extensions: support for filtering based on Python versions
Support multiple extensions with different Python versions in a similar
way to how "platforms" are handled now.

This will be needed when Blender upgrades to a newer version of Python
so extensions which have a binary dependency on Python 3.11 don't
attempt to install in a Blender built with a newer Python version.

Details:

- Extensions from incompatible Python versions are not listed.
- Python versions are extracted from wheel names.
- An extension may include wheels for multiple Python versions,
  only the compatible wheels will be installed.
- Links may include a "python_versions" field which is checked
  when dropping into Blender.
- JSON generated by the "server-generate" command include the:
  "python_versions" field for extensions that include wheels.
- The "python_versions" field is optional, when omitted no version
  checks are performed.

Also correct watch_test make target.

Ref #128750.
2024-11-14 11:28:02 +01:00
Campbell Barton 02f36817d5 Extensions: exclude "wheels" from the static JSON package listing
While relatively harmless, it's unnecessary bloat.
2024-11-14 11:28:02 +01:00
Julien Duroure 47631908de glTF exporter: Fix Regression #128807 - avoid spaming stdout
error log will go to stderr, and others to stdout
A new parameter in operator to set the loglevel from command line bpy.ops.export_scene.gltf(loglevel=logging.INFO)
If not set from the ops, value is -1, and is set, as before, from the bpy.app.debug_value

Pull Request: https://projects.blender.org/blender/blender/pulls/130263
2024-11-14 10:44:11 +01:00
Julien Duroure 3b8365ae3b glTF export: Add logging level control for export
This was already the case at import
2024-11-14 10:44:08 +01:00
Campbell Barton be3bfba518 UI: replace "Extension" with "Add-on" for enable/disable operators
This operator deals specifically with add-ons, using the term extensions
is misleading as it works for legacy (non-extension) add-ons and
extensions can also be themes.
2024-11-14 10:44:08 +01:00
Philipp Oeser e2ff8eb714 Cleanup: make format
Pull Request: https://projects.blender.org/blender/blender/pulls/130226
2024-11-13 18:09:59 +01:00
Campbell Barton 0bbdf9dc30 Cleanup: remove deprecated typing use for extensions utility
Also replace some uses of Generator with Iterator.
2024-11-13 18:09:56 +01:00
Campbell Barton 54fc3d2120 Cleanup: replace typing.Union/Option with logical OR for extensions
Also remove use of deprecated typing.Sequence.
2024-11-13 18:09:56 +01:00
Julien Duroure aa8fd273cd glTF exporter: Fix regression exporting animated camera
Was introduced bu KHR_animation_pointer
2024-11-13 18:09:56 +01:00
Julien Duroure 8112c2da0b glTF exporter: Fix some UDIM export
- Do not export tiles if no vertices in it
- fix check jpg & webp detection for udim textures
2024-11-13 18:09:56 +01:00
Julien Duroure 0218a34960 glTF exporter: Fix #129407 - fix crash when step is != 1 and actions are not aligned
Example:
Step is 3
Action starts at 1, so the action will try to export frames 1 / 4 / 7 / 10, etc...
But full object backing is enable, and scene starts at 0.
So cached data are on frame 0 / 3 / 6 / 9 / 12, etc...

When we are trying to export the action on armature after the full bake on empty, we are trying to retrieve frame 1, but cache was on 0 / 3 / 6 / 9
2024-11-13 18:09:56 +01:00
Julien Duroure a27c96e069 glTF exporter: Fix regression exporting emission with texture
Regression was introduced by KHR_animation_pointer
2024-11-13 18:09:56 +01:00
Julien Duroure 9e3397779b glTF exporter: Remove some typing
This crashes bpy as a module (not sure why)
Cf #126807
2024-11-13 18:09:56 +01:00
Julien Duroure b71e75352c glTF exporter: fix typo in hook name
Preventing having 2 hooks with same name at different places
2024-11-13 18:09:56 +01:00
Julien Duroure e560ef8183 glTF exporter: Manage alpha when performing RGB2BW conversion
Based on what is visually done in viewport
2024-11-13 18:09:56 +01:00