Commit Graph

135885 Commits

Author SHA1 Message Date
Clément Foucault
286cbc8317 Fix: EEVEVE-Next: Wrong material reused for transmission material
This is caused by #121137 as the bug disappear if
`can_use_default_cb` returns false.


The issue is caused by the material binning system.
`ShaderKey` uses the `GPUMaterial` to differentiate between
material. But with #121137, different materials can reuse the
same `GPUMaterial`.

The fix is to not reuse the shader for the prepass (even if opaque)
for transmission enabled shaders.

Fix #121343
2024-05-07 17:34:36 +02:00
Clément Foucault
a7eb1a13d4 Cleanup: EEVEE-Next: Make format 2024-05-07 16:36:09 +02:00
Clément Foucault
d9915b86a6 EEVEE-Next: Remove shadow softness factor parameter
This parameter was introduced to mitigate shadow tracing
artifacts. These are no longer present since #121317 and
leaving this parameter breaks PBR rules which opens other
issues with shadow disconnected from shading.
2024-05-07 15:49:49 +02:00
Jeroen Bakker
32e6042230 EEVEE-Next: Fix division by zero when copying motion vectors
Due to recent changes geometry without any vertices could lead to
a division by zero when copying motion vectors.

This PR fixes this by skipping the copy step when there are no
vertices to copy.

Pull Request: https://projects.blender.org/blender/blender/pulls/121516
2024-05-07 15:43:51 +02:00
Philipp Oeser
3dd08beab3 Fix #121459: STL / Alembic / PLY export empty meshes in editmode
Export would also assert in debug builds.

Similar to f8b11528b2, this now ensures we have mesh data in editmode.

Pull Request: https://projects.blender.org/blender/blender/pulls/121512
2024-05-07 15:20:03 +02:00
Philipp Oeser
238ee9683a Fix: memleak in Graph Editor Keyframe jump operator
In case no frame to jump to was found, `ANIM_animdata_freelist` wasnt
called.

Spotted while looking into #121463

Pull Request: https://projects.blender.org/blender/blender/pulls/121484
2024-05-07 15:19:05 +02:00
Philipp Oeser
734a9dec43 Fix #121463: Graph Editor Keyframe jump operator shifts keyframes
Caused by 598af45459

Above commit added respect for the NLA strip offset (rightfully so, by
using `ANIM_nla_mapping_apply_fcurve`).
However, when no closest frame was found, the code moved on to the next
FCurve without restoring to the original FCurve --
`ANIM_nla_mapping_apply_fcurve` needs to be called in pairs.

To resolve, now always restore to the original FCurve.

Pull Request: https://projects.blender.org/blender/blender/pulls/121483
2024-05-07 15:17:26 +02:00
Philipp Oeser
b57916463c Fix #121121: NLA push down places local tracks before library overrides
The history here goes from c0bd240ad0 through 89ae4a7a2a (which were
still good), but then with 81b56f8bbc we have gotten to a point were
tracks were placed **before** overrides in case no local tracks were
found.

Now corrected.

Pull Request: https://projects.blender.org/blender/blender/pulls/121395
2024-05-07 15:16:47 +02:00
Clément Foucault
d6aa790301 Cleanup: EEVEE-Next: Remove warnings 2024-05-07 15:07:41 +02:00
Clément Foucault
0b7985a58b EEVEE-Next: Increase shadow precision in render tests 2024-05-07 15:07:40 +02:00
Nathan Vegdahl
8dbd167e80 Anim: add failure propagation to more lower-level keying functions
This changes the following keyframing functions to return
`SingleKeyingResult`, which is in turn used for better failure
reporting in the higher-level functions that call them:

- `KeyframeStrip::keyframe_insert()`
- `insert_vert_fcurve()`

As a side effect, this also means that
`rna_KeyframeAnimationStrip_key_insert()` can no longer return an
`FCurve *`, and now instead returns a bool indicating success.

This is part of an ongoing progressive refactor to improve error
messages and failure handling in the keyingframing code.

Pull Request: https://projects.blender.org/blender/blender/pulls/121517
2024-05-07 15:06:57 +02:00
Clément Foucault
87d164c56b EEVEE-Next: Improve shadow tracing
The goal of this PR is to remove the per face, NDC space
tracing for shadow maps.

