Commit Graph

134337 Commits

Author SHA1 Message Date
Campbell Barton 729949669e Fix #114667: UI List search broken when class names >32 chars
The list identifier includes the class name and an list_id,
see: WM_uilisttype_to_full_list_id

This requires using UI_MAX_NAME_STR (as noted in doc-string).
2024-03-20 14:41:56 +11:00
Sean Kim 130ce5f53d Cleanup: Remove redundant function prefixes in sculpt_trim.cc
This PR strips the `sculpt_gesture_trim` prefix and other similar
prefixes from the `sculpt_trim.cc` code, as it is already contained
within the `blender::ed::sculpt_paint::trim` namespace.

Pull Request: https://projects.blender.org/blender/blender/pulls/119680
2024-03-20 03:41:21 +01:00
Campbell Barton 9edb2784da Fix #117320: UV Sync-select selects faces instead of just edges 2024-03-20 13:39:43 +11:00
Campbell Barton 9b4683fe0a Tests: update scripts to include SPDX headers 2024-03-20 12:28:33 +11:00
Campbell Barton 4ed06c648d Fix #119664: Persistent state not set when disabling add-ons
The wrong persistent attribute was set when disabling an add-on,
also correct the message when disabling an already disabled add-on.
2024-03-20 11:56:25 +11:00
Aaron Carlisle 49cd05020c Docs: Python API: Update the version switch to match the user manual
Not quite a 1:1 match, some customizations have to be made for the API URL differences and the face that there are no translations.

This also enables the version switch publicly now that this change fixes a few bugs.
2024-03-19 20:51:49 -04:00
Sean Kim e53d4e423e Cleanup: Convert sculpt_trim.cc to enum class
This PR converts the three `enum` definitions to `enum class` in sculpt_trim.cc

Pull Request: https://projects.blender.org/blender/blender/pulls/119679
2024-03-19 22:38:25 +01:00
Hik 2d49cc597f Fix #119275: Update Sidebar Values with Voxel Size Changes
Add notifier when changing sculpt voxel size so that the new value is
shown in the sidebar.

Pull Request: https://projects.blender.org/blender/blender/pulls/119646
2024-03-19 20:57:28 +01:00
Hans Goudey 76c5587531 Cleanup: Rename mesh render SortedFaceData fields
Try to add a bit more clarity and use more consistent wording.
2024-03-19 15:14:35 -04:00
Hans Goudey 9fe2e34833 Cleanup: Rename MeshRenderData variables
Use more standard _num suffix and standard mesh variable names.
2024-03-19 15:00:58 -04:00
Jacques Lucke 82f434f444 Nodes: cleanup node declaration finalization
* Extract function for building anonymous attribute references.
* Use is-function-node state directly during building instead of during finalization.

Pull Request: https://projects.blender.org/blender/blender/pulls/119677
2024-03-19 19:54:27 +01:00
Clément Foucault 787818d21d EEVEE-Next: Fix shader compilation error caused by resource macro 2024-03-19 19:23:17 +01:00
Clément Foucault 23dce15f67 EEVEE-Next: Horizon Scan: Use Spherical harmonics
This uses Spherical Harmonics to store the indirect lighting and
distant lighting visibility.

We can then reuse this information for each closure which divide
the cost of it by 2 or 3 in many cases, doing the scanning once.

The storage cost is higher than previous method, so we split the
resolution scaling to be independant of raytracing.

The spatial filtering has been split to its own pass for performance
reason. Upsampling now only uses 4 bilinearly interpolated samples
(instead of 9) using bilateral weights to avoid bleeding.

This also add a missing dot product (which soften the lighting
around corners) and fixes the blocky artifacts seen at lower
resolution.

Pull Request: https://projects.blender.org/blender/blender/pulls/118924
2024-03-19 19:16:21 +01:00
Clément Foucault 893430a2c7 EEVEE-Next: Add correct support for volume anisotropy from probe volumes
This adds the approximation of phase function convolution
of the distant lighting captured inside probe volumes.

