Commit Graph

101296 Commits

Author SHA1 Message Date
Sergey Sharybin
29d9d00a14 Cleanup: Use C++ style struct definition 2023-07-19 12:12:07 +02:00
Sergey Sharybin
bd7c137ac9 Cleanup: Better comments in the RE_engine_draw_acquire() 2023-07-19 12:12:07 +02:00
Falk David
2e3813f02c IndexMask: Add unoptimized from_union function
This adds a `IndexMask::from_union(...)` function. This is not very optimized, but shouldn't perform too terribly either.

Pull Request: https://projects.blender.org/blender/blender/pulls/110241
2023-07-19 10:45:13 +02:00
Campbell Barton
2877d65ccc Fix error in pop menu key accelerators from recent commit
Correct error in own fix [0] popovers (F9-redo) were handled the same
as popup menus. `F4,P` wasn't opening the preferences as it used to.
Resolve by checking if the parent was a menu.

[0]: c3bf00cd2d
2023-07-19 18:10:17 +10:00
Jeroen Bakker
56f0f4b2a5 Fix: World Light Direction in Irradiance Cache
The world light direction in the irradiance cache was inverted due
to misunderstanding of a code review comment. This PR fixes this
so the captured light from a direction is stored in the SH correctly.

Pull Request: https://projects.blender.org/blender/blender/pulls/110258
2023-07-19 09:20:02 +02:00
Campbell Barton
c3bf00cd2d Fix #107838: accelerator keys fail in enums/menus spawned from popups
Enum popups don't set an active button so accelerator keys didn't work.
Always use accelerator keys in popups because these are typically
launched from non-menus (the redo popup for e.g.) where it doesn't
make sense to pass the event to the parent.
2023-07-19 11:26:58 +10:00
Jason Fielder
a8c29fb221 EEVEE Next: Ensure correct resource usage flags for Metal
Shader write must be correctly specified where required for
shaders which perform direct image and buffer writing operations.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/110219
2023-07-18 19:18:33 +02:00
Omar Emara
5be226699f Fix #109676: GPU compositor crashes on muting output nodes
The Realtime GPU compositor crashes when muting output or viewer nodes.

This happens because output nodes are scheduled regardless of their
muted statued, however, the initial reference count takes the muted
status into account, resulting in a use after free error, hence the
crash.

To fix this, we simply do not schedule muted output nodes.
2023-07-18 19:12:56 +03:00
YimingWu
93c27bf958 Fix #110176: Grey out "Flip" in mirror modifier when "Bisect" is off
"Flip" option in mirror modifier is only effective for when "Bisect" is
enabled, thus grey out the flip option when it's ineffective to avoid
confusion on the user interface.

Pull Request: https://projects.blender.org/blender/blender/pulls/110191
2023-07-18 15:49:14 +02:00
Alexander Gavrilov
4d0dbab5b1 Mesh Edit: implement X symmetry in the Propagate To Shapes operator.
Since the operator affects shape keys rather than current mesh
coordinates, this only symmetrizes the selection.

Pull Request #105421
2023-07-18 16:42:55 +03:00
Alexander Gavrilov
0bd95dd963 Mesh Edit: implement X symmetry in the Blend From Shape operator.
This symmetrizes selection and vertex positions like any other operator.

Pull Request #105421
2023-07-18 16:42:55 +03:00
Alexander Gavrilov
d32748cdf4 Shape Key editing: propagate updates through basis chains.
It is possible to organize shape keys into a tree through the
reference key setting. Mesh editing and sculpting a reference
key is supposed to update all its children, but this was only
done for one level of dependencies.

This changes the code to retrieve the complete set of dependent
keys and update them all.
2023-07-18 16:30:51 +03:00
Miguel Pozo
548ff9dc8d Cleanup: EEVEE Next: Clarify sampling rng functions usage
Pull Request: https://projects.blender.org/blender/blender/pulls/110221
2023-07-18 15:23:50 +02:00
Colin Marmond
1c8f04f214 Fix #110155: Hiding entire overlay does not hide node previews
Pull Request: https://projects.blender.org/blender/blender/pulls/110163
2023-07-18 15:07:15 +02:00
Philipp Oeser
c275f4219f Fix #110204: Anim Player draws non-uniformly scaled when resizing window
Caused by fd3e44492e.

