Commit Graph

131152 Commits

Author SHA1 Message Date
Hans Goudey
1d94003660 Cleanup: Remove unnecessary sculpt visibility update
Mainly for semantic reasoning-- these face set gestures don't change visibility.
2023-12-14 15:06:08 -05:00
Hans Goudey
f15bca64f2 Cleanup: Remove useless PBVH update function
This `update_vertex_data` only found nodes with the color update
tag and also added redraw tags. But whenever nodes are marked
for a color update, those redraw tags are already set anyway.
It appears this was meant to solve problems switching active
color attributes during undo and redo, but it doesn't make a
difference when this function is removed.
2023-12-14 15:01:27 -05:00
Hans Goudey
262572a6a0 Cleanup: Move PBVH update functions to C++ namespace 2023-12-14 14:56:25 -05:00
Hans Goudey
5be9a1cce4 Cleanup: Slightly simplify some loops in delaunary triangulation
Use a local variable for the faces, use range based for loops.
2023-12-14 12:40:46 -05:00
Hans Goudey
34bf1f6c0c Cleanup: Slightly simplify delaunay triangulation input gathering
Separate allocation of input arrays and assignment to input class.
The main purpose is to simplify #111061.
2023-12-14 12:40:46 -05:00
Hans Goudey
bb2a289a9a Cleanup: Use utility function to calculate face normal
Rather than inlining all the logic into OBJ export code
2023-12-14 12:40:46 -05:00
Miguel Pozo
9bf942dcc9 Cleanup: Conver macros into functions
Avoids macro redefinition warnings in unity builds.
2023-12-14 18:34:20 +01:00
Iliya Katueshenock
999c0f6878 Cleanup: Fix compiler warning in face group boundaries node
Fix error of wrong parameter for `compare_exchange_weak`. Second
one parameter is used for write new value, but a mistake occurred and
the wrong parameter (for read) was used. Default param is enough for
this, so just delete last one.

Pull Request: https://projects.blender.org/blender/blender/pulls/116010
2023-12-14 18:32:21 +01:00
b5e7e6b214 Cleanup: Anim, add explanation to bone collection assign operator
Just a little explanation of the code, because I got confused by my own.

No functional changes, except for the addition of a `BLI_assert_msg()`.
2023-12-14 18:07:10 +01:00
Hans Goudey
a494d6a641 Cleanup: Remove unnecessary C API for delaunay triangulation
The only user was the Python API. Convert that to use the C++ API.
That simplifies things a bit even, since the encoding of "arrays of arrays"
is a fair amount simpler with the C++ data structures. The motivation
is to simplify the changes from #111061.
2023-12-14 11:40:06 -05:00
Aras Pranckevicius
5cac8e2bb4 VSE: reduce effects code duplication, making gaussian blur faster in the process
Now that the code is in C++, quite some duplication between "byte" and
"float" effect code paths can be reduced (easier than it was in C times).
So I did that, removing about 400 lines of code.

In that process I accidentally made Gaussian Blur faster, since while
reducing the amount of code I noticed it was doing some things
sub-optimally (calculated kernel tables for each job, etc.). Applying
100x100 gaussian blur on 4K UHD resolution image strip on Ryzen 5950X
went 630ms -> 450ms.

Pull Request: https://projects.blender.org/blender/blender/pulls/116089
2023-12-14 17:31:05 +01:00
Jeroen Bakker
4a34dcbb69 Studiolight: Free Resources for Unused Lights.
Studio lights based on image resources are kept in memory, even when only
displayed as an icon. When having many studio lights configured
leads to allocating a lot of memory that are not used.

This patch free image resources when only icons are requested.
For studio lights that are used in a viewport the image resources are kept.

Pull Request: https://projects.blender.org/blender/blender/pulls/116191
2023-12-14 16:17:55 +01:00
Hans Goudey
451aa56d9c Cleanup: Move BLI_delaunay_2d.hh to C++ 2023-12-14 10:05:35 -05:00
Hans Goudey
5b053204ed Fix #116017: Mesh edit mode vertex slide allocation ignores alignment
`float4x4` requires 16 byte alignment. The compiler can add padding
within the struct, but the allocation needs to know about the alignment
too. Fix by using an allocation function that handles this properly.
2023-12-14 09:30:19 -05:00
Aras Pranckevicius
1e0bf33b00 ImBuf: optimize IMB_transform
IMB_transform is used by Sequencer (and other places) to do image
translation/rotation/scale on the CPU. This PR speeds up parts of it,
particularly when bilinear filtering is used. No behavior changes are
expected.

