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
As an important optimization, grid views skip items that are not in
view, and instead add empty space to the layout still has the right
dimensions (for scrolling). Calculations were off though, leading to the
last row being dropped when it had too few items to fill it completely.
When property is changed in dopesheet, it is not reflected in
layer block, add notifier in `anim_channels_defines.cc` to fix this.
Also redraw the dopesheet region when layer is added or removed.
Pull Request: https://projects.blender.org/blender/blender/pulls/110055
Implements the Butterworth Filter
(https://en.wikipedia.org/wiki/Butterworth_filter) for smoothing FCurves.
This filter is ideal for smoothing dense data, like motion capture recordings.
It has the advantage of keeping the shape of the curve
intact while reducing minimal fluctuations.
The disadvantage is the impulse response has a twang,
meaning extreme spikes cause fluctuations to either side.
The implementation is based on the GPL code found here:
https://exstrom.com/journal/sigproc/dsigproc.html
In order to avoid phase shifting, the filter is run forward and backward,
effectively doubling the filter order.
The Redo panel offers the following options
* Frequency Cutoff: 0-n value, where 0 means it cuts everything
so the curve will become straight, the max value is the Nyquist frequency
and depends on the frame rate and the "Samples per Frame" option
* Filter Order: Higher values mean the frequency cutoff is steeper
* Samples per Frame: Before the filter is applied, the curve is resampled
at this interval to avoid errors when there are uneven spaces between frames.
If the keys are on subframes, e.g. a 60fps file in a 30fps scene, increase this value to 2
* Blend: 0-1 value to blend between the original curve and the filter result
* Blend In/Out: The number of frames at the start and end for which
to blend between the filtered and unfiltered curve.
This can help reduce any resulting jumps in the animation at the selection border
The operator can be called from the Key menu. (Key->Smooth->Butterworth Smooth)
Pull Request: https://projects.blender.org/blender/blender/pulls/106952
A TaskPool is used to execute tasks in the backghround.
Whenever a new sound strip needs their waveform to be computed, it's
added as a task to the TaskPool.
Once the PreviewJob has submitted all available tasks to the task pool,
it waits for all of them to finish before exiting.
The TaskPool is configured to start tasks as soon as they are pushed
onto the task queue.
Authored-by: Lucas Tadeu Teixeira <lucas@lucastadeu.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/108877
bf_usd is a bit slow to build, and most time is spend on the front end
of the compiler parsing USD's headers.
this change enables pre-compiled headers for the most expensive
headers to parse.
When building `bf_usd` single threaded with -j1 (for accurate measurements)
```
before Wall time: 0h 4min 30sec 931 ms 504299 ns
after Wall time: 0h 0min 50sec 808 ms 24399 ns
```
Pull Request: https://projects.blender.org/blender/blender/pulls/110027
Allow SVG files to have previews in the File Browser. Adds
nanosvgrast.h to extern\nanosvg\, which is an SVG rasterizer that is
an optional part of the nanosvg source.
Pull Request: https://projects.blender.org/blender/blender/pulls/109567
Use modifier keys that are pressed before activating a new window.
Allows call of `wm_window_update_eventstate_modifiers` on
`GHOST_kEventWindowActivate` by using `GetAsyncKeyState` instead of
`GetKeyState` in GHOST_SystemWin32::getModifierKeys, which retrieves
actual hardware state.
Pull Request: https://projects.blender.org/blender/blender/pulls/110020
Code in charge of fixing invalid liboverride hierarchy roots would be
too agressive in re-assigning new root in replacement of old one. When
the invalid initial case was a 'low-level' type of ID (like a nodetree
e.g.), it could 'contaminate' many valid data (objects etc.) and force
them into its own local hierarchy.
This commit fixes the issue by storing all 'processed as valid' IDs into
a set, and ensuring that once an ID has been put into that set, its
hierarchy root is not changed anymore.
in other words, it changes the old behavior of 'last encountered hierarchy
wins' to 'first encountered hierarchy wins'. Since higher-level types of
IDs (like collections or objects) are processed first, this is the
most logical behavior too.
The comment implies that the operation is slow because it creates and
destroys a framebuffer.
Actually the slowness comes from forcing CPU-GPU synchronization.
Update VertexWeighEdit modifier Group Add / Remove threshold to be inclusive.
Additionally, add 3.6 backwards compatibility (4.0 versioning) to slightly offset Group Add / Remove threshold property value to make exclusive.
Pull Request: https://projects.blender.org/blender/blender/pulls/108286
In some cases we store temporary region data that doesn't require
freeing. Code shouldn't expect the data pointer to be unset in this
case, so don't print an error.
For drag-drop, drag node is first unlinked from existing position then
linked above or below the drop layer.
When drag and drop layers are same, layer is unlinked from listbase and
further linking fails because layer is not found in the listbase.
Pull Request: https://projects.blender.org/blender/blender/pulls/110009
NDOF Pan was calculating the selection center unnecessarily.
This was overlooked in 37d1d4cb07.
Getting the selection center is one of the heaviest operations during
navigation. Needs to be avoided as much as possible.
Move the node previews to the overlay region, atop each node.
It allows nodes to keep the same size when the preview is toggled,
which is more convenient for large nodes and large nodetrees.
The preview has to be drawn from `node_draw_extra_info_panel`
because there could be overlapping between info text and the preview.
When the node is out of the view, it also has to make sure that the
preview is also out of the view before exiting the draw function.
Pull Request: https://projects.blender.org/blender/blender/pulls/108001
This formats code that is disabled using `#if 0`. Formatting was achieved
by temporarily changing `#if 0` to `#if 1 /*something*/`, then formatting,
and then changing it back to `#if 0`.
This moves the remaining `.c` files in the following `editors` folders to C++:
`physics`, `screen`, `sound`, `space_buttons`, `space_file`, `space_graph` and `space_image`.
One exception is `fsmenu.c` which has platform specific issues on macos and
windows. E.g. the `Carbon/Carbon.h` include also declares a `Collection` type that collides
with ours.
Also see #103343.
Pull Request: https://projects.blender.org/blender/blender/pulls/109918