Images were drawn filling the entire window, now use available size/
offset inside the window and pass these as `rctf` to
`draw_display_buffer`.

Should be good for 3.6/3.3 LTS

Pull Request: https://projects.blender.org/blender/blender/pulls/110206
2023-07-18 14:10:11 +02:00
Falk David
280ff8284f Fix: Compiler error on macOS
Use `math::max` instead of `std::max`.
2023-07-18 13:08:36 +02:00
Falk David
0c8c3f091d Fix: Compiler error
The file `ED_curves.h` no longer exists and is now `ED_curves.hh`.
2023-07-18 12:02:51 +02:00
Jeroen Bakker
d82cbcaa96 Fix: Eevee-next world only probe didn't update
When scenes only have a world probe the world probe had several
artifacts.

- The first sample didn't update the world.
- When switching between viewports the world didn't get updates
- When rendering it ignored the resolution that was set by the user

The reason was that the ubo was only updated when the probes where
synced. This PR adds an exception to also update when there is only
the world probe.

Pull Request: https://projects.blender.org/blender/blender/pulls/110238
2023-07-18 11:58:00 +02:00
Amelie
d9277b19f3 GPv3: Stroke smoothing operator
Implementation of the smoothing operator for grease pencil strokes.
Works on `CurvesGeometry` position and other attributes, such as radius.

Based on the gaussian blur like algorithm in `BKE_gpencil_stroke_smooth_point` by Henrik Dick.

Pull Request: https://projects.blender.org/blender/blender/pulls/109635
2023-07-18 11:54:34 +02:00
Lukas Tönne
3e3133192a Nodes: Move node socket RNA definition into its own file.
This is a fairly verbose part of nodes RNA, which defines the base
NodeSocket and NodeSocketInterface types as well as all the subtypes
required for showing correct properties based on socket type.

The RNA for this part of nodes is quite self-contained, so moving it
to a separate files works well and reduces the overall size of
rna_nodetree.cc considerably (~1700 LoC). This does not include any
functional changes.

