Commit Graph

130958 Commits

Author SHA1 Message Date
Clément Foucault
91fd6b18f3 Fix #115288: EEVEE-Next: Horizon Scan light leaking
This was caused by the normal test being wrong and
not taken into account at all.
2023-12-10 21:36:06 +01:00
Brecht Van Lommel
6cdb43195e Refactor: replace NanoVDB kernel side implementation by own code
The NanoVDB headers are not compatible with Metal due to missing address
space qualifiers. We currently have a big patch for NanoVDB header
files, which is difficult to update for OpenVDB 11. Instead extract a
few hundred lines of code from NanoVDB to do just what we need.

Pull Request: https://projects.blender.org/blender/blender/pulls/115992
2023-12-10 19:37:36 +01:00
Brecht Van Lommel
8ba474dc4f Refactor: replace NanoVDB SampleFromVoxels by own code
This makes the GPU tricubic implementation more efficient. The dense
grid code implemented this in terms of trilinear lookups that are
hardware accelerated, but for NanoVDB this just causes unnecessary voxel
reads. Instead match the CPU code.

Pull Request: https://projects.blender.org/blender/blender/pulls/115992
2023-12-10 19:37:36 +01:00
Brecht Van Lommel
bbb7e7a6d5 Cycles: update to work with OpenVDB 11
Ref #113157
2023-12-10 19:36:40 +01:00
Brecht Van Lommel
798a0b301e Cycles: update OSL to work with version 1.13.5
This keeps compatibility with older stable versions, but not
older unreleased versions in the 1.13.x series.

Ref #113157

Pull Request: https://projects.blender.org/blender/blender/pulls/116004
2023-12-10 17:08:47 +01:00
Campbell Barton
12c4d22e6d Fix #115937: Context override fails to restore screen
The recent addition screen override [0] failed to account for the
override windows screen being overridden when restoring the context.

When overriding the window and screen, it's incorrect to use the
original contexts screen when restoring the screen of the overriding
window.

This window's screen may not be in the original context or the
overriding screen. Resolve the bug by storing this separately
and use it when restoring the context.

[0]: 6af92e1360
2023-12-10 23:33:08 +11:00
Campbell Barton
22d65bad95 Cleanup: pass BMesh by pointer instead of reference
The version of BM_elem_attrs_copy that took a map used a reference
the version without a map didn't, which is fairly confusing.

Pass by pointer now unless this is part of a wider refactor
to move to references everywhere.
2023-12-10 22:12:34 +11:00
Campbell Barton
ffc84da541 Cleanup: use const variables & arguments, remove unused assignments 2023-12-10 21:24:37 +11:00
Campbell Barton
0e64c959be Fix "project_source_info" use with clang
Simple string replacement failed when one compiler was the exact
prefix of another (`clang` & `clang++` in this case),
resolve by performing string replacement on the list items.
2023-12-10 17:35:18 +11:00
Campbell Barton
f02ebe7e2b Cleanup: correct assert to avoid null pointer deference 2023-12-10 17:34:41 +11:00
Campbell Barton
cbf1eac789 Cleanup: avoid pass-by-value on vector argument for ContextVK
Also use const arguments & values.
2023-12-10 17:33:02 +11:00
Campbell Barton
64c4b3428f Cleanup: remove redundant "contains" checks before erasing items 2023-12-10 17:14:46 +11:00
Campbell Barton
52a7555a84 Cleanup: match header/source argument naming 2023-12-10 17:14:06 +11:00
Campbell Barton
ff47eb3e37 Cleanup: minor style tweaks, surround ELEM by parenthesis 2023-12-10 17:12:53 +11:00
Campbell Barton
21fbd9dbd7 Cleanup: add missing header, sort files 2023-12-10 16:38:15 +11:00
Campbell Barton
21525b4ea6 License headers: add SPDX headers 2023-12-10 16:35:15 +11:00
Campbell Barton
ded36920d7 Cleanup: spelling in comments 2023-12-10 16:33:54 +11:00
Campbell Barton
49c6e4ed5a PyAPI: micro optimization accessing keyword arguments for bpy functions
Check the string length before comparing with memcmp,
gives 20-30% speedup for the lookup function.
2023-12-10 16:18:35 +11:00
Campbell Barton
6afad4b8b8 Cleanup: indent readme.html 2023-12-10 16:04:10 +11:00
Campbell Barton
7ee8de9ba4 Cleanup: replace WM_cursor_set with WM_cursor_wait for image copy/paste
WM_cursor_wait is more common and doesn't assume the current cursor
is WM_CURSOR_DEFAULT.
2023-12-10 15:58:10 +11:00
Campbell Barton
3c7b753279 Cleanup: minor changes to read_file_as_buffer logic
Assign the `chunk_first` once instead of checking & assigning
each iteration.
2023-12-10 15:53:43 +11:00
Campbell Barton
af4160de3a Cleanup: avoid redundant read(..) call in read_file_as_buffer 2023-12-10 15:22:07 +11:00
Campbell Barton
5d5fd5d676 Cleanup: make read_file_as_buffer into a generic utility function
Also use a (void *) data argument, matching `read(..)`.
2023-12-10 15:21:45 +11:00
Campbell Barton
3069d59215 GHOST/Wayland: correct fix for #106040
The previous fix for #106040 worked with GNOME, it relied on
matching GNOME's internal limits - which isn't fool proof
and could fail in the future.