This is based on a publication at siggraph from Bartlomiej Wronsky
"Volumetric Fog: Unified compute shader based solution to
atmospheric scattering"

Implementation is quite straightforward. However this isn't as
good as one can expect as there isn't self shadowing from the
volume themself, so the lighting is still quite flat.

To fix this, we have to add support for volumetrics inside
probe volumes baking. But this approach would still be static
so a more general solution is still to be found for dynamic
volumes like smoke simulations.

Pull Request: https://projects.blender.org/blender/blender/pulls/119479
2024-03-19 19:01:05 +01:00
Weizhen Huang a2bb547b9a Fix: Cycles spot light spread sampling not considering non-uniform scaling
For spherical spot light, when the shading point is close to the light
source, we switch to sampling the light spread instead of the visible
cone from the shading point. This has the benefit of less noise when the
spread is small.
However, the light spread sampling was not considering non-uniform
object scaling, where the actual spread might be different.
This patch switches sampling method only when the smallest enclosing
spread cone is smaller than the visible cone from the shading point.

An alternative method would be to compute the actual solid angle of the
scaled cone, and sample from the scaled cone. However, that involves
ray transformation and modifying the sampling pdf and angle. Since
non-uniform scaling is rather a niche case, it's probably not worth the
computation effort.

Pull Request: https://projects.blender.org/blender/blender/pulls/119661
2024-03-19 18:55:35 +01:00
Weizhen Huang a6fba7b59d Cleanup: Cycles: remove unnecessary storage of the spot light axes 2024-03-19 18:55:34 +01:00
Amine Bensalem 1e478cf169 Fix #118137: Symmetry buttons on-click state change
Buttons for mesh symmetry on the toolbar, and other buttons of the same
functionality located in other areas of the window, weren't updated when
clicking on them.

Pull Request: https://projects.blender.org/blender/blender/pulls/118508
2024-03-19 18:49:40 +01:00
Jacques Lucke b99c1abc3a BLI: speedup memory bandwidth bound tasks by reducing threading
This improves performance by **reducing** the amounts of threads used for tasks
which require a high memory bandwidth.

This works because the underlying hardware has a certain maximum memory
bandwidth. If that is used up by a few threads already, any additional threads
wanting to use a lot of memory will just cause more contention which actually
slows things down. By reducing the number of threads that can perform certain
tasks, the remaining threads are also not locked up doing work that they can't
do efficiently. It's best if there is enough scheduled work so that these tasks
can do more compute intensive tasks instead.

To use this new functionality, one has to put the parallel code in question into
a `threading::memory_bandwidth_bound_task(...)` block. Additionally, one also
has to provide a (very) rough approximation for how many bytes are accessed. If
the number is low, the number of threads shouldn't be reduced because it's
likely that all touched memory can be in L3 cache which generally has a much
higher bandwidth than main memory.

The exact number of threads that are allowed to do bandwidth bound tasks at the
same time is generally highly context and hardware dependent. It's also not
really possible to measure reliably because it depends on so many static and
dynamic factors. The thread count is now hardcoded to 8. It seems that this many
threads are easily capable of maxing out the bandwidth capacity.

With this technique I can measure surprisingly good performance improvements:
* Generating a 3000x3000 grid: 133ms -> 103ms.
* Generating a mesh line with 100'000'000 vertices: 212ms -> 189ms.
* Realize mesh instances resulting in ~27'000'000 vertices: 460ms -> 305ms.

In all of these cases, only 8 instead of 24 threads are used. The remaining
threads are idle in these cases, but they could do other work if available.

Pull Request: https://projects.blender.org/blender/blender/pulls/118939
2024-03-19 18:23:56 +01:00
Brecht Van Lommel c12ac94520 Cleanup: make format 2024-03-19 18:20:23 +01:00
Bartosz Kosiorek 18340fa057 UI: Extend description of Grid, Cube, UV Sphere and Ico Sphere
Pull Request: https://projects.blender.org/blender/blender/pulls/119331
2024-03-19 18:19:19 +01:00
Brecht Van Lommel d03f701ae5 Merge branch 'blender-v4.1-release' 2024-03-19 18:16:12 +01:00
Brecht Van Lommel ab9f9930b5 Cycles: Allow enabling OIDN for HIP with environment variable
Using the existing OIDN_DEVICE_HIP, don't overwrite it if it was
already set.

