Commit Graph

120055 Commits

Author SHA1 Message Date
Omar Emara
a8a526d088 Refactor: Specialize variable size separable blur code
This patch specializes the symmetric separable variable size blur code
for different types. Additionally, now-unused generic type functions
were removed, and unused GPU specialization was removed since they are
no longer free due to CPU support. Gives a 2x improvement.
2024-12-09 11:31:03 +02:00
Omar Emara
9c45398ba8 Refactor: Specialize blur for different result types
This patch specializes the symmetric separable blur code for different
types. Additionally, now-unused generic type functions were removed, and
unused float2 specialization was removed since it is no longer free due
to CPU support. Gives a 2x improvement.
2024-12-09 11:10:11 +02:00
YimingWu
4cf82e62a4 Fix #131530: LineArt: Fix crash when copying empty object_dependencies
Line Art modifier `runtime->object_dependencies` can be empty when first
loaded, this can be triggered when loading as library overrides. This
fix guards this kind of situation.

Pull Request: https://projects.blender.org/blender/blender/pulls/131591
2024-12-09 09:55:43 +01:00
Richard Antalik
97f9f62816 Fix: VSE: Crash when using color balance modifier
Caused by incrementing incorrect pointer. In other branch pointer
incrementing logic was missing completely. That is fixed as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/131528
2024-12-09 03:33:05 +01:00
Campbell Barton
a3213dc82a Cleanup: trailing space 2024-12-09 09:23:23 +11:00
Campbell Barton
5dd67c6e1c Cleanup: sort CMake path lists 2024-12-09 09:18:50 +11:00
Campbell Barton
21ecc1a804 Cleanup: use function style casts 2024-12-09 09:14:46 +11:00
Campbell Barton
083b690fb5 Cleanup: spelling in comments 2024-12-09 09:14:44 +11:00
Campbell Barton
2a0a6d38df Cleanup: use term "current-frame" instead of "playhead" 2024-12-09 09:14:42 +11:00
Clément Foucault
c89be1b774 Fix: EEVEE: Missing overlay when viewport resolution scale is greater than 1
This is a partial fix as it doesn't fix the gpencil
scene intersection.
2024-12-08 21:54:03 +01:00
Clément Foucault
7b6cc57215 Metal: Fix race condition in msl_patch_default_get
The string `msl_patch_default` can have been read
partially uninitialized or initialized multiple
time and read uncomplete during multithreaded
compilation.

This should fix the GPU tests randomly failing on mac.

While this would never fail when blender runs from the UI (since
UI shaders are init in single threaded manner and always compile
before EEVEE shaders), this race condition could happen when running
EEVEE through background rendering or running tests.

Pull Request: https://projects.blender.org/blender/blender/pulls/131580
2024-12-08 19:15:56 +01:00
Hans Goudey
1b3955bc91 Fix #131574: Crash displaying modifier vertex group UI
Caused by 21aef81714.
2024-12-08 10:41:18 -05:00
Hans Goudey
ba72ac2cf7 Cleanup: Use node topology cache instead of SOCK_IS_LINKED flag 2024-12-08 10:29:48 -05:00
Harley Acheson
793c9a8984 UI: Correction to #131406, Auto Keyframe Notification
It was pointed out that the notification added in #131406 was incorrect
as it added a notification for an intended area rather than the type
of change. This adds a ND_KEYFRAME_AUTO, set on auto keyframe change.
Timeline header already listens for all NC_ANIMATION and tags redraw.

Pull Request: https://projects.blender.org/blender/blender/pulls/131454
2024-12-08 00:48:33 +01:00
Harley Acheson
c5bce9d710 Fix #130402: Improve Tooltip Text Colors for Light Themes
The text colors used on the tooltips are hard-coded and calculated
based on that widget's text color. But this is done in such a way that
the colors lose their saturation when used on light themes. This PR
calculates them in a way that allows the active color (light blue) and
the alert color (red) to work with light theme colors.

Pull Request: https://projects.blender.org/blender/blender/pulls/131515
2024-12-08 00:11:08 +01:00
Clément Foucault
033c02557c Cleanup: Overlay: Do not use custom shader for text edit
Use standard uniform color shader and don't use a matrix
SSBO.
2024-12-07 23:43:35 +01:00
Sean Kim
a77a5ec9f3 Fix #131003: Mesh Filter undo panel repeat parameter doesnt work
With the brush system refactor in 4.3, the mesh filter tool was changed
to remove the `no_orig_co` `FilterCache` property. This change and
subsequent refactors had the unintended effect of breaking the filter
tool "repeat" functionality. The expected state of most filter modes
is to use the current position, not the original position.

To fix this behavior, in all modes except Sharpen, Smooth, and Relax
that used the original position data, this commit removes resetting
the transform by the distance from the original position, instead
updating this only when the modal is operating.