Moving this to a separate file will make it easier to improve the node
group interface (#109135).

Pull Request: https://projects.blender.org/blender/blender/pulls/110220
2023-07-18 11:17:31 +02:00
Martijn Versteegh
b199f10204 Fix #110164: Trigger spreadsheet redraw on animation pause
When playing and then pausing the animation the spreadsheet would show stale data,
not only during playback but also afterwards.

Pull Request: https://projects.blender.org/blender/blender/pulls/110224
2023-07-18 09:56:11 +02:00
Campbell Barton
7fe1f14116 BLI_linklist_stack: restore type safety without needing explicit casts
Add casts back into the macro (removed in [0]), removing the need for
them to be manually included, use `decltype(..)` for C++.

[0]: 129f78eee7
2023-07-18 17:22:09 +10:00
Jeroen Bakker
e9dbb68729 Fix: Eevee-next LOD selection
The LOD selection for reflection probes wasn't correct and would
select a noisier texture than required. This change will improve
the LOD selection making less noise in the rendered image.

Pull Request: https://projects.blender.org/blender/blender/pulls/110234
2023-07-18 09:21:40 +02:00
Campbell Barton
ac9f66e742 Cleanup: correct struct member comments 2023-07-18 14:34:59 +10:00
Campbell Barton
db345366fe Cleanup: struct member comments for DrawEngineType & RenderEngineType 2023-07-18 14:34:59 +10:00
Campbell Barton
17563e9a91 Cleanup: use C++ function style casts, NULL -> nullptr 2023-07-18 14:18:07 +10:00
Campbell Barton
29c2e71d1f Cleanup: quiet warnings 2023-07-18 14:18:06 +10:00
Ray Molenkamp
eec5c867d3 Cleanup: Make format 2023-07-17 13:00:30 -06:00
Colin Marmond
899f8a8500 Refactor: use ImBuf instead of a raw buffer for compositor previews
In order to better suit the upcoming changes of shader node previews, this
patch replaces the old implementation of the storage of the compositor
previews. It also prevents memory loss for future modification.

BKE_node_preview_clear_tree was removed as it is no longer needed and
will not be used by the new shader node previews.

Pull Request: https://projects.blender.org/blender/blender/pulls/110064
2023-07-17 20:13:52 +02:00
–kaspian.jakobssongmail.com
b767a62f32 Fix #109679: Normal Map node strength interpolation artifacts
Previously the normal strength linearly interpolated and extrapolated
the normal in world space. Instead do it in tangent space, in a way
that ensure the normal remains above the surface and valid.

Pull Request: https://projects.blender.org/blender/blender/pulls/109763
2023-07-17 20:06:41 +02:00
Harley Acheson
69cc84fa6c Cleanup: Make format
Removing unnecessary whitespace added with 1b1349cee4
2023-07-17 10:56:03 -07:00
Harley Acheson
1b1349cee4 UI: Indeterminate Button State
No user visible changes expected, the new button state is not used yet.

Setting a new uiBut drawflag shows items in an indeterminate state, not
indicating a specific value or state.

Pull Request: https://projects.blender.org/blender/blender/pulls/108210
2023-07-17 19:37:15 +02:00
Jason Fielder
3f99b6e71c EEVEE Next: Avoid out of bounds cryptomatte buf and image access
Resolves shader validation error in Metal backend for EEVEE Next.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/110215
2023-07-17 17:56:04 +02:00
Clément Foucault
9305778fb5 Fix: EEVEE-Next: bindpoint collision from Object 2023-07-17 16:46:16 +02:00
Falk David
ba1795ec81 GPv3: Add tagging drawing for topology change 2023-07-17 16:39:37 +02:00
Falk David
965a6bad3e Cleanup: GPv3: use strokes functions
This replaces `drawing->geometry.wrap()` with
`drawing.strokes()`.
2023-07-17 16:37:46 +02:00
Jeroen Bakker
5aff5bc0e7 Fix: Reflection Probe Memory Alignment
Introduced in recent commit (#110194) where the reflection probes are used as
ubos. Ubos have different memory requirements, but the struct
wasn't adjusted, resulting in incorrect renderings.

Pull Request: https://projects.blender.org/blender/blender/pulls/110202
2023-07-17 13:40:16 +02:00
crabs
48e8d8f910 Fix #109875: The tooltip in "File > New > General" is misleading
File > New> General tooltip is misleading, as explained in issue #109875
Changes the tooltip from the current "Open the default file (doesn't save the current file)" to simply "Open the default file".

It could be argued that the note is still valid for when people have Preferences > Save & Load > Save Prompt disabled, but we don't have a similar note in any of the other cases that open a different file.

Pull Request: https://projects.blender.org/blender/blender/pulls/110086
2023-07-17 11:52:31 +02:00
Damien Picard
f9669d0a11 I18n: make the string holding light cache messages longer
The `light_cache_info` string holds information about the outcome of
Eevee light cache baking. It is currently 64 bits, which is enough to
hold all possible messages in English. However, some messages need to
be longer than this in other languages, so the holding string also
needs to be longer. From what I can tell, 128 bytes is plenty enough.

Pull Request: https://projects.blender.org/blender/blender/pulls/110028
2023-07-17 11:46:03 +02:00
Philipp Oeser
ff0adf5b37 Cleanup: typo in variable name
Typo in ca1721270a.

have_non_onlydeform_modifiers_appled ->
have_non_onlydeform_modifiers_applied

Pull Request: https://projects.blender.org/blender/blender/pulls/110195
2023-07-17 11:40:08 +02:00
Julian Eisel
0fe2d5acb6 UI: Refactor calculations for grid view visible items optimization
No user visible changes expected.

Previously the calculations to skip building the layout for invisible
items used the scrolling offsets quite a bit. These values are managed
in code elsewhere, better to minimize such dependencies. Plus we can
rely less on floating point values, making code more simple & reliable.
2023-07-17 11:28:39 +02:00
Julian Eisel
e8187413cf Fix compiler error with WITH_BULLET disabled
Error after 129f78eee7.
2023-07-17 11:21:57 +02:00
Julian Eisel
93bb7cbd91 Fix compile error with WITH_OCEANSIM disabled 2023-07-17 11:12:55 +02:00
Jacques Lucke
129f78eee7 Blenkernel: move to C++
Also see #103343.

Couldn't move two files yet:
* `softbody.c`: The corresponding regression test fails. It seems like the
  conversion to C++ changes floating point accuracy, but it's not clear where that happens exactly.
* `writeffmpeg.c`: Is a bit more complex to convert because of the static array in `av_err2str`.

Pull Request: https://projects.blender.org/blender/blender/pulls/110182
2023-07-17 10:46:26 +02:00
Jeroen Bakker
ac1f015246 Eevee-next: Ensure Uniform Buffer for Reflection Probes
Our intent was that uniform buffers would have been used already. The
buffer was already marked as uniform buffer, but still was attached
as an SSBO leading to incorrect bindings.

Until now we didn't detect any artifacts, but it conflicted with
cryptomatte.

Pull Request: https://projects.blender.org/blender/blender/pulls/110194
2023-07-17 09:46:17 +02:00
Philipp Oeser
2cb9290012 Fix #110021: Deform modifier binding can go wrong in certain stacks
This affected `Mesh Deform`, `Corrective Smooth` and `Laplacian Smooth`.

Exposed by 57ea827bfb (e5ec04d73c).

Evaluating the incoming mesh can be different in
`BKE_object_handle_data_update` as opposed to
`object_force_modifier_update_for_bind` due to different
`CustomData_MeshMasks` being used (the former used a handpicked set, the
later was still using `CD_MASK_BAREMESH`). But since moving many
relevant [to modifiers] data to attributes, this could lead to binding go
wrong (e.g. reporting a vertex count mismatch as reported in #110021
which was due to the fact that creases were not propagated and that
changed the output [also vertex count] of a subdivision modifier in the
stack).

Now use `CD_MASK_DERIVEDMESH` in `object_force_modifier_update_for_bind`
to get all relevant attributes for evaluation (this is not used in `BKE_object_handle_data_update`
to avoid a big performance impact there).

Also fixes #109626 afaict.

Should probably go into 3.6 LTS (maybe even 3.3 LTS).

Pull Request: https://projects.blender.org/blender/blender/pulls/110095
2023-07-17 09:31:46 +02:00
Jeroen Bakker
bac6e81e57 Cleanup: Remove Compilation Warning Eevee Materials
Pull Request: https://projects.blender.org/blender/blender/pulls/110193
2023-07-17 07:50:25 +02:00
YimingWu
a04da965f6 Fix #110166: Prevent ourliner editing generic labels.
When trying to rename a generic label in the outliner, like the "Object"
category name inside library override properties view, `do_item_rename`
will crash because it failed to gurad type `TSE_GENERIC_LABEL`.
Now fixed.

Pull Request: https://projects.blender.org/blender/blender/pulls/110188
2023-07-17 04:47:27 +02:00
Ray Molenkamp
95367f732f Fix: Build error with MSVC
This reverts part of d594954bf2 as the MSVC preprocessor does not
enjoy nested `#if` statements inside macro parameters leading to
a build error.

Neither GCC nor MSVC is correct or wrong here as the C99 standard
has this to say on the subject:

"If there are sequences of preprocessing tokens within the list of
arguments that would otherwise act as preprocessing directives, the
behaviour is undefined"

source: C99 - 6.10.3.11 (Macro replacement)

Worth noting C++17 has identical language inside the cpp.replace
section of the standard.

Given this is undefined behaviour for both C99 and C++17, best not to
rely on it.
2023-07-16 11:29:50 -06:00
Campbell Barton
caf0024463 Cleanup: add degrees UTF8 symbol, prefer ascii over unicode in comments 2023-07-16 21:54:58 +10:00