Commit Graph

130443 Commits

Author SHA1 Message Date
Christoph Lendenfeld f06fd85d97 Anim: Restrict range of fcurve_to_keylist
# Issue
Having a lot of keys in your scene can dramatically slow down the Dope Sheet.
That is because everytime the Dope Sheet is redrawn,
the Keylists have to be recomputed.
In the case of the summary channel, that means going through
all keyframes of all the `FCurves` and adding them to the keylist.
That eats up 95% of the time it takes to draw a frame.

# This PR
It's not a perfect solution, rather it solves the performance issue
for the case when you are not displaying all keys.
Instead of going through all the keys, only add the
keys visible in the view to the keylist.
This speeds up the Dope Sheet significantly
depending on the zoom level.

This also improves the responsiveness when selecting and transforming keyframes.

# Performance changes

The function measured is `ED_channel_list_flush`
which is responsible for building the keylists and drawing them.
The test setup contains 62 bones with all
10 channels keyed (location, rot quaternion, scale) on 6000 frames.
So 3.720.000 keys. The heavier the dataset the bigger the performance impact.

The data was recorded with only the Dope Sheet open, and 3 channels visible
* Summary
* Object
* Action

The more channels are visible, the greater the performance gain. This can be seen in the video.

| visible range | before | after |
| - | - | - |
| 200f | 250ms | 10ms |
| 400f | 250ms | 18ms |
| 3000f | 250ms | 130ms |
| 6000f | 250ms | 250ms |

Pull Request: https://projects.blender.org/blender/blender/pulls/114854
2023-11-23 16:37:32 +01:00
Antonio Vazquez 9d8283d113 GPv3: Hide Others operator
This operators hide all materials except the active one.

There is a parameter to hide only active as it was in GPv2.

Related to #114997

Pull Request: https://projects.blender.org/blender/blender/pulls/115038
2023-11-23 16:03:30 +01:00
Miguel Pozo ae1e2951c7 Fix #115144: isect_data_setup compiler error
Rename `isect_data_setup` functions to avoid shader compiler errors.

Pull Request: https://projects.blender.org/blender/blender/pulls/115175
2023-11-23 16:02:10 +01:00
Miguel Pozo cb9584b561 Fix #114482: EEVEE-Next: Wrong Texture Coordinates
Fix Texture Coordinates in World material and screen_coordinates
when using overscan.

Pull Request: https://projects.blender.org/blender/blender/pulls/115057
2023-11-23 15:58:08 +01:00
Miguel Pozo 3197881ca3 Fix #114302: EEVEE Next: Curves material compilation errors
Add missing includes and remove the attributes_lib from shaders
that don't need them.

Pull Request: https://projects.blender.org/blender/blender/pulls/114598
2023-11-23 15:47:56 +01:00
Antonio Vazquez 1d6a617aa2 GPv3: Lock and Unlock all materials operators
This is the conversion of existing operators in GPv2.

Related to #114997

Pull Request: https://projects.blender.org/blender/blender/pulls/115041
2023-11-23 15:36:05 +01:00
Nate Rupsis f9b9ec3b26 Cleanup: internally renaming NLA Channels to NLA Tracks
After renaming "NLA Channels" to "NLA Tracks" user facing, doing a cleanup pass to internally rename things.

Pull Request: https://projects.blender.org/blender/blender/pulls/115011
2023-11-23 15:33:40 +01:00
Antonio Vazquez eb935bf32d GPv3: Lock Unused Materials operator
Conversion of GPv2 operator.

Related to #114997

Pull Request: https://projects.blender.org/blender/blender/pulls/115272
2023-11-23 15:31:47 +01:00
Bastien Montagne 8fc2b63468 Fix (unreported) Scene Collection runtime data not cleared on write. 2023-11-23 15:07:40 +01:00
Bastien Montagne a1507baead Collection: Revert moving `owner_id` to runtime data.
While it may have been working from a practical PoV (not certain though,
since some bug would prevent clearing runtime data when writing embedded
Scene collection in current code), this is semantically wrong.

The owner of an embedded ID is a critical piece of information in
Blender data structure and ID management code. Having it written in
.blend files is also a potential good source of data for investigating
issues.

Further more, this handling of `owner` ID data is somewhat generic now
in ID management, so if this data should be considered runtime, then the
change should also be made in NodeTree and Key IDs.

This commit partially reverts 44dd3308a5, in the future I'd like to
be involved in the review of changes affecting ID management.

NOTE: fix for embedded collection runtime data not being cleared on
write will be committed separately.
2023-11-23 15:07:40 +01:00
Pratik Borhade 3dc119a440 Fix #112767: Outliner unlink operation fails to unlink from scene
When in scene mode, operation searches the object in master collection
to unlink. But object can be in any collection. So iterate through all
collections present in scene to unlink the object

