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.
Remove both compute barriers and useResource calls
as explicit resources bound via setTexture and
setComputeBuffer are implicitly tracked by the Metal
API anyway, so these calls increase complexity, without
altering correctness
Authored by Apple: Michael Parkin-White
Pull Request: https://projects.blender.org/blender/blender/pulls/121598
This patches optimizes the Fog Glow Glare node to be about 25x faster
for 4K images. This is mainly achieved by utilizing the FFTW library and
multi-threading support code. Further improvements are still possible by
caching kernels, but the CPU compositor does not support caching yet.
The old Hartley transform was removed, so the node no longer works when
FFTW is disabled as a build time option, much like the OIDN node. A new
BLI library was introduced for FFTW, it includes some helper routines
relevant for FFTW as well as an initialization routine that sets up
multithreading using TBB as well as thread safety.
Build system support for threaded FFTW was also added, which defines the
relevant variables to detect threading support as well as add the
relevant libraries.
We do not currently have the threaded FFTW libs in our precompiled libs,
so the threading code is disabled until the libs lands in the coming
weeks. So currently, the code is only about 9x faster.
The only functional change is that the kernel is now odd sized, which
should produce more accurate results, but the final result is almost
identical and mostly undetectable.
The plan is to port this to the GPU as well similar to how we implement
OIDN until we have a GPU FFT implementation. GPU compositor can also do
caching, so it should be faster, being able to compute a 4K image in
under half a second.
Pull Request: https://projects.blender.org/blender/blender/pulls/121653
When drawing hair/curves the material shader has a "a" texture slot,
but this slot was never bound to a texture. This PR fixes this by
adding a default texture to it and when available tries to bind
CD_AUTO_FROM_NAME resources.
This part seems to be not implemented when the new curve rendering
was added. `CD_AUTO_FROM_NAME` was never considered and therefore the
layer could not be found and the sampler could not be found.
Fixes#115460
Pull Request: https://projects.blender.org/blender/blender/pulls/121064
The bias was cutting the wrong end of the distribution,
making the result noisier than it should and missing
rays in the center.
This also increases the bias a bit more to reduce
noise.
This required making a whole bunch of other functions in the call chain
take const parameters as well. It also required changing some function
pointers in some types to take const parameters, which in turn required
changing all the functions that are pointed to by those function
pointers to take const parameters as well.
Additionally, there was one mutable usage of the `FModifier *` parameter
in `fcm_cycles_time()` that had to be removed to make the call chain
const. However, this turned out to be a code path that shouldn't be
reachable, and would represent a bug elsewhere. So it was changed to
an assert.
All in all, the non-constness was deep and tangled.
There's still a lot more that we can make const, but I wanted to keep
this change as narrow and focused as possible.
Code used to tag liboverrides references as 'pre-existing' to force code
further down the way to always keep these IDs linked.
However, this was a (bad) hack, since it could have uncontrollable
side-effects, abusing a tag for somethig else than its original meaning.
And this should not have been needed for quite some time already, as
liboverrides handling was already properly done by append
post-processing code.
No behavior change expected here.
In a nutshell, the handling of dependencies in the 'append' part of the
code was not fully correct, and could break badly in some complex cases
(like appending complex hierarchies of data partially re-using some
dependencies from other previously appended data).
This could lead to e.g. some linked data referencing some local IDs...
straight way to crash in undo case (among many other problems).
Previous code was fairly compact and tried to be smart and efficient,
making some not-always-correct assumptions, and being quite hard to
fully understand.
So the first step of this fix was some refactoring:
* Splitting the post-process part of the 'link' case into its own
function (it is fairly trivial, and while it does duplicate some
logic to some extent, it makes the overall link/append process
clearer).
* Heavily refactoring the part of the 'append' code that decides how
to handle each linked ID.
The append-related post-processing is now significantly more complex,
but hopefully better divided in reasonably logical steps. And it is now
expected to deal with complex re-usability cases properly.
Pull Request: https://projects.blender.org/blender/blender/pulls/121867
Add-ons which were enabled but not found warn on startup
and were shown under "Missing scripts", where they can be ignored
(the user can choose to restore the paths) or disabled them to suppress
the warnings in future.
This is now available again, with a minor refactor.