Resolve by adding a `read` wrapper that reads the requested number of
bytes (when available).
2023-12-10 14:54:31 +11:00
Brecht Van Lommel
dd9eecaac0 Fix Cycles versioning error after displacement_method removal 2023-12-10 01:35:29 +01:00
Richard Antalik
79dff8174b Cleanup: VSE waveform drawing variables
Code had variables `frame_start` and `start_frame` for different purpose
confusing. Variables were sorted and math simplified.

Fixes broken waveform to pixel grid alignment.
2023-12-09 20:53:10 +01:00
Richard Antalik
b5ce6b6de7 Fix #114951: Waveform drawn incorrectly in strips with hold offset
Caused by not applying the offset to start frame calculation.
Also fixes reverse offsetting of waveform when start offset was
negative - content start frame was used instead of handle frame.
2023-12-09 20:18:58 +01:00
ok_what
5e07e9f7e2 Fix (unreported): Set Color Tag broken when inside meta strip
When editing inside a meta strip, running the "Set Color Tag" operator
would set the color tag of the top-most meta strip, rather than that of
the intended strip.

Pull Request: https://projects.blender.org/blender/blender/pulls/115950
2023-12-09 19:37:08 +01:00
Campbell Barton
15cff1fddb BMesh: optimize attribute copying by reusing BMCustomDataCopyMap
Continuation of fix for #115776. Removes attribute copy functions
that calculate the map inline, this is error prone as it's easy to
call these functions from a loop which may result in poor performance.
2023-12-09 23:16:21 +11:00
Campbell Barton
2c85561fc3 Fix invalid cursor move time-stamp on WIN32 2023-12-09 16:41:56 +11:00
Hans Goudey
0b1049b41d BMesh: Optimize copying attributes from many elements at once
Fixes #115776

Create a minimal structure that contains the instructions necessary to
copy from one custom data format to another. This structure is similar
to the one used in dfacaf4f40. It should have been used in
9175d9b7c2, which instead introduced quadratic performance
relative to the number of layers when copying every element.

In this commit, copying the entire mesh and adding new custom data
are explicitly changed to use the new map to speed up copying many
elements at a time.

The non-map attribute copy functions are also changed to check for when
the source and result BMeshes are the same. In that case it's much
faster to call the "same format" function from 9175d9b7c2.

For numbers, the timings are arbitrarily influenced by how many layers
I add in my testing. With 50 or so layers, a 10x difference is easily
observable though.

Pull Request: https://projects.blender.org/blender/blender/pulls/115824
2023-12-09 05:37:37 +01:00
Guillermo Venegas
7c5fa8bf6c IO: Add initial support for File Handlers registration
Adds initial support for File Handler registration with the python API
for design task #68935. File Handlers will allow developers to associate
additional UI behavior and capability to operators traditionally used
only within the file browser.