Unfortunately, the smooth filter is rather complicated in how it
expects this data, when running as a modal, we always use the original
data, but when the repeat parameter is being used, we need to instead
use the current position on any step that isn't the first one as the
undo step is not "committed" until the user is finished tweaking the
panel.

Additionally, many of the filter modes clipped the resulting posistions
based on the original position data instead of the new, transformed
position, this was also fixed.

Pull Request: https://projects.blender.org/blender/blender/pulls/131469
2024-12-07 22:35:15 +01:00
Hans Goudey
f10c6b8236 Fix #124259: Missing topology update tag in set curve handles node
When the node changes handle types of a segment from Vector
handles to free handles, the number of evaluated points changes
which means the topology needs to be tagged dirty.
2024-12-07 12:11:48 -05:00
Hans Goudey
13e634869f Cleanup: Nodes: Remove unnecessary .c_str() calls 2024-12-07 11:19:37 -05:00
Hans Goudey
e816859948 Fix: Potential crash in menu search after StringRef cleanup 2024-12-07 11:10:00 -05:00
Alaska
a6c832a67d Compositor: Allow CPU denoising in GPU compositor to use all CPU threads
By default OIDN has a `setAffinity` option set to `True`. This allows
OIDN to set it's own CPU affinity, and on most systems this resulted in
it only running on one thread per CPU core.

This setting was overwritten in Cycles and the CPU compositor
to allow Blender to control CPU affinity, allowing OIDN to use all
threads on a system. However this wasn't done for the CPU denoiser
in the GPU compositor.

This commit fixes that by setting `setAffinity` to `False` in the
CPU denoiser in the GPU compositor.

Performance:
I found no measurable improvement to performance on a AMD Ryzen 9 5950X

Pull Request: https://projects.blender.org/blender/blender/pulls/130360
2024-12-07 06:00:12 +01:00
Jesse Yurkovich
aef11435b9 Cleanup: Move MAX_DUPLI_RECUR define from DNA to BKE
Moving MAX_DUPLI_RECUR from `DNA_object_types` to `BKE_duplilist` is
more correct organizationally and it allows some downstream consumers to
remove the inclusion of a large and unnecessary DNA header.

Archaeology reference: https://archive.blender.org/developer/D8222

Pull Request: https://projects.blender.org/blender/blender/pulls/131274
2024-12-07 03:14:49 +01:00
Sean Kim
e7e9557b0b Fix #131478: Undo crashes when reverting stroke prior to object.subdivision_set
In 4.3, the PBVH was refactored to include a variant to specify the type
of node that the tree contains. In certain circumstances, this now leads
to a crash when the data in the PBVH does not match the data in the undo
step. In versions prior to 4.3, these operations also did not work, they
were effectively no-ops, but did not crash.

To avoid the crash, we exit early in the `restore_list` function if we
detect we are in this weird state.

Pull Request: https://projects.blender.org/blender/blender/pulls/131522
2024-12-07 00:54:25 +01:00
Harley Acheson
7ed5b11c64 Fix #125035: Stop widget_box from Drawing over Contents
The complaint shows the background of the box widget drawn over top of
its contents, the color picker. This is resolved by flushing the widget
cache so that other content draws after.

Pull Request: https://projects.blender.org/blender/blender/pulls/131525
2024-12-07 00:26:52 +01:00
Sean Kim
c36212bf11 Fix #131210: Crash on selecting brush in non-updated file
Missed in 9945d511a9

The previous commit fixed files that had not yet been saved in 4.3,
however, the versioning code was not bumped which means that a user who
had a file in a version prior to 4.2 that then saved with the full
release of 4.3 would not have the corrected versioning applied for their
texture paint workspaces.

This commit re-applies similar versioning code and bumps the version
to ensure files are up to date.

Pull Request: https://projects.blender.org/blender/blender/pulls/131337
2024-12-07 00:18:14 +01:00
Jesse Yurkovich
f92bfe0f0b USD: Write sparse values for Camera, Light, and Skeleton attribute data
Make use of our sparse value writer in more places. Namely, when using
animated Camera or Light properties, this will prevent a needless stream
of unchanging values being written into the USD file [1]. Skeletons and
armatures benefit too but less so as typically the primary benefit only
applies to the comparatively small `scale` transform attribute, which
typically remains unchanged from frame to frame.

The newly added `set_attribute` common code can, and eventually will, be
used to reduce boilerplate elsewhere where we do the same sparse writing
dance.

Ref #130759

Pull Request: https://projects.blender.org/blender/blender/pulls/131333
2024-12-07 00:15:08 +01:00
Sean Kim
569003f70b Fix: Apply correct versioning for prior FCurve change
Missed in 2536ddac0d

