Commit Graph

101269 Commits

Author SHA1 Message Date
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
Campbell Barton
d594954bf2 Cleanup: use C++ compatible struct declarations for Python API
Also add m_base & ob_base comments.
2023-07-16 18:13:15 +10:00
Campbell Barton
ee5501750c Cleanup: quiet shadow warnings 2023-07-16 16:43:48 +10:00
Campbell Barton
d82322f616 Cleanup: spelling in comments 2023-07-16 15:50:02 +10:00
Hans Goudey
111e378366 Revert "Fix #109236: Split Edges node skips loose edges"
This reverts commit b226c115e2.

Fixes #110005.

I have been working on a fix branch, but the problem was fairly
fundamental to the algorithm and the fix ended up being a rewrite
that I didn't quite finish yet, and I will be away next week. Since
the other bug is a crash rather than a change in behavior, better to
have the other bug than this one in the meantime.
2023-07-16 00:08:23 -04:00
Iliya Katueshenock
3a3886953b Cleanup: Prepare versioning_250.c to move on C++
To move this file on C++, a lot of changes have to be done.
To avoid adding a lot of long cast operator in loops, and make too
much changes, this usually replaced by using macros.
This is a non-trivial change and done as a separate cleanup.
See: #103343.

Pull Request: https://projects.blender.org/blender/blender/pulls/109801
2023-07-16 05:31:08 +02:00
Joseph Eagar
a1a08610b6 Paint: Fix drawing delay bug with paint modes
The paint code doesn't invoke `stroke->redraw`
on `INBETWEEN_MOUSEMOVE` events.  This causes
drawing lag on devices that tends to generate
more of them, like pen tablets.

The code no longer does this.  It does still exclude
inbetween events for updating the paint cursor.

I checked, and only the two paint modes (3d texture paint and image paint) actually
use `stroke->redraw`.  Both are implemented to only draw when necessary:

* `paint_2d_redraw` checks for `.need_redraw` flag on tiles.
* `paint_proj_redraw` checks `ProjStrokeHandle.need_redraw`.

I believe this may be the cause of #93796

Pull Request: https://projects.blender.org/blender/blender/pulls/110119
2023-07-15 20:34:41 +02:00
Clément Foucault
3478093183 GHOST: Bump OpenGL minimum version to 4.3
This removes the GL 3.3 fallback because default viewport engine
now require some features only present in GL 4.3.
Blender now also check for GL version 4.6 instead of 4.5 in some
cases.

Note that this does not remove the OpenGL support on Apple
hardware.

Pull Request: https://projects.blender.org/blender/blender/pulls/109390
2023-07-15 15:31:40 +02:00
Jacques Lucke
35e398ae7a Cleanup: more consistent variable names
The term "state" was used in an earlier version of the code.
2023-07-15 15:07:01 +02:00
Jacques Lucke
831f40bf4a Fix: nested node group ids not stable when grouping/ungrouping
The old code accidentally relied on the random number generator
always producing the same sequence. This was fixed by
22b98a1a55 but made the
underlying bugs more visible.
2023-07-15 15:05:07 +02:00
Campbell Barton
87fc14e52d Fix UV pin invert being used for P/Alt-P shortcuts
Running "Invert Pins" stored the invert option when setting/clearing
pins afterwards.
2023-07-15 16:23:24 +10:00
Campbell Barton
68fbdda77f UI: remove recently added PIE progress display type
PIE was too similar to RING, as there is no need for two similar display
styles - make only one available.

Removal based on replies to !109882.
2023-07-15 16:14:10 +10:00
Campbell Barton
3889baab4f Cleanup: spelling in comments 2023-07-15 15:54:55 +10:00
Campbell Barton
cf95198491 Cleanup: remove static WindowStateGlobal struct in wm_playanim.c
Make this part of the PlayState.
2023-07-15 15:54:45 +10:00
Campbell Barton
f957a6da22 Cleanup: compiler warnings (unused functions & variable) 2023-07-15 15:45:03 +10:00
Hans Goudey
5a86705d4c Cleanup: Move ED_curves.h to C++
See #103343

Pull Request: https://projects.blender.org/blender/blender/pulls/110115
2023-07-15 03:44:58 +02:00
Clément Foucault
d8e4fe3207 EEVEE-Next: Add back fresnel functions 2023-07-14 19:03:08 +02:00
Miguel Pozo
1a24b5f81f EEVEE Next: Hair & Curves
Finalize the hair & curves implementation for EEVEE Next.