The initial commit should have no user visible changes, but will serve
as the foundation for providing file drag & drop capabilities to
operators that can manage files (#111242).

See the PR for an example of python usage.
See design task #68935 for remaining work to be explored in the future.

Pull Request: https://projects.blender.org/blender/blender/pulls/112466
2023-12-09 05:06:10 +01:00
Hans Goudey
85012ccb1f Cleanup: Use simpler positions name in curves selection functions
These functions don't have to know about things like geometry
deformations. As far as they're concerned, they just use the positions
from the argument span instead of the positions stored in the curves.
2023-12-08 20:21:43 -05:00
Hans Goudey
7bfb7af311 Cleanup: Remove excessive use of optimized IndexMask functions
These shouldn't be used when the lambda is non-trivial, it likely
generates too much code and bloats the binary size for no
observable performance gain in these cases.
2023-12-08 20:21:35 -05:00
Harley Acheson
76bf43f44d Fix #115938: BLF Handle Negative Left-Side Bearings
Our glyph bounds clipping test will fail for the first character of a
string if that character has negative left-side bearing. This is not
usual but can happen in some designs for lowercase "j" to have the tail
hook under the preceding character.

Pull Request: https://projects.blender.org/blender/blender/pulls/115965
2023-12-09 01:52:45 +01:00
Harley Acheson
f3c1111836 Fix #114838: Force Full Redraw When Duplicating Areas
Duplicating into a new window needs to tag the new area for full
redraw. Otherwise Outliner will try a partial redraw while the
tree is not yet built.

Pull Request: https://projects.blender.org/blender/blender/pulls/115959
2023-12-08 23:44:19 +01:00
Harley Acheson
639272ef77 Fix #100784: Truncate Text with Ellipsis inside Number Inputs
When a property name is shown inside of a numerical input, truncate
with ellipsis if it cannot fit.

Pull Request: https://projects.blender.org/blender/blender/pulls/115958
2023-12-08 23:40:09 +01:00
Hans Goudey
e0d95b95cc Fix: Build error and format fixes after previous cleanup 2023-12-08 17:19:46 -05:00
Hans Goudey
854cdd1180 Cleanup: Use consistent "mesh" variable name (replace "me")
"mesh" reads much better than "me" since "me" is a different word.
There's no reason to avoid using two more characters here. Replacing
all of these at once is better than encountering it repeatedly and
doing the same change bit by bit.
2023-12-08 16:40:06 -05:00
Hans Goudey
956d00e37a Cleanup: Return sculpt node automasking data by value 2023-12-08 13:09:24 -05:00
Hans Goudey
e5814ab201 Cleanup: Move majority of sculpt paint module to C++ namespaces
And improve naming to remove the inconsistent "SCULPT" prefix in
many cases-- removing redundancy between the namespace name
and the function name. The specific names might need to evolve a bit
still, but it's much less annoying not having to type or read the
namespace all the time. I left out some areas with unclear design.
2023-12-08 13:09:24 -05:00
Hans Goudey
83810e28fc Cleanup: Sculpt explicitly retrieve mesh face visibility attribute
Rather than relying on the pointers in `SculptSession` which should be
removed eventually, to avoid redundant state storage.
2023-12-08 13:09:24 -05:00
Harley Acheson
0137e5494a Fix #40009: Win32 Use Message Time for Events not Current Time
When creating Blender events in Win32 message processing we are using
the current time as timestamp. This isn't set until we collect them, so
this might be inaccurate at times of high load. This PR changes to using
the time the message was delivered.

Pull Request: https://projects.blender.org/blender/blender/pulls/115872
2023-12-08 18:59:31 +01:00
Pratik Borhade
2e5d4a8799 GPv3: Clean loose points operator
Similar to the legacy operator. Removes strokes with a number of points less than or equal to the "limit" property.
Resolves #113599.

Pull Request: https://projects.blender.org/blender/blender/pulls/115923
2023-12-08 16:53:09 +01:00
Pratik Borhade
b9cbc5b335 Fix #115909: Walk Navigation Up and Down is interrupted by WASD
Caused by 93f6001683 , 1b3cfcc74f .
Direction flag names was changed but the max value passed to `ENUM_OPERATORS`
wasn't pointing to actual max value.

Pull Request: https://projects.blender.org/blender/blender/pulls/115926
2023-12-08 15:52:03 +01:00
Jeroen Bakker
65e58fe574 CMake: Fix Compiling Shader Builder on macOS
Due to changes in the build environment shader_builder wasn't able to
compile on macOs. This patch reverts several recent changes to CMake files.

* dbb2844ed9
* 94817f64b9
* 1b6cd937ff

The idea is that in the near future shader_builder will run on the buildbot as
part of any regular build to ensure that changes to the CMake doesn't break
shader_builder and we only detect it after a few days.

Pull Request: https://projects.blender.org/blender/blender/pulls/115929
2023-12-08 15:47:14 +01:00
Jeroen Bakker
f355575f1d Vulkan: Add Debug Name To Descriptor Sets
When debugging the descriptor sets are unnamed. This PR sets the
active shader name. This helps when debugging so we don't need
to track down the shader it is complaining about.

```
 the descriptor (VkDescriptorSet 0x66da6f0000001c58[workbench_prepass_mesh_opaque_studio_texture_no_clip_1022]
binding 7, index 0) is being used in draw but has never been updated via vkUpdateDescriptorSets() or a similar call.
```

This message direct directly to the shader including what part is
needed to be checked. No need to add break points and that sort
of things.

Pull Request: https://projects.blender.org/blender/blender/pulls/115944
2023-12-08 15:32:35 +01:00
Campbell Barton
eb7d5d0972 Fix #115933: Assert with invalid time-stamp on X11 with XIM input
Regression in [0] caused XIM generated key events to assert.

[0]: efef709ec7
2023-12-09 01:18:52 +11:00
Hans Goudey
63432f0963 Cleanup: Store sculpt undo nodes with C++ Vector 2023-12-08 09:05:07 -05:00
Hans Goudey
c4436776d1 Cleanup: Use references for sculpt undo nodes 2023-12-08 09:05:07 -05:00