Commit Graph

686 Commits

Author SHA1 Message Date
codywinch e4e6fd9ebf Last bit of merge fixes hopefully 2025-09-29 10:40:45 -05:00
codywinch e2a66578dc Merge branch 'blender-v4.3-release' into goo-engine-v4.2-release 2025-09-28 11:42:56 -05:00
Bastien Montagne a3491762b5 Fix #144592: FBX exporter: Invalid memory access when exporting tangents.
Since the tangent attributes are now recomputed inside the loop over uv
layers, looping directly over this mesh data is dangerous, as computing
the tangents attributes might trigger some re-allocations, leading to
invalid memory accesses when accessing the next uv layer.

Solved by caching uv layers' names in a list beforehand, the uvlayers
themselves are not even needed for tangent data handling.

Regression from e0a9e98cbd.
2025-08-19 16:37:51 +02:00
Denis Meyzer c945ea9b74 Fix: Only last tangents layer is exported to fbx when mesh has multiple uv layers
Only last tangents layer was written to all tangent layers before this fix.

Code before fix evaluate tangents for all layers into mesh loops data (which keeps data only for one layer) and then writes information about 'each' layer which is actually only the last one.
Code after fix evaluates tangents in the beginning of the loop that exports tangent data so that data for correct layer is being written into fbx.

Co-authored-by: Andrey Zhitkov

Pull Request: https://projects.blender.org/blender/blender/pulls/141839
2025-08-19 16:37:51 +02:00
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
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 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
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
Thomas Barlow b899fbbe1c Fix #123088: Workaround for Unity FBX import per-vertex normals issue
The FBX SDK specifies that normals should use the IndexToDirect FBX
reference mode. This mode allows data written to FBX to be deduplicated
by writing a separate array of indices into the deduplicated array of
data that can be used to reconstruct the full array of data.

When Unity imports per-vertex normals with the IndexToDirect reference
mode, it erroneously considers the imported mesh's normals invalid if
any of its normals were deduplicated. This issue is not present in other
external software that I have tested.

This patch modifies the export of per-vertex normals to not perform any
deduplication, avoiding the issue in Unity's FBX importer while
maintaining use of the IndexToDirect reference mode.

The add-on's patch version has been increased.

Pull Request: https://projects.blender.org/blender/blender/pulls/123186
2024-12-02 18:00:57 +01:00
Campbell Barton be6a84136d 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-02 18:00:44 +01:00
Campbell Barton 776b05fd98 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-11-29 16:35:41 +01:00
Campbell Barton fc9108ded9 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-11-29 16:35:33 +01:00
Campbell Barton 8e43ecdfe7 Correct error printing error in f03fba614d 2024-11-29 16:35:23 +01:00
Campbell Barton c22a3110b5 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-11-29 16:35:15 +01:00
Campbell Barton 8622917874 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-11-28 17:57:51 +01:00
Campbell Barton cf8a569905 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-11-27 20:26:05 +01:00
Campbell Barton ead4f5a898 Extensions: fix building packages containing macos universal wheels 2024-11-27 20:25:58 +01:00
Campbell Barton 35c53bc3a5 Tests: correct hard coded version string in extensions test 2024-11-27 20:25:50 +01:00
Campbell Barton 780d22597a Fix #130705: importing/exporting FBX with lights fails 2024-11-25 12:59:06 +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 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
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