Ref #115045

Pull Request: https://projects.blender.org/blender/blender/pulls/119672
2024-03-19 18:14:28 +01:00
Clément Foucault f646f4c2b4 EEVEE-Next: Refactor world spherical harmonic extraction
This uses parallel reduction when doing the octahedral map re-mapping.

The goal is not the speedup but the accuracy of the computation (temporal
stability) and to pave the way for sunlight extraction.

This weight each individual samples using texel solid angle for correct
energy.

After optimization, the cost is not so expensive (1024px² octahedral map):
- new: 263µs remap + 12µs sum
- old: 75µs remap + 180µs irradiance update

We could optimize it more, but that feels unecessary given that the first
two filter pass are 7ms and a more pressing optimization.

The old irradiance update was fast because it was using the mip2 which
was already pre-filtered and using way less pixels (which already yield a
temporally stable output).

This new implementation does consider all pixel in the LOD0 which will
allow for more precise sunlight extraction.

This also comes with a cleanup of the update tagging.

Pull Request: https://projects.blender.org/blender/blender/pulls/119537
2024-03-19 18:10:24 +01:00
Brecht Van Lommel f20d9fe5a5 Merge branch 'blender-v4.1-release' 2024-03-19 18:05:33 +01:00
Brecht Van Lommel f771a8563b Fix #110751: Crash baking grease pencil line art
Ensure depsgraph tag happens when strokes are cleared, otherwise the
next depsgraph evaluation tries to use freed stroke data.

Pull Request: https://projects.blender.org/blender/blender/pulls/119662
2024-03-19 17:59:19 +01:00
Sean Kim 9b5b1f525f Cleanup: Limit sculpt gesture RNA operator properties
This PR limits adding the RNA property `use_limit_to_segment`
to `ShapeType::Line` based sculpt gesture operators, as the
property is inapplicable for the other two types.

Pull Request: https://projects.blender.org/blender/blender/pulls/119670
2024-03-19 17:32:59 +01:00
Falk David 0177c55880 Fix: Curves: Missing check in `get_mutable_attribute`
Same as fd92647f34.
Without this check, the function would try to create a new
attribute even if `num` was 0.
2024-03-19 17:09:41 +01:00
Thomas Dinges 4b0ad27d88 Extern libs: Remove info to update THIRD-PARTY-LICENSES
This file is generated by the attribution builder for every release
and it's up to the release team to check the log for extern and others to make sure this is up to date.
2024-03-19 17:06:31 +01:00
Hans Goudey 803c783e52 Merge branch 'blender-v4.1-release' 2024-03-19 11:59:26 -04:00
Hans Goudey 62b484544a Fix: Operator depends on cursor ignores macro operators
The change in 23ebc45f70 was slightly incorrect.
2024-03-19 11:58:46 -04:00
Hans Goudey cc0e015a35 Fix #119177: False positive dyntopo attribute detection warning
".sculpt_mask" is handled as a special case for dynamic topology
but wasn't detected that way in the warning.

Pull Request: https://projects.blender.org/blender/blender/pulls/119665
2024-03-19 16:55:21 +01:00
Thomas Dinges 2090ba8b07 Merge branch 'blender-v4.1-release' 2024-03-19 16:47:14 +01:00
Aras Pranckevicius a05adbef28 BLF: optimizations and fixes to font shader
Simplifies/optimizes the "font" shader. It runs faster now too, but primarily
this is so that it loads/initializes faster.

* Instead of doing blur via individual bilinear samples (where each sample is 4
  texel fetches), do raw texel fetches of the kernel footprint and compute final
  result by shifting the kernel weights according to bilinear fraction weight.
  For 5x5 blur, this reduces number of texel fetches from 64 down to 36.
