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
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
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
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
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.
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.
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
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
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
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.
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
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
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
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
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
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.
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
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
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