This requires custom occluder extrapolation but in return
removes quite a lot of complexity in other areas, namely:
- No more per face transform before the tracing
- No more per face jittering (fix #119565)
- No more frustum padding (increased maximum precision)
- Better use of 32bit precision shadow map
- Fix #121343

This improve softness at relatively low step count (default 6
is better) and reduces light leaking at very low sample
count (sharper). It makes it more intuitive now that
higher sample count is smoother.

Pull Request: https://projects.blender.org/blender/blender/pulls/121317
2024-05-07 14:52:47 +02:00
Sybren A. Stüvel
18cccafeaf Refactor: Lattice deform: prevent incrementing nullptr
The lattice deform code would always call `co += 3` in a loop, even when
co is `nullptr`. This is invoking undefined behaviour, and causes UBSAN
warnings.

Pull Request: https://projects.blender.org/blender/blender/pulls/121396
2024-05-07 14:23:27 +02:00
Campbell Barton
9a5366cf8e UI: increase precision of the camera's focus distance
For metric units the depth was being rounded to the nearest meter
(in the range of 10-100 meters), increase the precision from 2 to 4
so it's possible to see centimeter precision.
2024-05-07 22:17:21 +10:00
Attila Áfra
26c93c8359 Cycles: Enable OIDN 2.3 lazy device module loading
This enables the new lazy module loading behavior introduced in OIDN 2.3,
without breaking compatibility with older versions of OIDN (using separate
code paths).

Also, the detection of OIDN support for devices is now much cleaner, and
devices do not need to be matched by PCI address or device name anymore.

Pull Request: https://projects.blender.org/blender/blender/pulls/121362
2024-05-07 14:07:39 +02:00
Richard Antalik
afa828ffca VSE: Various refactorings
These changes are not very useful on their own, but committed in order
to make PR #109522 easier to review
2024-05-07 13:37:16 +02:00
Richard Antalik
b062980318 Cleanup: Refactor VSE handle drawing code
Split handle rectangle and handle position text drawing to separate
functions.
2024-05-07 13:37:16 +02:00
Clément Foucault
d97e22f2cd Fix: EEVEE-Next: Missing world diffuse lighting
Caused by c99e7519c4

Missed the initial `local_radiance` value.
2024-05-07 12:53:28 +02:00
Aras Pranckevicius
6efa5c16ab Mesh: speedup BKE_mesh_validate
BKE_mesh_validate is called by mesh.validate() Python API, as well as optionally
when doing file imports. This PR speeds it up a bit:
- Faster face data sorting by using parallel sort instead of qsort,
- One allocation for all face vertex indices, instead of a separate allocation
  for each face,
- (more like a fix) Validation no longer adds a MDeformVert layer when there was
  none in the input mesh.
- Small cleanups (more const inputs, etc.)

On my Windows/VS2022/Ryzen5950X machine, import time in seconds (validation on
before this PR -> validation on with this PR, validation off):
- USD (Intel Moore Lane): 9.1 -> 6.7, 4.8.
- OBJ (Blender 3.0 splash): 22.7 -> 18.6, 16.5.

Pull Request: https://projects.blender.org/blender/blender/pulls/121413
2024-05-07 12:29:32 +02:00
Jacques Lucke
89a1a2cd7e Fix #121458: crash when using layout panels in operator ui
The same fix is used in e.g. `wm_block_dialog_create`.
2024-05-07 12:01:11 +02:00
Jacques Lucke
96db947f16 Geometry Nodes: show info in simulation node when it is baked
This adds the same overlay that already exists for the bake node to the simulation output node.
Without this, it's quite hard to see if the simulation zone is baked or not currently.

Pull Request: https://projects.blender.org/blender/blender/pulls/121497
2024-05-07 11:35:03 +02:00
Pratik Borhade
8d8d358196 GPv3: Replace active_layer with active_node
This was discussed in #121390 for further selection support of
layer groups.

Pull Request: https://projects.blender.org/blender/blender/pulls/121475
2024-05-07 11:26:33 +02:00
Jacques Lucke
5f02eaae9f Geometry Nodes: use aligned sockets in bake node
This aligns the corresponding input and output sockets in the Bake node.
A similar change has been done for simulation and repeat zones before in #118335.

Pull Request: https://projects.blender.org/blender/blender/pulls/121496
2024-05-07 11:23:23 +02:00
YimingWu
504c233d19 Fix #121485: Add EEVEE legacy in light influence panel
While options are moved in 0c50ec866f, these influence values are not
assigned to EEVEE legacy in the influence panel, now fixed.

Pull Request: https://projects.blender.org/blender/blender/pulls/121510
2024-05-07 11:22:40 +02:00
Christoph Lendenfeld
afe13175da Anim: run bezier handle calculation in parallel
Bezier handles are recalculated in many places in the
animation code. Threading that code can give a performance
boost  all over Blender.
This patch only threads a part of the handle calculation code.
`BKE_nurb_handle_smooth_fcurve` can still be run in parallel,
but that's more complicated, so not done in this PR.

Overall this patch mostly benefits code paths that are not already threaded.

------

Performance delta

| Action | Before | After |
| - | - | - |
| `recalcData_graphedit` moving a single key | 1.06 ms | 1.0 ms |
| `recalcData_graphedit` moving 300 keys of a single FCurve | 1.6 ms | 1.4 ms |
| `recalcData_graphedit` moving 300 keys of multiple FCurves | 60 ms | 55 ms |
| `ANIM_animdata_update` when using the Breakdown operator in the GE | 90 ms | 73 ms |

Test file used
https://download.blender.org/ftp/sybren/animation-rigging/heavy_mocap_test.blend

Pull Request: https://projects.blender.org/blender/blender/pulls/119388
2024-05-07 10:42:53 +02:00
Campbell Barton
7456d716f4 Fix #120811: Loop cut crash with symmetry enabled
Resolve regression introduced in [0].

[0]: 7f1b70ac50
2024-05-07 17:02:03 +10:00
Campbell Barton
45fe1dcdf2 cppcheck: exclude file that hangs for hours 2024-05-07 13:07:04 +10:00
Campbell Barton
aa03383838 Cleanup: resolve cppcheck funcArgNamesDifferent warnings in blenlib 2024-05-07 13:07:02 +10:00
Campbell Barton
1838499f55 Cleanup: suppress unassignedVariable warning with cppcheck
While not an error this has the minor benefit of simplifying the macro.
2024-05-07 12:59:21 +10:00
Campbell Barton
74a59076d8 Cleanup: spelling in comments, use doxy-sections 2024-05-07 12:59:13 +10:00
Campbell Barton
eda129a768 Cleanup: quiet parentheses warning 2024-05-07 12:59:12 +10:00
Iliya Katueshenock
4e3af58885 Cleanup: Avoid unnecessary copies of VArray
Cleanup to avoid unnecessary copies of VArray. This
requires ref-qualifier overloads of dereference operator
of attribute reader and some move operators and constructor
overloads in the code.

Pull Request: https://projects.blender.org/blender/blender/pulls/118437
2024-05-07 04:02:17 +02:00
Hans Goudey
32bfe448bc Cleanup: Remove unused data-block previews function
This was added 17 years ago, and the last uses were removed
3 and 9 years ago.
2024-05-06 21:10:00 -04:00
Sean Kim
d584cdbb8a Fix #121341: Add pbvh null check when destroying attribute
This PR fixes #121341 by adding a null check for the PBVH.

Pull Request: https://projects.blender.org/blender/blender/pulls/121418
2024-05-07 00:51:48 +02:00
Iliya Katueshenock
620c9a03c0 Fix: Geometry Nodes: Matrix type in Switch node
Missed static type in Switch node for fields.

Pull Request: https://projects.blender.org/blender/blender/pulls/121450
2024-05-07 00:30:21 +02:00
Hans Goudey
88b4498b32 Cleanup: Miscellaneous cleanups to workspace status items
- Remove meaningless const for by-value arguments in declarations
- Use std::move for strings (otherwise StringRef should be used)
- Move struct to C++ namespace
- Avoid unnecessary namespace specification
- Use static constexpr instead of macros
- Add const for other arguments in function definitions
- Avoid copying struct in for loop
- Remove redundnat "private" in class
2024-05-06 18:20:43 -04:00
Harley Acheson
44606c5e4d UI: Status Bar While Menus Are Open
While menus are open display a nicer status in the Status Bar, whether
spacebar search or type to search.

Pull Request: https://projects.blender.org/blender/blender/pulls/121502
2024-05-07 00:19:01 +02:00
Harley Acheson
c4e5a70e07 UI: Optional Complex Layout for Workspace Status
Optionally allow complex layout instead of just plain text when using
ED_workspace_status_text.

Pull Request: https://projects.blender.org/blender/blender/pulls/120595
2024-05-06 23:52:37 +02:00
Hans Goudey
42210342ca Cleanup: Remove outdated references to UV_SCULPT
See e3894f0a07
2024-05-06 17:44:51 -04:00
Sean Kim
80092fe1e0 Fix: Crash when showing all multires grid elements
This PR fixes the ternary operation to avoid indexing into a cleared
`BitGroupVector`when trying to create an `IndexMask` for a mesh
with no hidden elements.

Pull Request: https://projects.blender.org/blender/blender/pulls/121461
2024-05-06 23:04:35 +02:00
Jacques Lucke
69625494ad Cleanup: add missing includes 2024-05-06 19:52:45 +02:00
Brecht Van Lommel
794df958f6 Build: Explicitly specify Homebrew Bison path on macOS for libs
To avoid using the too old system version.
2024-05-06 19:09:45 +02:00
Iliya Katueshenock
968b98be56 Geometry Nodes: new Input Rotation node
This adds a new node input node for a constant rotation.
Similar nodes exist for vector, integer, boolean, etc. already.

Pull Request: https://projects.blender.org/blender/blender/pulls/120345
2024-05-06 19:04:30 +02:00
Attila Áfra
2a0a6f18cc Cycles: Add OpenImageDenoise quality option
This adds a new "Quality" option for OIDN to switch between the existing
"High" and "Balanced" modes and the new "Fast" mode introduced in OIDN 2.3.

Pull Request: https://projects.blender.org/blender/blender/pulls/121374
2024-05-06 18:56:16 +02:00
Richard Antalik
69472c88ee IMB: Cleanup timecode options
Remove options that are duplicate and change description of options, so
they describe bit better, how timecodes are actually used.

Timecodes in Blender have pretty much nothing in common with more widely
known term "timecode". This confused users (and developers).
There were 5 options of which 3 were exactly same. This commit leaves
user with 3 options:
 - Use timecodes for normal seeking/playback - Record Run
 - Ensure, that no frame is duplicated or skipped - "Record Run No Gaps"
 - Do not use timecodes - "None"

More verbose description was added to the definition in code.

Naming of these timecode types was kept, even if it is incorrect to not
break scripts and habits.

Pull Request: https://projects.blender.org/blender/blender/pulls/121001
2024-05-06 17:56:56 +02:00
Guillermo Venegas
89c1f7e0c3 IO: Use file handler in space VSE
Uses `FileHandlers` to handle file drag-n-drop in the space Sequencer, drop-boxes
still remain since they handle Images ID drag-n-drop.

This also allows to open/drag-n-drop multiple files at once.

When drag-and-drop is performed with a single image/movie/sound
file and only the internal `FileHandler` can be used, is used
the internal drop-box api for drag and drop, since it has a nice
drag-and-drop preview.

Pull Request: https://projects.blender.org/blender/blender/pulls/119927
2024-05-06 17:44:50 +02:00
Raul Fernandez
27c1618c5d Fix #94631: Multires: Duplicating objects sets the viewport level to sculpt level
Fixes duplicating objects sets the viewport level to sculpt level.

Self explanatory fix.

Pull Request: https://projects.blender.org/blender/blender/pulls/121429
2024-05-06 17:34:52 +02:00
Iliya Katueshenock
8249c09f3a Geometry Nodes: add implicit input for Instance Transform
`instance_transform` is the basic transformation attribute of instances.
This will be used in separate patches.

Pull Request: https://projects.blender.org/blender/blender/pulls/120340
2024-05-06 17:22:24 +02:00
Julian Eisel
05e9d95e52 Fix 121488: Crash when splitting editor with asset shelf open
Mistake in a6ebfb05ad, enabled catalog list shouldn't be free'd, it just
needs to be overridden by the duplicated list correctly. Earlier a clear
(but not a free) was necessary, but now it's overridden anyway so no
clearing is needed.
2024-05-06 17:08:38 +02:00
Brecht Van Lommel
3aa00e14e4 Build: Use CMake for sndfile deps building on all platforms
Resolves issues finding opus, and makes Linux and macOS match
Windows more closely.

Pull Request: https://projects.blender.org/blender/blender/pulls/121401
2024-05-06 17:06:38 +02:00