Commit Graph

97663 Commits

Author SHA1 Message Date
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
Clément Foucault
a1faf4d678 Metal: Address some mixed integer type warnings 2023-07-14 11:09:46 +02:00
Campbell Barton
32fb40fa76 Cleanup: use function style casts for C++ 2023-07-14 12:31:00 +10:00
Iliya Katueshenock
962e4c3056 Fix #110083: Fix incorrect initialization of bounds max
See: https://en.cppreference.com/w/cpp/types/numeric_limits

Pull Request: https://projects.blender.org/blender/blender/pulls/110084
2023-07-14 03:16:05 +02:00
Joseph Eagar
474b492b38 Sculpt: versioning fix
Moved versioning code back to BKE_sculpt_toolsettings_data_ensure.

Pull Request: https://projects.blender.org/blender/blender/pulls/110081
2023-07-14 00:52:21 +02:00
Joseph Eagar
6220bfe31d Sculpt: Fix memory leak
Reverted blo_update_defaults_scene to simply load the default
Sculpt.flags.
2023-07-13 13:30:38 -07:00
Joseph Eagar
d70b36faed Sculpt: Implement proper versioning code for Sculpt struct
The old Sculpt initialization code did double duty
as versioning code.  This commit implements proper
versioning logic in versioning_400.cc; the existence
of the default fields are checked in DNA and if they
don't exist they're initialized.  This is similar to
how the old code checked if the fields were zero.
2023-07-13 11:06:43 -07:00
Joseph Eagar
27974faa57 Sculpt: Use DNA default system for Sculpt struct 2023-07-13 10:48:49 -07:00
Brecht Van Lommel
7551767f9f USD: more complete import and export of lights
* Exposure import
* Diffuse factor support
* Correct disk radius
* Better non-normalized intensity import
* Sun radius export

Pull Request: https://projects.blender.org/blender/blender/pulls/109929
2023-07-13 19:14:04 +02:00
Falk David
f2f0426980 GPv3: Refactor root_group to be a pointer in DNA
This turns the embedded group into a pointer.

Note: Older files will not load the grease pencil v3 object properly after this.
The objects will not have any layers in them.

Pull Request: https://projects.blender.org/blender/blender/pulls/110007
2023-07-13 18:24:19 +02:00
Jacques Lucke
3a2f5fb9db Editors: move transform code to C++
Also see #103343.

Co-authored-by: Germano Cavalcante <germano.costa@ig.com.br>
Pull Request: https://projects.blender.org/blender/blender/pulls/110049
2023-07-13 17:59:52 +02:00
Nate Rupsis
10428bd2b4 Fix #109787: filter out non Fcurve channels from nlatrack_truncate_temporary_tracks
## Overview

Adding ANIMFILTER_FCURVESONLY  filter to  nlatrack_truncate_temporary_tracks to fix index out of bounds crash.

Pull Request: https://projects.blender.org/blender/blender/pulls/110032
2023-07-13 16:09:57 +02:00
Falk David
7cf8bfd2a0 GPv3: Draw paint cursor 2023-07-13 15:58:16 +02:00
Christoph Lendenfeld
39cc72ea25 Fix: Stepping issue with Butterworth filter
The same issue for Smooth (Gaussian) which was reported in #109799 also affects the Butterworth filter.
When keys were not exactly on the frame, but offset even by minimal values the filter would introduce stepping.
Fix it by using `round()` instead of `(int)` when calculating the index to the filtered values array

Pull Request: https://projects.blender.org/blender/blender/pulls/110060
2023-07-13 15:47:29 +02:00
Christoph Lendenfeld
2e246e355e Fix #109799: Smooth (Gaussian) introduces stepping
When keys were not perfectly on the frame, the index logic
would fail and duplicate data across 2 frames.
Using `round()` solves this. It does not add subframe support though.

Pull Request: https://projects.blender.org/blender/blender/pulls/110059
2023-07-13 15:37:46 +02:00
Sergey Sharybin
cbdb04d88b Refactor: Move external engine to C++
Pull Request: https://projects.blender.org/blender/blender/pulls/110046
2023-07-13 14:39:32 +02:00