Pull Request: https://projects.blender.org/blender/blender/pulls/112955
2023-11-23 14:49:18 +01:00
Jure Triglav 319ff28b7b Initial exposure of compute dispatch and image store in Python API
Motivation: When discussing with @Jeroen-Bakker and @aras_p about how to
approach sorting when rendering Gaussian splats in Blender, we realised that
compute shaders could help there (and have many other use cases), and that also
due to Blender 4.0 being on OpenGL >= 4.3, we can now rely on compute shaders
existing.

This PR is an initial pass for that functionality. It comes with a Python example, which
runs a compute shader and saves the output to a texture, which is then rendered in the
viewport.

There is no exposed support for storage buffers yet, but I expect I'll be able to work on
them soon if this is accepted.

The newly added parts are:
1. `gpu.compute.dispatch()`
2. a way set the compute source to `GPUShaderCreateInfo`: `shader_info.compute_source()`
3. a way to set the image store for `GPUShaderCreateInfo`: `shader_info.image()`
4. a way to set the `local_group_size` for `GPUShaderCreateInfo`: `shader_info.local_group_size(x,y,z)`
5. a way to get `max_work_group_size` from capabilities: `gpu.capabilities.max_work_group_size_get(index)`
6. a way to get `max_work_group_count` from capabilities: `gpu.capabilities.max_work_group_count_get(index)`

Pull Request: https://projects.blender.org/blender/blender/pulls/114238
2023-11-23 14:23:26 +01:00
Werner, Stefan b12a87b28a Revert "Cycles: Added quality parameter for OIDN"
This reverts commit 2e2291dd83.
2023-11-23 13:50:00 +01:00
Stefan Werner 2e2291dd83 Cycles: Added quality parameter for OIDN
OpenImageDenoise has two modes, high quality and balanced. This now exposes the modes as user parameters, with viewport denoising defaulting to balanced and final frame rendering set to high quality.

Ref #115045

Co-authored-by: Werner, Stefan <stefan.werner@intel.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/115265
2023-11-23 12:35:30 +01:00
Christoph Lendenfeld 1905667967 Refactor: Rename eAutokey_Flag enum
No functional changes.

Rename the `eAutokey_Flag` to `eKeyInsert_Flag`
to indicate that it is not only used for auto keying.
Also rename the enum items to better reflect what they are used for.

Pull Request: https://projects.blender.org/blender/blender/pulls/115295
2023-11-23 12:09:23 +01:00
Jeroen Bakker 9cb2394d7a OpenGL: Mark Legacy Intel Drivers Unsupported
These drivers crash on startup caused by a driver bug. This include the
latest drivers for legacy Intel CPUs with a HD 4000/HD 5000 series GPU.

To be on the safe side all drivers with version 20.19.15.51* will be marked
unsupported as we don't have the platforms to identify the precise driver
versions that fail.

See #113124 for more information.

Pull Request: https://projects.blender.org/blender/blender/pulls/115228
2023-11-23 08:00:22 +01:00
Richard Antalik f4e28d4762 Fix #114982: Crash when rendering scene strips
Since b1526dd2c6, viewport renderer sets `G.is_rendering`, but VSE scene
rendering function used this to decide whether to do offscreen opengl
render or use render API. This logic was quite weak.

Use `SeqRenderData::for_render` instead of `G.is_rendering`, since it
explicitly defines whether strip rendering is invoked by F12 render job.

Since offscreen gl rendering rely on `BLI_thread_is_main()` being
true, use this to initialize `do_seq_gl` variable for clarity.

The use of render job path was further conditioned on `G.is_rendering`,
with exception of running headless, but this condition was incorrect.
This condition was reformulated as precondition, which if true, returns
`nullptr` instead of crashing.

Pull Request: https://projects.blender.org/blender/blender/pulls/115079
2023-11-23 04:29:09 +01:00
Germano Cavalcante a13696a242 Fix #115279: FModifier.type enum 'NULL' item was renamed to 'nullptr'
The 'NULL' identifier within the `FModifier.type` enum was acidently
renamed to 'nullptr' during the C to C++ source conversion in 3ece6876af.
2023-11-22 18:44:44 -03:00
Harley Acheson ff04d50eee Cleanup: Make format
Formatting changes resulting from running Make Format
2023-11-22 12:50:31 -08:00
Hans Goudey 876b624320 Cleanup: Correct offset indices slice assert
If the slice is empty, there doesn't have to be enough space for i
2023-11-22 15:48:42 -05:00
Hans Goudey 9a28852494 Cleanup: Generalize some attribute propagation functions
Add a function that copies selected values to groups of values in the
result array. Add a runtime-typed version and a version for affecting
all attributes. Also make the "gather_group_to_group" follow the
same pattern.
2023-11-22 15:48:42 -05:00
Clément Foucault 44fa9f37eb GPUMaterial: Add volume shader flags
This allows for some optimization when we know
some effects are not present. Also this is needed
to detect the case when world contains absorption
in order to disable distant lighting.