Pull Request: https://projects.blender.org/blender/blender/pulls/131520
2024-12-06 23:30:00 +01:00
Jesse Yurkovich
76c699ada5 Fix: vertex crease data was imported incorrectly from USD
While adding tests for subd import I discovered that our vertex crease
data was imported incorrectly.

This PR adds tests and fixes:
- We tried to read crease sharpness data as ints instead of floats. This
  caused the import process to early-return, meaning we never load any
  data at all
- Empty USD data would still cause us to create the `crease_vert`
  attribute unnecessarily
- Sharpness data needs clamped to 0-1 to handle USD's SHARPNESS_INFINITE
  value of 10.0
- We need to fill the `crease_vert` span with 0's since incoming USD
  data may not have values set for all the verts

Pull Request: https://projects.blender.org/blender/blender/pulls/131516
2024-12-06 22:19:31 +01:00
Miguel Pozo
e3c6c2c6fc Cleanup: CMake: De-duplicate with_shader_cpp_compilation code
Move the common setup and function to `macros.cmake`.

Pull Request: https://projects.blender.org/blender/blender/pulls/131391
2024-12-06 21:03:11 +01:00
Hans Goudey
7a8a58e7e5 Cleanup: Remove unused UI layout function 2024-12-06 14:48:28 -05:00
Hans Goudey
b7a056b839 Cleanup: Use StringRefNull instead of const char * in one case 2024-12-06 14:44:40 -05:00
Hans Goudey
ce5559d682 Fix: Crash in UI code after recent StringRef cleanup
Mistake in 21aef81714
2024-12-06 14:44:40 -05:00
Aras Pranckevicius
dc063d8a80 Fix #131106: VSE strip mask inconsistencies between byte and float images
If a strip mask was used several times in the same frame, and it needed
to do byte->float conversion (e.g. mask is produced by a byte-color
strip, but then used in both a byte-color strip, and later on in a
float-color strip), then that byte->float mask image conversion was
introducing two inconsistencies:
- It was making mask alpha channel affect the result, which was not
  happening with regular byte mask images, and
- It was converting float mask to scene linear space, which was
  resulting in different image than with a byte mask.

Fix those issues by ensuring that all VSE modifiers can take either
byte or float mask as-is, without extra conversions. Previously, some
of the modifiers were done in a way where they only handled "(byte
image + byte mask) or (float image + float mask)" cases.

Pull Request: https://projects.blender.org/blender/blender/pulls/131355
2024-12-06 18:43:52 +01:00
Sergey Sharybin
c404643604 Fix #131287: Cannot Remove Lightgroup via API
Pull Request: https://projects.blender.org/blender/blender/pulls/131509
2024-12-06 18:27:06 +01:00
Bastien Montagne
2e93789ff1 Cleanup: Fix typo in documentation for background CLI option. 2024-12-06 17:50:31 +01:00
Philipp Oeser
566a38ffee Fix: Crash rendering of rigid body setup without baking dynamics first
When rendering animation without baking dynamics first, rigid body
objects/shapes might be set up for the fist time (see
`rigidbody_update_simulation`).

Here is my take on what happens when we run into the reported crash:

In `rigidbody_validate_sim_object`, `rigidbody_validate_sim_shape` can
be called (which -- amongst other things -- can call `RB_shape_delete`).
It does not set `RBO_FLAG_NEEDS_RESHAPE` nor calls
`RB_body_set_collision_shape`. It only sets `rbo->shared->physics_shape`
(which only seems to to update the "blender side of things", but not the
"bullet side of things").

Then later (still in `rigidbody_validate_sim_object`),
`RB_dworld_add_body`/ `btDiscreteDynamicsWorld::addRigidBody`>
`btCollisionWorld::addCollisionObject` > collisionObject->getCollisionShape()
 is called, but confused because we called `RB_shape_delete` before.

