Commit Graph

2106 Commits

Author SHA1 Message Date
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
Julien Duroure acc30d6785 glTF exporter: Fix #129548 - Regression - Export ShapeKeys when only Armature modifier
Set a custom property (ignore at export) that can identify and differenciate:
- evaluated mesh
- geometry node with SK
2024-11-13 18:09:56 +01:00
Campbell Barton 0c183e999e Fix #125958: Disable/uninstall an add-on can keep its dependencies
Python wheels from extensions were not being removed after
install/uninstall in some cases - although installing an extension
afterwards that used wheels would recalculate deps & remove them.

- Installing an extension didn't include the extension in the
  compatibility-cache, causing uninstalling not to remove deps.
- Uninstalling an extension wasn't re-calculating the deps,
  leaving them as-is.

Always write the compatibility-cache after installing and uninstalling
so changes are detected & handled.
2024-11-13 13:28:59 +01:00
Campbell Barton 8fbc96c8e5 Cleanup: remove deprecated typing built-ins for extension logic
Deprecated since Python 3.9 but still used in many docs/examples.
2024-11-13 13:28:59 +01:00
Philipp Oeser 87d2a5b679 Cleanup: make format 2024-11-12 15:27:07 +01:00
YimingWu 382fb5e971 Fix #128838: Extension: Support _universal2 suffix for Mac
Some python wheels can have `_universal2` suffixes which are built for
both intel and arm architectures. This fix takes care of that.
2024-11-12 14:53:31 +01:00
Campbell Barton 6d54803f30 Fix #128840: extension build asserts when "type" is missing
Building an extension when the manifest didn't define a "type"
would assert instead of reporting the missing field.

Return earlier when there are errors to prevent the assertion.
2024-11-12 14:52:35 +01:00
Germano Cavalcante c5aad2352b Fix #126665: Reintroduce 'Absolute Grid Snap' (now 'Absolute Increment Snap')
The 'Absolute Grid Snap' feature remains useful even alongside
'Snap to Grid', so this option is being reintroduced, partially
reverting commit f0479e915f.

Pull Request: https://projects.blender.org/blender/blender/pulls/128135
2024-11-12 14:39:22 +01:00
Campbell Barton e84b2301fd Fix #128567: file selector automatically creates paths & warns
Regression in [0] which didn't account for entering paths in the
file selector which would create paths without confirming,
warning that the "confirm" property was missing.

Entering `*.*` would create `_._` for e.g in the users CWD for example.

Ref !128568

[0]: 6dd0f6627e.
2024-10-10 12:55:12 +02:00
Campbell Barton a5c5015dac Fix #128175: Updating extension can remove the extension on WIN32
On Windows an entire directory may be locked when any files inside it
are opened by another process. This can cause operations that
recursively remove a directory (uninstalling & updating) to fail
with a partially removed extension.

The case of uninstalling was already handled, where failure to remove
a directory would stage the extension for later removal.
In the case of updating however, the user could be left with a broken
(partially removed) extension where some files were removed, as the
directory was locked, the update would fail to extract new files.

Address this issue by renaming the directory before recursive removal.

The following logic has been implemented:

- If any files in the directory are locked, renaming will fail.
  So even though the operation fails the extension is left intact.

- If renaming succeeds, it's possible to apply the update.

  While it's possible (albeit unlikely) recursive removal fails,
  which could be caused by file-system permissions issues corruption or
  a process could open a file between rename & removal.

  In this case the renamed directory is staged for later removal.

Other changes:

- Resolve a related problem where the user could install an
  extension previously staged for removal, now installing an extension
  ensured it's not removed later.

  This would occur if uninstalling failed, the user resolves
  directory-lock, uninstalls again, then re-installs the extension.

- When an extension fails to be removed, don't attempt to remove
  user configuration for that extension.

  Prefer to keep the extension & it's settings in their "current state"
  if it can't be removed.
2024-10-10 12:10:07 +02:00
Campbell Barton 98e242201f Cleanup: quiet pylint warnings for extensions 2024-10-10 12:09:37 +02:00
Campbell Barton 62f199343a Extensions: resolve test failing
Enable the extensions add-on by default, without this, it's enabled
on startup, causing the preferences to be tagged as modified.
2024-10-10 12:09:07 +02:00
Campbell Barton f2c3925298 Extensions: only apply SSL workaround for Python older than 3.12.6
Skip the workaround for versions of Python that contain the fix.
2024-10-10 12:08:22 +02:00
Dalai Felinto 54fa2513b5 Extensions: Manifest polishing
* Match name with the extension ID.
* More strict double comment for optional parameters.
* Comment out tag since it is optional.
* More complete explanation for the paths_exclude_pattern.
2024-10-10 12:02:56 +02:00
Julien Duroure 7389b08a08 glTF exporter: fix crash using full collection hierarchy export 2024-10-10 11:18:49 +02:00
Red-Andringa c6b39783aa Fix batch renaming object data from the outliner
Correct typo is_editabe > is_editable.

Ref: !127675
2024-09-23 13:31:29 +02:00
Jesse Yurkovich 37463de122 Fix: error in node wrangler format string 2024-09-23 13:30:20 +02:00