Related #114062
2023-11-22 21:18:19 +01:00
Harley Acheson c5164e513f Fix #115275: Allow Wrapping of Single Column Enum Menus
Enum menus that do not have categories should be able to wrap to
multiple columns is there is enough horizontal space.

Pull Request: https://projects.blender.org/blender/blender/pulls/115283
2023-11-22 21:15:00 +01:00
Nate Rupsis 18ec3679f6 Fix #114861: Add NLA region padding if markers are present.
Fix: add region padding to the NLA track(s) if markers are present.

Pull Request: https://projects.blender.org/blender/blender/pulls/115213
2023-11-22 21:01:15 +01:00
Hans Goudey 02a95198d2 Fix: GPv3: Missing curve type counts update in hard erasor 2023-11-22 14:35:53 -05:00
Hans Goudey e28a782dbe GPv3: Avoid unnecessarily creating cyclic attribute in hard erasor
If the attribute didn't already exist (none of the initial curves
were cyclic), none of the result curves will be cylic either.
2023-11-22 14:35:53 -05:00
Hans Goudey f3ba4115f2 Cleanup: Slightly generalize attribute gather function
Move implementation to array_utils namespace, use function
to gather all attributes at once.
2023-11-22 14:35:53 -05:00
Brecht Van Lommel cf1b3eee99 Fix "make doc_man" not working, after changes in 61d99d45
Ref #115127
2023-11-22 20:01:41 +01:00
HurricanePootis 70e2c0bcd4 Fix #115056: man page generation fails with Python error
Need to convert byte to string.

Pull Request: https://projects.blender.org/blender/blender/pulls/115127
2023-11-22 20:00:58 +01:00
Brecht Van Lommel b9227da2db Cleanup: rename sse2 specific functions to avoid accidentally using them
Ref #115098

Pull Request: https://projects.blender.org/blender/blender/pulls/115098
2023-11-22 19:45:58 +01:00
Leon Marz 6ec0e0104a Fix build error on architectures without SSE or sse2neon
As color_srgb_to_linear is only defined for them.

Pull Request: https://projects.blender.org/blender/blender/pulls/115098
2023-11-22 19:45:53 +01:00
Leon Marz ea1de499b3 Fix: Increase thread stack size for musl libc
Manually set the stack size to 2mb, same as with Apple

Co-authored-by: Damian Kurek <starfire24680@gmail.com>

Pull Request: https://projects.blender.org/blender/blender/pulls/115094
2023-11-22 19:37:13 +01:00
Clément Foucault 440f39f2e5 Fix: EEVEE-Next: blending of dithered material
The code removed in #115066 forgot to remove the
blend method.
2023-11-22 19:21:47 +01:00
Clément Foucault 2c8fbde612 Fix: EEVEE-Next: Ambient Occlusion pass broken 2023-11-22 18:31:52 +01:00
Clément Foucault beee7db425 Cleanup: EEVEE-Next: Remove use of deprecated DRWView API 2023-11-22 18:08:46 +01:00
Clément Foucault 14d4da7555 EEVEE-Next: Add back transparent render pass
Straight forward implementation.
2023-11-22 17:48:58 +01:00
Clément Foucault 6f1ed59c4d EEVEE-Next: Display render pass panel in viewport 2023-11-22 16:57:21 +01:00
Miguel Pozo 7ab622475d Fix: EEVEE-Next: MaterialKey
Options are no longer smaller than sizeof(*mat).
2023-11-22 16:40:12 +01:00
Hans Goudey 8d5aa6eed4 Geometry Nodes: Index switch node
Add an "Index Switch" node which is meant as a simpler version of
the "Menu Switch" from #113445 that doesn't allow naming items
or displaying them in a dropdown, but still allows choosing between
an arbitrary number of items, unlike the regular "Switch" node.
Even when the Menu Switch is included (which should be in the
same release as this), it may still be helpful to have explicit mapping
of indices, and a fair amount of the internals can be shared anyway.

Pull Request: https://projects.blender.org/blender/blender/pulls/115250
2023-11-22 16:11:32 +01:00
Bastien Montagne dfc00e8a18 `install_linux_packages`: Add libdeflate library.
Re. #113157
2023-11-22 15:32:39 +01:00
Bastien Montagne 90f83f71f2 `install_linux_packages`: update for 4.1 libraries, and some fixes.
Fixes:
  - Debian `libfreetype` package has been renamed from `libfreetype6` to
    `libfreetype`.
  - Increased MEX version of python-certifi to 2025, since most distros
    are shipping a '2023' version now.

