Commit Graph

101208 Commits

Author SHA1 Message Date
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
Christoph Lendenfeld
babc650779 Fix #109781: Linked datablocks are keyable
Add a simple check when inserting keyframes to ensure the data is not linked

Pull Request: https://projects.blender.org/blender/blender/pulls/109813
2023-07-13 14:09:50 +02:00
Julian Eisel
80cc0dfef2 Fix grid view sometimes dropping last row
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.
2023-07-13 14:03:12 +02:00
Falk David
9356e18d15 GPv3: Add on_stroke_begin callback
This adds a new virtual function `on_stroke_begin` to
`GreasePencilStrokeOperation`. It's only called on the first input.
2023-07-13 13:57:23 +02:00
Pratik Borhade
414a17ab4f GPv3: Missing property updates after initial dopesheet support
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
2023-07-13 13:51:14 +02:00
Iliya Katueshenock
c48f8cd12b Geometry Nodes: Rotation socket tooltip
Formatted inspection strings for field/single value of new rotation
type of socket. Called `Rotation`, displayed as XYZ Euler degrees.

See: #92967

Pull Request: https://projects.blender.org/blender/blender/pulls/109851
2023-07-13 13:21:46 +02:00
Joseph Eagar
8db97728b5 Core: fix crash in legacy mesh conversion code. 2023-07-13 00:28:49 -07:00
Christoph Lendenfeld
7acd6e61ab Animation: Butterworth Smoothing filter
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
2023-07-13 09:10:42 +02:00
Campbell Barton
25279acc91 Cleanup: add SPDX copyright 2023-07-13 13:43:20 +10:00
Campbell Barton
ef1ddbaaca Cleanup: remove double spaces after a full-stop 2023-07-13 13:40:25 +10:00
Campbell Barton
f8dea82aaa Cleanup: rename seq_cache_relink_keys to seq_cache_key_unlink
The term relink made some sense when when two links were passed in.
As this removes the link, use the term "unlink" (matching listbase API).
2023-07-13 13:25:40 +10:00
Ray Molenkamp
370ca90632 Cleanup: Add missing copyright notice
missed in the initial commit.
2023-07-12 19:53:19 -06:00
Lucas Tadeu
b11540a65f VSE: Process audio strips waveforms in parallel
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
2023-07-13 03:22:51 +02:00
Campbell Barton
18b8b66952 Cleanup: correct doxy-comments, use doxy sections 2023-07-13 10:22:13 +10:00
Campbell Barton
e6609ecfda Cleanup: use a const ImBuf for UI image references 2023-07-13 10:10:44 +10:00
Campbell Barton
4e7ea8bf70 Cleanup: use const rect argument for immDrawPixelsTex functions 2023-07-13 10:09:16 +10:00
Campbell Barton
0e10173c2d Cleanup: function style casts for C++, nullptr & other minor changes 2023-07-13 09:54:05 +10:00
Campbell Barton
7f0a8bcbbc Cleanup: quiet warnings 2023-07-13 09:54:05 +10:00
Harley Acheson
5f7e07e053 UI: Show SVG Thumbnails with Checkerboard Backgrounds
Show checkerboard background behind SVG thumbnails just as we do for
other image types.