- Don't use virtual function calls inside inner loop. The code was using
  class hierarchies with virtual calls just to do equivalent of "outside
  of image? ignore" and "wrap UV coordinates or not?" decisions. Make those
  use non-virtual function based code.
- Simplify pixel sampling functions to only do the work as needed by
  anything within Blender codebase. For example, bilinear sampling of uchar
  images always uses 4 RGBA channels and never does "UV wrap" logic.
- Bilinear interpolation uchar: completely branchless SIMD code now.
- Bilinear interpolation float: 2x floor() calls instead of 4x floor() +
  2x ceil(), and final sample blending is done with SIMD.

Sequencer at 4K UHD resolution, with two image strips that need a transform,
playback framerate:

- Windows Ryzen 5950X: 18.7fps -> 26.2fps (IMB_transform time per frame goes
  26.3ms -> 11.2ms)
- Mac M1 Max: 27.3fps -> 31.4fps

At that point the IMB_transform is not the slowest part of where playback
takes time (but rather sequencer effect application etc.).

Note: the amount of _actual code_ got a bit smaller. But I've added 100 lines
of unit tests in BLI_math_interp_test.cc, the bilinear interpolation
functions were only tested very indirectly by CPU compositor template
image tests.

Pull Request: https://projects.blender.org/blender/blender/pulls/115653
2023-12-14 15:10:30 +01:00
Jeroen Bakker
a52a362527 Studiolights: Remove Unused Options
Studio lights had gone over several iterations during 2.80. Some
unused options where still in the code, but not used.

This PR cleans up the studio lights to options that are still in use.
Removing:

- Spherical Harmonics: It was used by workbench, but was replaced
  by regular OpenGL lights
- Irradiance textures: Was used by an old eevee world light evaluation
- Cached data files.

Pull Request: https://projects.blender.org/blender/blender/pulls/116186
2023-12-14 14:29:28 +01:00
Christoph Lendenfeld
915358f8b6 Cleanup: Remove unused EnumPropertyItem
The channel_bake_remove_options were forgotten
to be removed. They were no longer in use after
addressing review comments.
This fixes the compiler warning.
2023-12-14 14:21:16 +01:00
Campbell Barton
5197dd2a7a Cleanup: use local variable, replace pointer with reference 2023-12-14 23:12:57 +11:00
rajveermalviya
40a89c0984 GHOST/X11: Enable desktop sample capability
The functionality was added [0] but the flag wasn't enabled.

Ref: !116178

[0]: e5a0d11c4ed07fbf1b3e08ddb75b635ce76c9d05
2023-12-14 22:33:46 +11:00
Christoph Lendenfeld
1e931f5bd7 Anim: Bake Channel operator
This is a replacement for the workflow that uses
"Bake Curve" and "Unbake Curve" to quickly generate
dense key data.

Compared to the existing workflow it has the advantage
of allowing the user more control over the key types,
and distance between keys, as well as the frame range affected.

Operator options

* Range: the range that will be baked.
Defaults to the scene range or preview range.

* Step: Distance between keyframes.
Can be used to bake on 2s or even bake to subframes.

* Remove Existing Keys: Boolean option that
if enabled also removes keys outside the specified baking range

* Interpolation Type: Choose a interpolation mode used
for new keys e.g. Constant or Bezier

* Bake Modifiers: If enabled bakes the effect of the
modifier stack to keys and deletes the modifier stack.
If false, the code disables the modifiers before baking,
so the resulting keys will behave as if the modifiers didn't exist

The operator can be found in the Graph Editor under `Channel->Bake Channels`

Part of: #111050

Pull Request: https://projects.blender.org/blender/blender/pulls/111263
2023-12-14 11:35:25 +01:00
Christoph Lendenfeld
1a998c73eb Fix: Keying Channel Defaults
This was missed during #113504

While the versioning code set the flags correctly,
the defaults were not specified correctly.
This would leave new users to key only location.