Also see the TODO(Sybren) comment from 98a0bcd425 (which might even be
removed with this PR, but not I havent verified "collision shape being
created twice" is now not happening anymore).

One might think that flagging `RBO_FLAG_NEEDS_RESHAPE` might be enough,
but reacting on that only happens later in `rigidbody_update_simulation`
(so not early enough to not run into the issues of `RB_dworld_add_body`
above).

So to resolve, call `RB_body_set_collision_shape` in
`rigidbody_validate_sim_shape` if we actually made a new one.

Fixes #130991

Pull Request: https://projects.blender.org/blender/blender/pulls/131039
2024-12-06 17:14:49 +01:00
Sybren A. Stüvel
ff0a2d6dbf Anim: set default 'last slot handle' when versioning legacy Actions
Initialise the Action's `last_slot_handle` field to its default value.
The DNA 'defaults' system doesn't do this automatically when versioning
legacy Actions, so now it's done explicitly in the versioning code.

It's fine to only apply this to the existing versioning code, and not as
a new versioning rule. Existing slotted Actions should just keep that
field to whatever it is now.

The default value was introduced in be921b8ddb

Pull Request: https://projects.blender.org/blender/blender/pulls/131498
2024-12-06 17:03:37 +01:00
Alaska
afcad646bf Bug reporting: Install the Cycles debug script
cf8d31d41c added a debug script for
Cycles on Windows but didn't actually install it into the
Blender folder.

This commit fixes that by installing the script into the
Blender folder.

Pull Request: https://projects.blender.org/blender/blender/pulls/131348
2024-12-06 16:55:36 +01:00
Hans Goudey
4de00c1544 Cleanup: Move more ARegion runtime data out of DNA 2024-12-06 09:44:31 -05:00
Jeroen Bakker
09fe07b572 Vulkan: Pre-phase for initial uploading resources
Reduces the number of times a graphic context needs to be paused/resumed.
The scheduler reorders the nodes to put these initial data transfer nodes
to the start of the nodes that are about to be submitted.

Pull Request: https://projects.blender.org/blender/blender/pulls/131502
2024-12-06 15:34:03 +01:00
Hans Goudey
d9c7c90e45 Fix #131494: Editor merging can crash Blender
Missing copied runtime data in 129a2aa0f4.
2024-12-06 09:23:35 -05:00
Jeroen Bakker
d49218440f Fix #131474: Incorrect framebuffer configuration image engine overlays
When the overlay engine is used to draw over the image engine it uses
incorrect framebuffer configurations. It can attach and sample both the
depth buffer at the same time.

This PR fixes this by separating the output framebuffer into two. One
with and one without a depth buffer. And bind the correct one when
needed.

Pull Request: https://projects.blender.org/blender/blender/pulls/131489
2024-12-06 15:00:53 +01:00
Hans Goudey
4d3664fc43 Cleanup: Remove accidentally included debug print 2024-12-06 08:16:14 -05:00
Hans Goudey
21aef81714 Cleanup: Use StringRef and std::optional for UI string arguments
- Gives O(1) access to string length in more cases
- Convenient string manipulation functions
- Clarify difference between "no string" and "empty string"
- Avoid the need for raw pointers in the API
- Shows which API string arguments are optional

Pull Request: https://projects.blender.org/blender/blender/pulls/131473
2024-12-06 14:08:10 +01:00
Jeroen Bakker
28ea56b680 ImageEngine: Incorrect state when no image selected
When no image is selected the tile drawing state would be used of the
last known image. This can lead to drawing the checked background
everywhere.

Detected when researching #131474

Pull Request: https://projects.blender.org/blender/blender/pulls/131487
2024-12-06 12:40:45 +01:00
Pratik Borhade
210cef1c6c Fix #131367: Grease Pencil: Multiframe does not turn off in object mode
Add extra condition of object mode in boolean `do_multi_frame`, so
`hide_onion/skip_strokes` will be true in object mode, this will exclude
other curves.

Pull Request: https://projects.blender.org/blender/blender/pulls/131416
2024-12-06 11:22:07 +01:00
YimingWu
db1613d5a9 Fix #131429: Grease Pencil: Allow moving strokes into hidden layers
Grease Pencil strokes should be able to move into hidden but not locked
layers. Use `get_drawings_at` instead of only `editable` one to achieve
this.

Pull Request: https://projects.blender.org/blender/blender/pulls/131435
2024-12-06 10:44:17 +01:00
Omar Emara
1732467bc6 Refactor: Move Blur Gamma Correction to its own algorithm
Move the Gamma Correction pass of blur nodes into its own algorithm to
avoid code duplication and optimize pixel access, since gamma is now
applied for each pixel in the filter window. Gives a 15% improvement.

Pull Request: https://projects.blender.org/blender/blender/pulls/131480
2024-12-06 08:14:26 +01:00
YimingWu
393c75cc39 Fix #131415: Grease Pencil: Bone transform when setting layer parent
When setting layer parent, if the parent is an armature object, then the
child bone matrix needs to be taken into account for doing inverse
transformations. This fix allows grease pencil layer to be parented to
a bone correctly.

Pull Request: https://projects.blender.org/blender/blender/pulls/131432
2024-12-06 07:28:52 +01:00
YimingWu
e7c2c079c4 Refactor: Restructure object type conversion code
This patch restructures `object_convert_exec`, separated conversion
calls for different source/target object type combination for better
readability, keeping each route relatively simple and easy to navigate.

Resolves #130653.

-----------

NOTE:

- Grease Pencil part is still WIP, the Grease Pencil -> Curves -> Mesh two stage conversion is not included in this new code yet.

Pull Request: https://projects.blender.org/blender/blender/pulls/130668
2024-12-06 07:21:09 +01:00