- Ensure Hair particles have their own `ResourceHandle` and
  `ObjectKey`, so Motion Blur works correctly.
  (Note that the `ObjectHandle` and the `ObjectKey` are always created
  "on the fly" instead of being stored as `DrawData`, since it's not
  supported for particle system `ID`s).
- The (unused) `ObjectKey::use_particle_hair` has been replaced by an
  integer `sub_key`, so multiple particle systems per object can be
  supported.
- `VelocityModule::step_object_sync` now has 2 extra optional
  parameters for syncing Hair particle systems.
- Update `DRW_curves_update` so it's safe to call it from "Next"
  engines.
- Disable the `sampling.reset()` call from `step_object_sync`, since
  `is_deform` is always true for objects with particle modifiers, and
  this causes the renderer to get stuck at sample 1.

Pull Request: https://projects.blender.org/blender/blender/pulls/109833
2023-07-14 18:23:26 +02:00
Miguel Pozo
e48d0c3cda EEVEE Next: Point Clouds
Add support for point cloud rendering in EEVEE Next.

Update `point_cloud_sub_pass_setup` to retrieve texture based
attributes, since that's the way they're actually meant to be used.

Pull Request: https://projects.blender.org/blender/blender/pulls/109832
2023-07-14 17:23:29 +02:00
Joseph Eagar
9175d9b7c2 Fix: Removing layer in BMesh can destroy others
CustomData_bmesh_copy_data_exclude_by_type was excessively optimized.
It only worked if the ordering (by name) of the attributes in both
customdata sets were the same.

Note that a blender::Set is used (with 32 slots of static storage)
to keep track of uninitialized destination layers.

Alternatives include:
  * Storing a bitflag in CustomDataLayer.flag
  * Using a static bool vector instead.

I don't especially care how it's done, pick one.

Pull Request: https://projects.blender.org/blender/blender/pulls/108683
2023-07-14 17:12:49 +02:00
Hans Goudey
2c1a7d6960 Cleanup: Make format 2023-07-14 10:46:37 -04:00
Hans Goudey
d74b984467 Fix #110107: Subdivide curves crash with empty input 2023-07-14 10:46:31 -04:00
Joseph Eagar
a75b7e1551 Sculpt: Split paint_vertex.cc into paint_weight.cc
Functions shared between the two now live in a new `blender::editors::vwpaint` namespace.

Pull Request: https://projects.blender.org/blender/blender/pulls/109996
2023-07-14 16:31:17 +02:00
Campbell Barton
b85c7ade70 Cleanup: make ButterworthCoefficients a private struct
As the coefficient members are specific to the implementation,
there is no need for the struct to be public.
2023-07-14 22:33:58 +10:00
Iliya Katueshenock
c38a52885b Fix #110037: uninitialized result array and typos
Regression introduced in 2cfcb8b0b8.

Pull Request: https://projects.blender.org/blender/blender/pulls/110098
2023-07-14 14:08:17 +02:00
Clément Foucault
93d2a202b2 DRW: Fix wrong integer type for drw_view_id 2023-07-14 12:32:03 +02:00
Sietse Brouwer
0a2d4289c0 Fix #109986: Crash when using GP grab tool on object with Subdivide modifier
The grab tool could crash when applied to a Grease Pencil object with a
Subdivide modifier (or any other modifier that changes the number of
points in strokes). This patch prevents the grab tool from crashing.

- Removed a grab tool exception that was no longer necessary.
- Added a missing null check.

Pull Request: https://projects.blender.org/blender/blender/pulls/110078
2023-07-14 12:16:43 +02:00
Jeroen Bakker
03ead30027 Eevee-next: Reflective Light Baking
This PR introduces baking reflective light from light probes. Light probes
are baked on the fly when the light probe data has changed. It doesn't update
directly when other scene data is changed in the viewport.

When doing image rendering the light probes are updated on each frame.

Currently the world probe and closest reflection probe are composited
together in shader. This allows different resolutions. We expect that we
eventually composite it before usage. This would improve the performance.
Unclear if we would support both compositing options eventually.

Pull Request: https://projects.blender.org/blender/blender/pulls/109909
2023-07-14 11:22:18 +02:00