Commit Graph

150077 Commits

Author SHA1 Message Date
Campbell Barton
99d072e518 Merge branch 'blender-v4.2-release' 2024-07-01 15:16:45 +10:00
Campbell Barton
7447f6415e Merge branch 'blender-v4.2-release' 2024-07-01 15:16:39 +10:00
Campbell Barton
67ddb0e1a5 Extensions: detect external changes on startup & loading preferences
Changes to an extensions manifest weren't accounted for.
This was particularly a problem for "System" extensions which aren't
intended to be managed inside Blender however the problem existed for
any changes made outside of Blender.

Now enabled extensions are checked on startup to ensure:

- They are compatible with Blender.
- The Python wheels are synchronized.

Resolves #123645.

Details:

- Any extension incompatibilities prevent the add-on being enabled
  with a message printing the reason for it being disabled.

- Incompatible add-ons are kept enabled in the preferences to avoid
  loosing their own preferences and allow for an upgrade to restore
  compatibility.

- To avoid slowing down Blender's startup:

  - Checks are skipped when no extensions are enabled
    (as is the case for `--factory-startup` & running tests).
  - Compatibility data is cached so in common case,
    the cache is loaded and all enabled extensions `stat` their
    manifests to detect changes without having to parse them.
  - The cache is re-generated if any extensions change or the
    Blender/Python version changes.

- Compatibility data is updated:

  - On startup (when needed).
  - On an explicit "Refresh Local"
    (mainly for developers who may edit the manifest).
  - When refreshing extensions after install/uninstall etc.
    since an incompatible extensions may become compatible
    after an update.
  - When reloading preferences.

- Additional info is shown when the `--debug-python` is enabled,
  if there are ever issues with the extension compatibility cache
  generation not working as expected.

- The behavior for Python wheels has changed so they are only setup
  when the extension is enabled. This was done to simplify startup
  checks and has the benefit that an installed but disabled extension
  never runs code - as the ability to install wheels means it could
  have been imported from other scripts. It also means users can disable
  an extension to avoid wheel version conflicts.

  This does add the complication however that enabling add-on which is
  an extension must first ensure it's wheels are setup.
  See `addon_utils.extensions_refresh(..)`.

See code-comments for further details.
2024-07-01 15:08:14 +10:00
Campbell Barton
24d8694fe3 Fix regression installing extensions via the command line
Error in [0] meant installing multiple extensions with `--enabled`
would only enable the last extension.

