Commit Graph

101218 Commits

Author SHA1 Message Date
Campbell Barton
32fb40fa76 Cleanup: use function style casts for C++ 2023-07-14 12:31:00 +10:00
Iliya Katueshenock
962e4c3056 Fix #110083: Fix incorrect initialization of bounds max
See: https://en.cppreference.com/w/cpp/types/numeric_limits

Pull Request: https://projects.blender.org/blender/blender/pulls/110084
2023-07-14 03:16:05 +02:00
Joseph Eagar
474b492b38 Sculpt: versioning fix
Moved versioning code back to BKE_sculpt_toolsettings_data_ensure.

Pull Request: https://projects.blender.org/blender/blender/pulls/110081
2023-07-14 00:52:21 +02:00
Joseph Eagar
6220bfe31d Sculpt: Fix memory leak
Reverted blo_update_defaults_scene to simply load the default
Sculpt.flags.
2023-07-13 13:30:38 -07:00
Joseph Eagar
d70b36faed Sculpt: Implement proper versioning code for Sculpt struct
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.
2023-07-13 11:06:43 -07:00
Joseph Eagar
27974faa57 Sculpt: Use DNA default system for Sculpt struct 2023-07-13 10:48:49 -07:00
Brecht Van Lommel
7551767f9f USD: more complete import and export of lights
* Exposure import
* Diffuse factor support
* Correct disk radius
* Better non-normalized intensity import
* Sun radius export

Pull Request: https://projects.blender.org/blender/blender/pulls/109929
2023-07-13 19:14:04 +02:00
Falk David
f2f0426980 GPv3: Refactor root_group to be a pointer in DNA
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
2023-07-13 18:24:19 +02:00
Jacques Lucke
3a2f5fb9db Editors: move transform code to C++
Also see #103343.

Co-authored-by: Germano Cavalcante <germano.costa@ig.com.br>
Pull Request: https://projects.blender.org/blender/blender/pulls/110049
2023-07-13 17:59:52 +02:00
Nate Rupsis
10428bd2b4 Fix #109787: filter out non Fcurve channels from nlatrack_truncate_temporary_tracks
## Overview

Adding ANIMFILTER_FCURVESONLY  filter to  nlatrack_truncate_temporary_tracks to fix index out of bounds crash.

Pull Request: https://projects.blender.org/blender/blender/pulls/110032
2023-07-13 16:09:57 +02:00
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