Using a non-virtual derived struct for polymorphism is error prone,
especially combined with the requirements of DNA. Instead, use a
separately allocated runtime struct as done for many other DNA structs.
In a followup commit, the remaining runtime members of `PreviewImage`
could be moved to the new runtime struct.
Pull Request: https://projects.blender.org/blender/blender/pulls/121509
The Viewport Compositor only operates on part of the render when doing
viewport rendering when in camera view. That's because the code wrongly
assumed camera offset even when doing viewport renders, which do not
exist in that case.
The function was declared in a BKE header but defined in
the sculpt_paint editors module. Move it to the slightly-less
arbitrary ED_sculpt.hh header instead.
No functional changes.
- Remove unnecessary variable declarations.
- Declare wm & prefs at the function beginning
to prevent noisy patches in case they're used elsewhere in the future.
- Correct invalid comment.
- Don't store triangulation or triangle face indices in MeshRenderData.
This makes more automatic use of the lazy calculation and saves the
calculation of the face indices in some cases.
- Don't use the "extractor" abstraction for the triangle index buffer.
This is part of the ongoing transition described by #116901.
- Pass the "face sorted" data directly to the triangle index buffer
creation. That's the only place that needs it. This makes the
dependencies more explicit and might make better use of CPU cache.
Fix#121782
`GPencil` engine renders on the whole framebuffer.
If `Render region` is used, the result of GP rendering is scaled from whole
framebuffer down to the selected region.
The fix adds framebuffer viewport reset after rendering.
This resolves the problem for downstream consumers of
the framebuffer (e.g. `GPencil`).
The final result is somewhat similar to the `EEVEE Legacy`.
Now `EEVEE` rendering is done in the selected region, while `GPencil`
is rendered on whole viewport as before.
Pull Request: https://projects.blender.org/blender/blender/pulls/121979
BLF_str_offset_from_cursor_position is being called with a str_len of
INT_MAX, so max buffer size instead of string length. This works fine
right now but will not when this gets more complex. For example if we
need to call functions like BLI_str_cursor_step_next_utf8, which
assumes that str_len is the actual end of the string.
Pull Request: https://projects.blender.org/blender/blender/pulls/121966
Jittered Soft Shadows support.
Improves soft shadow quality at the cost of re-rendering shadow maps every sample.
Disabled by default in the viewport unless enabled in the Scene settings.
| Tracing-only | Jitter-only | Jitter+Over-blur |
| --- | --- | --- |
|  |  |  |
Tracing-only is the method used by default in EEVEE-Next.
Jitter-only is the method used by EEVEE-Legacy Soft Shadows.
Jitter+Over-blur combines both.
Co-authored by Miguel Pozo @pragma37 (initial patch #119753)
Pull Request: https://projects.blender.org/blender/blender/pulls/121836
This PR adds one more stat to `ScopedTimerAveraged` for quick timing checks:
the total number of samples.
Sample output:
```
Timer 'vert_hide_update': (Average: 45.93 ms, Min: 45.93 ms, Last: 45.93 ms, Samples: 1)
```
Pull Request: https://projects.blender.org/blender/blender/pulls/121638
Cursor is already set to invisible by the gizmo in `WIDGETGROUP_navigate_setup()`. Setting the cursor visibility again in the operator overwrites the desired behavior of gizmos.
Pull Request: https://projects.blender.org/blender/blender/pulls/121927
Previously there's a chance that if some intersection lines are chained
together, the chain type could become contour. That is an unexpected
behaviour. Now fixed.
The way line art writes to GPv3 is changed to use new CurvesGeometry,
but it didn't join newly created strokes with existing ones so the
output result was only from the last line art modifier. Now fixed.
Add a separate function that calculates text selection box positioning
given a string's selection start and end offsets. Moves this to a
better place and allows to have more complex boxes in future when we
might have multi-line and/or multi-directional text input.
Pull Request: https://projects.blender.org/blender/blender/pulls/121448
Use COM smart pointer (`ComPtr`) to simplify memory management in WASAPI driver.
This reduces chances of calling `Release()` when a COM object has not been allocated.
Pull Request: https://projects.blender.org/blender/blender/pulls/121828
This commit prevents considering Scenes (and a few other ID types, like
WindowManager or Library) as being part of liboverride hierarchies.
Having collections, objects, obdata etc. depend on a Scene ID is
typically not considered as a valid setup for linked data.
And in any case, Scenes are not officially supported for liboverrides
currently.
In the case of #121410, where a driver of the armature object was using
the Scene ID, it will simply keep that scene reference pointing to the
linked scene, instead of overriding the whole scene.
Code checking whether an ID should be considered as part of the
currently processed liboverride hierarchy or not was very similar all
over the liboverride code.
It is now deduplicated into two util functions, which helps ensuring
coherence in these checks, and future potential changes in this
filtering process.
NOTE: While no pratical changes are expected form user PoV with this
refactor, technically it does modifies the behavior in some cases (added
checks).
This is a bit of a hack hammer to solve a specific issue, but it is not
really clear to my currently why some of these tool settings get
invalid data.
On the other end, not sure that it would make any sense to consider
these 'runtime' data for liboverrides anyway.