Updates (following #113157):
  - NumPy: 1.24.3
  - Python: 3.11.6
  - Boost: 1.82.0
  - OpenColorIO: 2.3.0
  - OpenEXR & IMath: 3.2.1
  - OpenSubDiv: 3.6.0
  - OpenVDB: 11.0.0
  - MaterialX: 1.38.8
  - OpenImageDenoiser: 2.1.0
2023-11-22 15:24:40 +01:00
Hans Goudey ba1c8fe6a5 Mesh: Improve remesh attribute transfer
Currently we have options to transfer the paint mask, face sets, and
color attributes to the new mesh created by voxel remesh. This doesn't
make use of the generic attribute design, where it would be clearer to
transfer all attributes with the same methods. That's reflected in the
code as well-- we do duplicate work for the mask and vertex colors, for
example.

This commit replaces the transfer options with a single checkbox for
all attributes. All attribute types on all domains are transferred with
basically the same method as the "Sample Nearest" node from geometry
nodes-- they take the value from the nearest source element of the same
domain. Face corners are handled differently than before. Instead of
retrieving the mixed value of all the corners from the nearest source
vertex, the value from the nearest corner of the nearest face.

---

Some timing information, showing that when interpolating the same
data, the attribute propagation is significantly faster than before.
Edge and corner attributes would add some cost (edges more than
corners), but might not always be present.

Before
```
voxel_remesh_exec: 3834.63 ms
BKE_shrinkwrap_remesh_target_project: 1141.17 ms
BKE_mesh_remesh_reproject_paint_mask: 689.35 ms
BKE_remesh_reproject_sculpt_face_sets: 257.14 ms
BKE_remesh_reproject_vertex_paint: 54.64 ms
BKE_mesh_smooth_flag_set: 0.15 ms
```

After
```
voxel_remesh_exec: 3339.32 ms
BKE_shrinkwrap_remesh_target_project: 1158.76 ms
mesh_remesh_reproject_attributes: 517.52 ms
```

Pull Request: https://projects.blender.org/blender/blender/pulls/115116
2023-11-22 15:21:58 +01:00
Sergey Sharybin 6207b83194 Revert "CMake: Give kernel compilation targets access to console"
The side effect which wasn't that obvious from the documentation
is that tasks in the console pool are executed sequentially. This
made the compile-gpu step to take a long time, because the parallel
compilation got disabled.

That was unintended change, so reverting the change.

Instead, for the buildbot, increase the time limit for the step.

This reverts commit 4b891b4afe.
2023-11-22 15:18:12 +01:00
Miguel Pozo b4f62180fb Fix #114291: EEVEE-Next: Deferred tranparency blending
Disable blending in the deferred pass.

Pull Request: https://projects.blender.org/blender/blender/pulls/115066
2023-11-22 15:10:24 +01:00
Pratik Borhade a7ae024ea3 Fix #115171: Transfer Mode operator tries and fails on linked objects
Skip operator execution if destination id is linked or overridden.

Pull Request: https://projects.blender.org/blender/blender/pulls/115266
2023-11-22 14:55:03 +01:00
Jacques Lucke e50a601a95 Fix: crash when getting node tree logger
It's expected that something is emplaced into `tree_logger_`
by this function in all cases, even if it's just null.
2023-11-22 14:48:51 +01:00
Jeroen Bakker fdf9750df9 EEVEE-Next: Cleanup Lookdev as its shaders are never deferred compiled
Code assumed that lookdev shaders could be deferred compiled, but
that is never the case. This PR cleans up some related code and
mechanisms that were introduced because we thought it was the case.

Pull Request: https://projects.blender.org/blender/blender/pulls/114368
2023-11-22 14:44:57 +01:00
Jeroen Bakker 266f4305a7 EEVEE-Next: Naming & UI tweaks Light Probes
* Rename "Type" to "Shape" in user interface. RDNA already used
  the term Shape (Still need to push this from office)
* Show LightProbe overlay settings
* Rename "Cubemap" to "Sphere"
* Rename "Planar" to "Plane"

Pull Request: https://projects.blender.org/blender/blender/pulls/114406
2023-11-22 14:43:52 +01:00
Hans Goudey 49087a84d0 Geometry Nodes: Use rotation socket for the object info node
See 600a133521 and #92967.
2023-11-22 08:25:32 -05:00
Hans Goudey 106de9f03c Fix: Avoid unnecessary conversions in rotation socket versioning
When the new rotation socket is connected to another rotation socket
already, a conversion node is unnecessary. Check this in addition to the
existing "non-self" implicit conversions.
2023-11-22 08:25:32 -05:00