* Instead of checking "is the texel inside the glyph box? if so, then fetch it",
  first fetch it, and then set result to zero if it was outside. Simplifies the
  branching code flow in the compiled GPU shader.
* Avoid costly integer modulo/division for "unwrapping" the font texture. The
  texture width is always power of two size, so division/modulo can be replaced
  by masking and a shift. Setup uniforms to contain the needed data.

### Fixes

* The 3x3 blur was not doing a 3x3 blur, due to a copy-pasta typo (one of the
  sample offsets was repeated twice, and thus another sample offset was
  missing).
* Blur towards left/top edges of the glyphs had artifacts, because float->int
  casting in GLSL rounds towards zero, but the code actually wanted to round
  towards floor.

Image of how the blur has changed in the PR.

### First time initialization

* Windows 10, NVIDIA RTX 3080Ti, OpenGL: 274.4ms -> 51.3ms
* macOS, Apple M1 Max, Metal: 456ms -> 289ms (this is including PSO creation
  time).

### Shader performance/complexity

Performance I only measured on macOS (M1 Max), by making a BLF text that is
scaled up to cover most of screen via Python. Using Xcode Metal profiler,
drawing that text with 5x5 shadow blur: 1.5ms -> 0.3ms.

More performance analysis details in PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/119653
2024-03-19 16:29:21 +01:00
Sybren A. Stüvel cd476226d8 Fix #119402: Bone collections layers fail with pinned object or armature #119434
Don't assume armature of active object is what is displayed in the properties editor, both in C++ and Python code.

Object pointer was left out from some notifiers, as this means only that object was changed. But an armature datablock can be shared by multiple objects.

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/119663
2024-03-19 16:27:06 +01:00
Thomas Dinges 981afe2a65 Release: Update THIRD-PARTY-LICENSES for 4.1 2024-03-19 16:21:29 +01:00
Weizhen Huang 8536575263 Fix: Cycles area light ignores some valid samples in volume segment 2024-03-19 14:48:43 +01:00
Weizhen Huang f5f10201ca Cleanup: remove unused function 2024-03-19 14:48:14 +01:00
Jeroen Bakker 6ceefe4f23 Revert "Fix #119527: Aliased Wireframe In XRay"
This fix should only be committed to blender-v4.1-release branch
Blender 4.2 the pos/nor buffers are separated and doesn't lead
to drawing artifacts.

This reverts commit 02379f3200
2024-03-19 14:34:54 +01:00
Jeroen Bakker 922c5c679f Merge branch 'blender-v4.1-release' 2024-03-19 14:33:46 +01:00
Jeroen Bakker 162fad716e Revert "Fix #119527: Aliased Wireframe In XRay"
This fix should only be committed to blender-v4.1-release branch
Blender 4.2 the pos/nor buffers are separated and doesn't lead
to drawing artifacts.

This reverts commit 02379f3200
2024-03-19 14:27:31 +01:00
Jeroen Bakker 02379f3200 Fix #119527: Aliased Wireframe In XRay
This change reverts 14500953ed. This commit improved the performance
but introduced the regression. The wireframe shader checks the normal
buffer to detect if attributes are being rendered. The VBO contains both
positions and normals.