Pull Request: https://projects.blender.org/blender/blender/pulls/110036
2023-07-13 01:36:07 +02:00
Hans Goudey
a3e05f06a6 Fix: Draw manager uses empty positions after recent refactor
Add an explicit empty check after 3d383d383f.
2023-07-12 17:09:51 -04:00
Harley Acheson
f56e589151 Cleanup: Make format
Just changes resulting from make format.
2023-07-12 14:06:46 -07:00
Ray Molenkamp
98336cb8ca USD: Use pre-compiled headers
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
2023-07-12 22:55:57 +02:00
Harley Acheson
565436bf5f UI: SVG Thumbnails
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
2023-07-12 22:39:23 +02:00
Harley Acheson
b7a119c785 Fix #40059: Use Modifier Keys Between Windows on Win32
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
2023-07-12 20:01:37 +02:00
Bastien Montagne
bf93fb0f46 Fix (unreported) incorrect behavior of liboverride hierarchy fixing code.
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.
2023-07-12 19:20:49 +02:00
Clément Foucault
1f1c39b980 EEVEE-Next: Rework interactive sampling
This allow multiple effect to require different
amount of samples for interactive mode.
2023-07-12 19:02:29 +02:00
Hans Goudey
12d7f8e7c1 Fix #109840: Select similar crease broken after generic conversion
Thanks to Jesse Yurkovich for finding the issue, which was an incorrect
fallthrough that caused bevel weights to be used instead.
2023-07-12 12:41:44 -04:00
Clément Foucault
a635f8bbf7 EEVEE-Next: Fix uninitialized closure_bits_ 2023-07-12 18:18:38 +02:00
Brecht Van Lommel
9705f4cc56 Cleanup: rename GPU context in RenderEngine for consistency with other code 2023-07-12 18:14:11 +02:00
Brecht Van Lommel
b29d2c607d Fix #109718: Cycles crash with persistent data and bpy.ops.render
Don't reuse freed context for subsequent render.
2023-07-12 18:14:11 +02:00
Hans Goudey
9a879b27b3 Cleanup: Fix macOS build error, move set performance test out of header
Fixes, similar to a5a72019a9

Pull Request: https://projects.blender.org/blender/blender/pulls/110017
2023-07-12 18:04:13 +02:00
Jacques Lucke
75322803df Cleanup: move more editors folders to c++
This moves `space_script`, `space_statusbar`, `space_topbar`,
`space_userpref`, `space_view3d` and `util`.

Also see #103343.

Pull Request: https://projects.blender.org/blender/blender/pulls/110015
2023-07-12 18:02:56 +02:00
Germano Cavalcante
c284555d03 Cleanup: improve 'view3d_opengl_read_Z_pixels' comment
The comment implies that the operation is slow because it creates and
destroys a framebuffer.

Actually the slowness comes from forcing CPU-GPU synchronization.
2023-07-12 12:53:43 -03:00
Nate Rupsis
1837bda030 Animation: Make Vertex Weight Edit modifier inclusive
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
2023-07-12 17:52:52 +02:00
Ray Molenkamp
769d18877b Cleanup: make format 2023-07-12 09:34:37 -06:00
Bastien Montagne
6f5f1737f3 Revert "LibOverride: Work around reset of system liboverrides on save."
This reverts commit 457b26aba3.

This change was not actually needed, actual issue was caused by
784d09a87c, and has been fixed by 1c0ffa1e18.
2023-07-12 17:26:13 +02:00
Julian Eisel
eee24c3378 UI: Avoid error print when using temporary region data
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.
2023-07-12 17:24:31 +02:00
Pratik Borhade
861931101c Fix #109994: Layer unlinks from the list when drop location is same
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
2023-07-12 17:12:23 +02:00
Bastien Montagne
1c0ffa1e18 Fix mistake in recent change to liboverride cleanup of invalid operations.
Issue introduced by own 784d09a87c, would end up cleaning too many,
including valid liboverride operations.
2023-07-12 17:05:10 +02:00
Germano Cavalcante
f1fbe9a691 Cleanup: Remove redundant selection center calculation
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.
2023-07-12 11:37:22 -03:00
Brecht Van Lommel
3d86417777 Fix build error without unity build 2023-07-12 16:18:26 +02:00
Colin Marmond
1ebdd2d9cf Nodes: Move preview images to an overlay
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
2023-07-12 16:14:12 +02:00
Hans Goudey
a5a72019a9 Cleanup: Move Map performance test out of header
Avoid including <unordered_map> in BLI_map.hh
for the performance test only used in the test file.
2023-07-12 09:45:25 -04:00
Jacques Lucke
3f33e0c6cd Cleanup: clang format in disabled code segments
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`.
2023-07-12 14:18:59 +02:00
Jacques Lucke
19d4cafb12 Cleanup: move more editors code to c++
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
2023-07-12 13:43:00 +02:00
Jacques Lucke
38cecf9f89 Fix: simulation nodes baking does not work
This was accidentally broken in 7ec335f995.
There is a difference between resetting the `std::shared_ptr` and resetting
the cache.
2023-07-12 13:08:28 +02:00
Falk David
84c8c331b4 Fix: Complier error
The commit 64887c80a2 declared
rna_enum_grease_pencil_selectmode_items as static, when it should
have not been static.
2023-07-12 12:01:13 +02:00