Fix it by enabling Location, Rotation, Scale and
Custom Properties by default.

Pull Request: https://projects.blender.org/blender/blender/pulls/116180
2023-12-14 11:28:03 +01:00
Campbell Barton
9479b49bd3 GHOST/Wayland: remove workaround when resizing windows with LIBDECOR
This was an attempt to fix a crash resizing windows #107797
(which I can't reproduce), however it didn't fix the issue and meant
that a window would sometimes not reach the desired size,
the maximized window for e.g. would sometimes remain the un-maximized
size.
2023-12-14 21:25:53 +11:00
Brecht Van Lommel
7df6d9eb52 Build: update Windows ocloc to store binaries per generation
Same as #115750 for Linux, to gain space and compile time.

Pull Request: https://projects.blender.org/blender/blender/pulls/116159
2023-12-14 11:25:23 +01:00
Campbell Barton
f79da9f245 Cleanup: remove libdecor workaround for fractional scale
Since the preferred fractional scale callback runs,
remove a workaround that guessed the fractional scale from the output.

While it could be kept, it added unnecessary complexity.
2023-12-14 21:02:43 +11:00
Christoph Lendenfeld
9bfd7debcd Refactor: Move ED_id_action_ensure to animrig
No functional changes.

Move the function ED_id_action_ensure to animrig,
and rename it to `id_action_ensure`.
This is in order to reduce references from animrig
to the editor code.

Pull Request: https://projects.blender.org/blender/blender/pulls/116101
2023-12-14 10:17:18 +01:00
Andres Stephens
5c868e92d6 Fix #115581: Channel Context Menu mis-labeled
The context menu for the channels is shared
between all animation editors.
Changed "Dope Sheet Channel" label to "Channel"
for consistent channel label in all animation editors.

Pull Request: https://projects.blender.org/blender/blender/pulls/115845
2023-12-14 09:09:30 +01:00
Christoph Lendenfeld
92ad16ab90 Anim: Don't use keying sets when inserting keyframes during autokeying
Prior to this PR, the autokeying system used keying sets
to insert keyframes where required.

With the functions introduced in #113504
the code can be simplified and made to not rely on keying sets,
allowing autokeying to also insert keys by rna path directly.

This also removes all the code related to "Insert Needed" from autokeying.
The insert key functions deal with that now, all that is needed is to pass
in the flag.

Part of #113278

Pull Request: https://projects.blender.org/blender/blender/pulls/115522
2023-12-14 09:04:09 +01:00
Omar Emara
a8e13994b8 Realtime Compositor: Implement Cryptomatte node
This patch implements the Cryptomatte node for the Realtime Compositor.

Pull Request: https://projects.blender.org/blender/blender/pulls/115884
2023-12-14 08:49:41 +01:00
Jason Fielder
2db12cc049 Fix #116121: Resolve framebuffer resize issue in Metal
Changing size of framebuffer attachments would
throw an assertion as framebuffer size was not
correctly reset to zero. Zero allows any size
to override the current if there are no set attachments.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/116162
2023-12-14 08:09:03 +01:00
Campbell Barton
a7bcee8833 Fix crash with change to window initialization order
Recent re-ordering change [0] on Wayland window initialization crashed
WLROOTS based compositors, resolve by keeping the updates and only
postponing the state change.

[0]: 39f378da37eedb918a69a31c68c34e5a9263754c
2023-12-14 17:27:17 +11:00
Campbell Barton
39f378da37 Fix incorrectly sized maximized windows on Wayland + KDE
Starting blender with --window-maximized wouldn't always size the
windows properly, similar to the fix for LIBDECOR, move setting the
window state last.
2023-12-14 17:04:29 +11:00
Campbell Barton
ba33dba2b6 Fix window frames not following blender window with fractional scaling
With fractional scale under GNOME, the window frames didn't match
the window contents. This was caused by updates needed to call
libdecor_frame_get_xdg_toplevel initializing the LIBDECOR window
before the window scale, internal buffer - etc were set.

Resolve by accessing moving the window state assignment last.
2023-12-14 16:52:28 +11:00
Campbell Barton
a1bee22eca Cleanup: duplicate assert left in by mistake 2023-12-14 13:58:12 +11:00
Campbell Barton
3e635c3eed GHOST/Wayland: set windows scale on creation when it's known
When the final buffer scale is known, set the window scaling on startup.

This avoids scaling immediately after creating the window which
flickers. It also resolves an paper-cut with KDE where fractional
scaling caused the window to be placed on the screen center,
then the size increased pushing the window contents off the bottom right
hand portion of the screen.
2023-12-14 13:53:18 +11:00
Campbell Barton
42e7d9fc3c GHOST/Wayland: unbreak build without threaded event handling 2023-12-14 13:53:17 +11:00
Campbell Barton
4f609a4f96 Cleanup: typo in internal ghost/wayland prefix 2023-12-14 13:53:16 +11:00
Campbell Barton
410e202e2d Cleanup: quiet parentheses warning 2023-12-14 13:52:31 +11:00
Hans Goudey
e5cb2b2798 Fix #116141: Missing task isolation when storing sculpt undo node
We shouldn't use parallelism internally for each node, but it snuck in
with recent changes to use `array_utils::gather`. That's a nice change,
but we need a better way to turn off parallelism for that sort of
function. Until that's decided on, add a quick fix to fix the deadlock.
2023-12-13 21:46:32 -05:00
Campbell Barton
3241db35cd Docs: correct code comment for LaplacianSystem::tris
Also use doxygen doc-strings as they more easily allow comments to be
expanded on.
2023-12-14 12:51:21 +11:00
Campbell Barton
bff5ffc09b Cleanup: use naming for the size of a looptris array 2023-12-14 12:51:20 +11:00
Campbell Barton
664b49c2ef Cleanup: replace C expressions with plain text in cloth errors
Also remove the print as BKE_modifier_set_error prints a warning.
2023-12-14 12:51:19 +11:00
Campbell Barton
0d9acf84c6 Cleanup: match argument naming for headers/source 2023-12-14 12:51:18 +11:00
Campbell Barton
944e0483a6 Cleanup: clarify naming for MLoopTri
The term `looptri` was used ambiguously for both single & arrays.
The term `tri` was also used, causing `tri->tri`.

Use terms:

- `looptris` for an array or when dealing with multiple items.
- `looptri` is used when dealing with a single item.
- `lt` for a single MLoopTri variables & arguments.

This was already a convention but not followed closely.
2023-12-14 12:32:11 +11:00
Campbell Barton
931b2554e2 Refactor: move BEZKEYTYPE define to DNA
Recently this was inlined [0] however the purpose of this define is to
allow for the method of setting the value to be changed.
It also means the hack doesn't have to be explained whenever it's used.

Move the BEZKEYTYPE to DNA, update it's doc-string and restore the
original comment.

[0]: fd3629b80a1c205344627f872323714065bf0fca
2023-12-14 11:20:27 +11:00
Campbell Barton
d8ffa648eb Cleanup: merge doc-strings, correct comments in WM_api.hh 2023-12-14 11:18:06 +11:00
Campbell Barton
a4af406b81 Clenaup: spelling in comments 2023-12-14 11:14:50 +11:00
Campbell Barton
adb74ad0f3 Cleanup: follow convention for naming array lengths
In the context of meshes `totface` reads as if its the number of faces
in the mesh. This was infact the number of looptris however as this
is converted into a "bodyface" array, use that as the prefix.
2023-12-14 11:10:33 +11:00
Campbell Barton
173a4dfbb6 Fix invalid size of allocated looptris array
Regression in [0], moving to C++ types.

[0]: 321c1af26efe1dc79cb46b56a41bcc38646f2b36
2023-12-14 11:08:35 +11:00
Hans Goudey
cdb2f1e1ba Fix #116140: GPU subdivision ignores completely smooth shading
Extraction of data is done in a different order for GPU subdivision
drawing. The necessary normals domain of the mesh has to be
retrieved before that.
2023-12-13 18:59:28 -05:00
Harley Acheson
463dc4dbec Fix #116137: Overflow causing event time false positive warnings
The intent of `ghost_event_proc_timestamp_warning` is to give a console
warning when an event time is outside of an expected 5 second window
around the last time. However if an event happens within the first 5
seconds we get an overflow in a calculation and we get warnings for
normal times within the range.

Pull Request: https://projects.blender.org/blender/blender/pulls/116164
2023-12-13 22:45:50 +01:00