In Blender 4.2 this VBO was separated (#116902)and this solved the rendering. It is
to late and risky to add this separation to 4.1 in the last minute so we
decided to revert the performance improvement as it was already an issue
for several years.

The performance improvement will still be in Blender 4.2 where it doesn't
have these artifacts.

Pull Request: https://projects.blender.org/blender/blender/pulls/119656
2024-03-19 14:27:09 +01:00
Jeroen Bakker b5168ee771 Fix #119527: Aliased Wireframe In XRay
This change reverts 14500953ed. This commit improved the performance
but introduced the regression. The wireframe shader checks the normal
buffer to detect if attributes are being rendered. The VBO contains both
positions and normals.

In Blender 4.2 this VBO was separated (#116902)and this solved the rendering. It is
to late and risky to add this separation to 4.1 in the last minute so we
decided to revert the performance improvement as it was already an issue
for several years.

The performance improvement will still be in Blender 4.2 where it doesn't
have these artifacts.

Pull Request: https://projects.blender.org/blender/blender/pulls/119656
2024-03-19 14:23:43 +01:00
Philipp Oeser 2dcee3d698 Merge branch 'blender-v4.1-release' 2024-03-19 14:06:11 +01:00
Philipp Oeser 4a7c5d3d3d Fix #119534: Action Editor empty channels region without active action
Caused by a96f1208cc

For `SPACE_ACTION` (`SACTCONT_ACTION`), `actedit_get_context` will
return true, but `ANIM_animdata_context_getdata` also checks the
`bAnimContext` data [which in this case is the action], so will **not**
return true.

As a result we are skipping drawing the background and the search, which
is now done again.

Pull Request: https://projects.blender.org/blender/blender/pulls/119621
2024-03-19 14:05:42 +01:00
Jacques Lucke dc762d0914 BLI: avoid compiling same function multiple times for trivial types
For example, copying and moving a trivial type ends is the same.
However, currently we generate the code for both cases independently
instead of reusing the same underlying function.

This reduces the size of the Blender binary from `218.548.896` to
`218.355.552` bytes for me. So it's a reduction of about 200kb.

It's probably possible to reduce this even more, but that's for another day.
The main tricky thing here is telling the compiler that a `const` from a
function parameter can be cast away for trivial types (see code comment).
Maybe there is a better way to do this while making sure the compiler
doesn't generate unnecessary code.

Pull Request: https://projects.blender.org/blender/blender/pulls/119601
2024-03-19 13:45:04 +01:00
Jacques Lucke 3ad4ea81d1 Nodes: rename multi_input_socket_index to multi_input_sort_id
For historical reasons, the `multi_input_socket_index` was actually reversed
(large index comes first). This patch renames it to `multi_input_sort_id` and
adds a comment. This new name makes it less confusing that the id is reversed.

Pull Request: https://projects.blender.org/blender/blender/pulls/119652
2024-03-19 13:42:09 +01:00
Falk David 462437de20 Fix: GPv3: Assert in `LayerTreeView::build_tree()`
This was caused by 745fd2a2cb.
The issue was that there was an attempt at calling
`uncollapse_by_default` on a `LayerViewItem`
which can't be collapsed (because it can't have any children).
This then triggered the assert.

The fix removes the call to `uncollapse_by_default` for
`LayerViewItem`.
2024-03-19 11:50:46 +01:00
Sybren A. Stüvel 7ec5dab1df Merge remote-tracking branch 'origin/blender-v4.1-release' 2024-03-19 11:18:31 +01:00
Falk David 3334fff801 Fix compiler error on windows
It seems that the compiler on windows struggled to
correctly assign the namespace of the `LocalMemArena`
destructor because the struct was defined locally
in a lambda.

This moves the struct definition out of the lambda.
2024-03-19 11:09:57 +01:00
Sybren A. Stüvel c0c7e34bab Fix #119615: Anim, Crash with NLA tweak mode and linked Armatures
Fix a crash when inserting a key with tweak mode enabled, but where
`AnimData::actstrip` was NULL.

The root cause of this is that two pointers in the `AnimData` struct
(`act_track` and `actstrip`) are expected to be set when NLA tweak mode
is enabled, BUT these are not exposed to RNA and thus invisible to the
library overrides system. As such, they are NULL when loading from disk,
while the `ADT_NLA_EDIT_ON` flag still indicates they are to be used.

Rather than adding a NULL pointer check (and having to add that in many
more places), I used this two-pronged approach:

- Extend the 'NLA tweakmode' override apply code, to set the `act_track`
  and `actstrip` pointers when they are incorrectly NULL. This is done
  by lookup of the track and strip by name.
- Add versioning code to exit out of tweak mode whenever the
  `ADT_NLA_EDIT_ON` flag is set, but those two pointers are still NULL.

The last step was necessary with the example file attached to the bug
report, as that was saved with a buggy blender version. New saves work
just fine.

Pull Request: https://projects.blender.org/blender/blender/pulls/119632
2024-03-19 10:45:32 +01:00