[0]: 176864ab03
2024-07-01 13:55:20 +10:00
Campbell Barton
350b8047c6 Extensions: move the wheel_manager out of the extensions add-on
Move wheel management to a generic private module, prepare addon_utils
to handle changes to repositories on load (needed to resolve #123645).
2024-07-01 10:07:16 +10:00
Clément Foucault
3e867a75c1 Merge branch 'blender-v4.2-release' 2024-06-30 23:20:46 +02:00
Clément Foucault
549024b1cc Fix: EEVEE: Broken shadows
Was caused by an invalid check.

Fix #123959
2024-06-30 23:17:25 +02:00
Jesse Yurkovich
20ecdd628d Merge branch 'blender-v4.2-release' 2024-06-30 12:07:24 -07:00
Charles Wardlaw
783fa03d9a Fix #122651: USD Export: Use solid color texture for DomeLights
When the World material has no texture input, create a solid color .hdr
texture from the Background color instead. This is currently requried
for the Hydra Storm render engine[1]

[1] https://forum.aousd.org/t/usdluxdomelight-without-a-texture-file-attribute/1573

Co-authored-by: kiki <charles@skeletalstudios.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/123933
2024-06-30 21:06:11 +02:00
Clément Foucault
de7e3f992b Merge branch 'blender-v4.2-release' 2024-06-29 22:43:49 +02:00
Clément Foucault
53cb73ecea Fix: EEVEE: Depth Of Field: Tile artifact on noisy input
This was caused by the denoiser of the slight out of focus
pass having too much influence at low CoC values.

Making the transition start at 0.5 fixes the issue.

Fixes #123822
2024-06-29 17:08:14 +02:00
Clément Foucault
49491bc541 Fix: EEVEE: Light: Invalid read in Shadow Setup shader
This happened in scenes with high light count and
with some local light being culled.

The culled lights indices would still be processed
and load undefined data. This undefined data
might be interpreted as a sunlight and go into
the cascade setup loop with an undefined number
of levels.

This created loops of 1 billion iteration per thread
which triggered the TDR on windows.

The fix is to skip the culled light indices.

Fixes #123413
Fixes #123190
2024-06-29 15:35:59 +02:00
Campbell Barton
72e5254669 Merge branch 'blender-v4.2-release' 2024-06-29 22:15:34 +10:00
Andrej730
87844ae24d Fix bl_text_utils/external_editor.py broken __all__
Ref: !123910
2024-06-29 22:14:37 +10:00
Julien Duroure
34c325308f Merge branch 'blender-v4.2-release' 2024-06-29 09:23:58 +02:00
Julien Duroure
38237fe414 glTF exporter: Avoid crash with skinned lattices
We don't export lattices, so don't try to get skin data from it
2024-06-29 09:22:26 +02:00
Julien Duroure
75c9064a50 Merge branch 'blender-v4.2-release' 2024-06-29 09:17:17 +02:00
Julien Duroure
77a382ba2f glTF exporter: call hook for each action, including the active one 2024-06-29 09:16:02 +02:00
Falk David
d90675e662 GPv3: Draw Tool: Write start time and delta time attributes
This writes the `init_time` curve attribute and the `delta_time`
point attribute.
These are used by the build modifier in the "natural drawing speed"
mode to mimic the actual speed at which the stroke was drawn.

Pull Request: https://projects.blender.org/blender/blender/pulls/123899
2024-06-29 09:05:47 +02:00
Weizhen Huang
4c5c5e2fd7 Fix: safe_normalize() not defined for float2 on Metal 2024-06-29 07:56:46 +02:00
Hans Goudey
4162aeee5f Fix: Sculpt: Incorrect undo behavior with modifiers and new brush code
The new brushes don't update `SculptSession::orig_cos` (which is good, it's
not necessary since it's just a copy of the active shape key data or the original
mesh's vertex positions). To fix the problem with the undo system, access those
two arrays directly instead. Once all the uses of the "proxy" system are removed,
`orig_cos` can be removed too.

Pull Request: https://projects.blender.org/blender/blender/pulls/123922
2024-06-28 22:15:23 +02:00
Hans Goudey
0d6148c514 Cleanup: Fix assert test in BMesh sculpt brush code 2024-06-28 15:58:31 -04:00
Hans Goudey
0714795765 Sculpt: Improve base mesh area/normal sampling performance
Avoid copying positions and normals from their source arrays. This is
simplified by using separate loops for the original data and accumulate
cases. I observed a performance improvement in the typical benchmark file
of about 13%, from 0.54s to 0.48s for a brush stroke affecting most of a
6 million vertex grid.
2024-06-28 15:13:35 -04:00
Hans Goudey
5643132c08 Refactor: Sculpt: Specialize area/normal sampling loops per PBVH type
Avoid the need to acess mesh data for every node which will become more
important if we decide to make nodes smaller. Also makes some possible
performance improvements simpler.
2024-06-28 15:13:35 -04:00
Richard Antalik
a28a960715 Merge branch 'blender-v4.2-release' 2024-06-28 21:03:23 +02:00
Richard Antalik
db5cc08714 Revert "Fix #118505: Incorrect strip image transformation"
This reverts commit 3d17217025.
2024-06-28 21:02:38 +02:00
Alexander Brock
fe54824f24 Fix and test direction_to_fisheye_lens_polynomial
The function direction_to_fisheye_lens_polynomial computes the inverse of
fisheye_lens_polynomial_to_direction.

Previously the function worked almost correctly if all parameters except k_0
and k_1 were zero (in that case it was correct except for flipping the x-axis).

I replaced the fixed-point iteration (?) by Newton's method and implemented a
test to make sure it works correctly with a wider range of parameter sets.

Pull Request: https://projects.blender.org/blender/blender/pulls/123737
2024-06-28 20:33:17 +02:00
Hans Goudey
c93767a8b4 Sculpt: Extend refactor to change dyntopo in brushes
Part of #118145.
Similar to 851505752f.
This doesn't affect performance much at all, the vast majority of time
in typical scenarios is spent modifying topology anyway. It does significantly
ease development though, because now we can just do slight modifications
on the "new" version of brush code instead also creating a refactored "old"
version.
2024-06-28 13:54:22 -04:00
Sergey Sharybin
96018c8e8f Merge branch 'blender-v4.2-release' 2024-06-28 19:02:02 +02:00
Clément Foucault
6673302840 EEVEE: Shadow: Split Tilemap finalize
This fixes a kernel crash on NVidia GP100.

This splits the tilemap finalize shader into another shader
and split the valid tile gather into its own loop.

Simplifying the shader seems to avoid the issue. But the
cause of the issue remains unknown.

Pull Request: https://projects.blender.org/blender/blender/pulls/123850
2024-06-28 17:54:00 +02:00
Nathan Vegdahl
3f3dfe1680 Cleanup: fix unused parameter compiler warning in release builds 2024-06-28 17:42:53 +02:00
Richard Antalik
c8b736659b Merge branch 'blender-v4.2-release' 2024-06-28 17:12:57 +02:00
Richard Antalik
3d17217025 Fix #118505: Incorrect strip image transformation
When preview is downscaled and transformation origin is not the center
of the image, this causes unexpected offset. This happened, because one
matrix combined image downscaling, so it fits into preview and user
defined scale. When origin was not center of the image, this results in
incorrect offset.

Solved by splitting 1 matrix in `sequencer_image_crop_transform_matrix`
into 2 matrices. First matrix just centers and scales image to expected
size. Second matrix performs rest of transform operations. This code is
bit easier to read as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/123776
2024-06-28 17:11:17 +02:00
Richard Antalik
1a887c06d9 Fix #123543: Delete retiming keys deletes strip
Delete operator was shared for strips and retiming keys, which was not
ideal. Operator logic relied on invoke function setting proper context
which was also hidden from users.

Split these operators and make dedicated operators for removing retiming
keys - `SEQUENCER_OT_retiming_key_delete`.
This operator returns `OPERATOR_CANCELLED | OPERATOR_PASS_THROUGH` if
executed in non-retiming context, or no key is selected.

Pull Request: https://projects.blender.org/blender/blender/pulls/123767
2024-06-28 17:06:44 +02:00
Julian Eisel
2362d909fc UI: Avoid redundant view item button lookup in context menu code
No need for an additional view item button lookup when the context menu
is built for that button itself. Only do a lookup if the context menu is
built for a button drawn on top of the view item button.
2024-06-28 17:06:29 +02:00
Richard Antalik
c7e75090bd Fix #115981: Edge panning causes strips to overlap
Caused by floating point error in `BLI_rctf_transform_pt_v()`

The error is not fixed, but intead of recalculating each strip offset
with this function, only offset for {0, 0} is calculated and added to
easch strip.

Pull Request: https://projects.blender.org/blender/blender/pulls/123825
2024-06-28 17:03:03 +02:00
Hans Goudey
851505752f Sculpt: Extend refactor to change multires in brushes
So far the brush refactors haven't affected the multires implementations
much. Besides replacing the vertex iteration macro they are fundamentally
the same. This commit refactors the multires implementations to use the
same structure as the base mesh code. The motivations are improving CPU
cache use, removing constant checks from hot loops, and allowing use of
SIMD. This generally works by gathering the AoS multires format into
local arrays.

Quite a few brush evaluation functions have been duplicated to work on
non-indexed data. This will be necessary as we start to handle brushes
that use original data anyway. I don't think this duplication is very
bad though; since the functions are right next to each other it's easy
to change them at the same time. In the future we might investigate
gathering data into local arrays for the mesh implementations too.

In the brush benchmark file from #118145, this improved brush evaluation
performance by roughly 15%, mostly by removing the separate step of
accumulating changes with the proxies system.

Pull Request: https://projects.blender.org/blender/blender/pulls/123703
2024-06-28 17:02:27 +02:00
Sergey Sharybin
cc1070de2d Merge branch 'blender-v4.2-release' 2024-06-28 16:37:41 +02:00
Sergey Sharybin
c309479912 Fix: Changing sculpt multires level erases sculpt changes
The code which is responsible for applying data from coordinate grids to
displacement grids could be run as part of modifier evaluation, hence
using the safe version of accessing mesh data was returning a nullptr.

Pull Request: https://projects.blender.org/blender/blender/pulls/123907
2024-06-28 16:36:56 +02:00
Nathan Vegdahl
8fe9c5ee04 Cleanup: run clang format 2024-06-28 16:14:32 +02:00
Omar Emara
4ebcd7e1d1 Merge branch 'blender-v4.2-release' 2024-06-28 16:28:18 +03:00
Omar Emara
2c345cfe31 Fix: Compositor frees cached resources when canceled
The GPU compositor frees some of the cached resources when it gets
canceled during interactive editing, making the experience less smooth.

This is because when the compositor gets canceled mid-evaluation, some
of the operations won't get the chance to mark their used resources as
still in use.

To fix this, we skip the cache manager reset after canceling,
effectively only resetting when a full evaluation happens, giving all
operations the chance to keep their cached resources.

Pull Request: https://projects.blender.org/blender/blender/pulls/123886
2024-06-28 15:27:09 +02:00
Omar Emara
2eb7c4c329 Fix: Linked images don't work in GPU compositor
Linked images that share the same name as an image in the file will fail
to load in the GPU compositor. That's because cached resources are keyed
using only their ID name, while they should also be keyed by the library
name.

Pull Request: https://projects.blender.org/blender/blender/pulls/123898
2024-06-28 15:26:01 +02:00
Hans Goudey
f187e84fe3 Cleanup: Sculpt: Remove unused variables from PBVH draw data 2024-06-28 09:18:59 -04:00
Hans Goudey
924942fadd Cleanup: Resolve warnings after previous color painting commit 2024-06-28 09:12:27 -04:00
Campbell Barton
7f2d0f7b14 Merge branch 'blender-v4.2-release' 2024-06-28 23:10:14 +10:00
Campbell Barton
b62afb8cd4 Unbreak build in sculpt_paint_color.cc 2024-06-28 23:09:17 +10:00
Hans Goudey
a90a7cd521 Refactor: Sculpt: Consolidate color painting API
Remove the `pbvh_colors.cc` file, since dealing with color attributes should
generally not be the responsibility of the PBVH. Move the color API functions
to the `color` namespace, replacing the two existing `SCULPT_color`
functions. Also replace `SCULPT_has_colors` and `SCULPT_has_loop_colors`
which are redundant with checking the easily accessible attributes directly.
2024-06-28 09:03:25 -04:00
Campbell Barton
acfa60c1ae Cleanup: rename misleading function name, quiet mypy warning 2024-06-28 23:03:17 +10:00
Hans Goudey
155b7d6822 Refactor: Sculpt: Remove color attributes from PBVH and SculptSession
Remove `PBVH::color_layer`, `PBVH::color_domain`, and remove `vcol`, `mcol`,
`vcol_domain`, and `vcol_type` from `SculptSession`. Instead, retrieve attributes
and other arrays from the mesh as necessary and pass them around separately.
This adds more arguments to some functions but it makes their responsibilities
clearer.
2024-06-28 09:03:15 -04:00