Commit Graph

115681 Commits

Author SHA1 Message Date
Miguel Pozo
4d8f9bb88e Fix #131420: EEVEE: Temporal projection+Motion blur artifacts
Regression from #131134.

The shader still reads `vel.obj.ofs[STEP_NEXT]`  even when in the
viewport.

- Ensure that `vel.obj.ofs[STEP_NEXT]` points to a valid memory
  location even if the computed value is still wrong.
- Ensure that the viewport always uses a 2 channel  vector_tx and all
  texture reads are always swizzled.

This also seems to fix the motion vector pass for the realtime compositor.

Pull Request: https://projects.blender.org/blender/blender/pulls/131445
2024-12-09 18:16:34 +01:00
Iliya Katueshenock
aba0174b48 Sculpt: Simplify sphere mesh filter code
Function itself is 25% faster since no more need for a branch/matrix
/addition vector math. Meaning of the code is the same.

Pull Request: https://projects.blender.org/blender/blender/pulls/131556
2024-12-09 18:14:57 +01:00
Lukas Tönne
c77933e748 Fix potentially incorrect index when looking up layer hints for GP crazyspace
The layer mask used by the armature modifier can be incomplete, in which case
the indices may not match the edit hints list of layer data. The actual
layer index must be used instead.

Also fixes a build error on Win64 ARM which cannot compile a parallel_for_each
over an index range.

Pull Request: https://projects.blender.org/blender/blender/pulls/131620
2024-12-09 17:05:42 +01:00
Omar Emara
7f6058c1fb Fix: Memory leak in Translate node
The Translate node leaks memory when no realization happens. That's
because the code passes the input through, then passes it again inside
the transform algorithm. To fix this, remove the pass through in the
node code and leave potential pass through to the algorithm.
2024-12-09 17:48:11 +02:00
Iliya Katueshenock
8a97d33733 Cleanup: Sculpt: Outdated comment
This notes no more relevant since 583ae8990c

Pull Request: https://projects.blender.org/blender/blender/pulls/131541
2024-12-09 16:25:25 +01:00
Jeroen Bakker
cf0db73571 Workbench: Separate depth of field shaders
Workbench shaders uses one fragment shaders, but uses different
resources based on the step of the effect. This failed in vulkan as all
defined resources should be found. This PR separates the steps in its
own fragment shader and adds sampler binding per step.

- Removed the max coc input texture as it wasn't used.
- Removed the background texture as it wasn't used.
- Renumbered the resources.

Pull Request: https://projects.blender.org/blender/blender/pulls/131606
2024-12-09 16:01:41 +01:00
Jacques Lucke
c3f012b719 Fix #131598: missing node tree update after regenerating overrides 2024-12-09 15:50:37 +01:00
Jacques Lucke
5809c46e1f Fix #127511: inconsistent tangents in Set Position node
The issue was that the `handle_left`, `handle_right` and `position` attribute
are updated one after another and the input field is evaluated again for each
attribute. If the handle positions are updated first, then the tangent will
change in consecutive evaluations.

The fix is to set the three attributes at the same time and to evaluate the
inputs only once.

Pull Request: https://projects.blender.org/blender/blender/pulls/131609
2024-12-09 15:34:47 +01:00
Pratik Borhade
fa0c927e76 Fix #131597: Grease Pencil: Active pivot point doesn't work in edit mode
Grease Pencil never had an "active" point/stroke. So similar to like in 4.2,
use objects location as pivot when `active` is selected.

Pull Request: https://projects.blender.org/blender/blender/pulls/131603
2024-12-09 15:21:06 +01:00
Nathan Vegdahl
454677ad49 Fix: use unspecified idroot when duplicating Action from Action Editor
With Slotted Actions, an Action's `idroot` should always be zero,
corresponding to "unspecified". However, there was still some old
leftover code that, when duplicating an Action via the Action Editor,
would set the new Action's `idroot` to either OB or KE, depending
on the editor mode.

In addition to now being incorrect, this was also tripping an assert
elsewhere in the code when trying to then assign that duplicate action
to an ID.

This commit simply removes the outdated code, which is no longer needed,
leaving the `idroot` as the default (unspecified).

Pull Request: https://projects.blender.org/blender/blender/pulls/131601
2024-12-09 15:16:38 +01:00
Sybren A. Stüvel
bf9eb57554 Anim: Fix bug in Action Slot auto-assignment code
The generic Action assignment function tries to find a slot to
auto-assign. This would always look at the last-used slot identifier on
the ID's `AnimData` struct, even when assigning to an NLA strip or
Action constraint.

This commit removes the `Action::find_suitable_slot(ID)` method, and
replaces it with a `generic_slot_for_autoassign(ID, action,
last_slot_identifier)` function. That function basically copies the
behaviour of `find_suitable_slot()`, except that it gets the
`last_slot_identifier` from the caller.

Another difference is that it no longer checks whether the Action is
already assigned, and so also never uses the currently-assigned slot
handle. In the only code flow that calls `generic_slot_for_autoassign()`
this situation would never occur, and thus it's better to delete this
dead code.

Pull Request: https://projects.blender.org/blender/blender/pulls/131491
2024-12-09 14:48:14 +01:00
quackarooni
ea8c45e10a Nodes: remove labels and use placeholder in Attribute Node
It's a relatively common occurrence to run out of space for the property name
when using the Attribute Node, making it unreadable. A big part of this space is
eaten up by the labels, especially since the space they take up scales up with
the node width.

It can be argued that the info provided by the labels (`Type:` & `Name:`), are
superfluous and not essential. Removing them does not make the node harder to
use, and frees up more space for the user to type longer property names.

This is quite similar to changes done in #127992 for Geometry Nodes.

Pull Request: https://projects.blender.org/blender/blender/pulls/131543
2024-12-09 14:47:40 +01:00
Jacques Lucke
745b93062c Fix: crash adding node input without identifier
This is the same fix as in 680dbe70ae.
2024-12-09 14:15:07 +01:00
Pratik Borhade
03b2fc744e Grease Pencil: Add layer channel color property
This adds a `channel_color` property to layers.
The color is stored in the tree nodes.
It's currently used by the dopesheet for the channel colors.

Resolves #130370.

Pull Request: https://projects.blender.org/blender/blender/pulls/130512
2024-12-09 14:11:29 +01:00
Jacques Lucke
b6e1afb6e1 Fix #108719: correct link is shown as invalid
The issue was that the links was tagged as invalid for one render engine,
because it does not support the output pass. However, switching back
to Cycles did not make the link valid again.
2024-12-09 14:05:07 +01:00
Jacques Lucke
4a0be9ed1a Fix #130741: link_limit is 1 for multi-input sockets 2024-12-09 13:48:55 +01:00
Campbell Barton
a4f67e5958 Cleanup: revert channel-bag hyphenation & add to the dictionary
The combind terms are preferred by the animation team.
2024-12-09 23:44:23 +11:00
Jacques Lucke
205d480219 Fix #131598: handle missing linked data blocks in Geometry Nodes modifier 2024-12-09 13:42:47 +01:00
Jacques Lucke
289962911c Fix #131577: missing node tree updates after duplicating tree 2024-12-09 13:42:47 +01:00
Aras Pranckevicius
074df4ceeb GPU: ensure viewport does not use uninitialized images (#119685 and others)
GPUViewport is creating a bunch of framebuffer textures for itself, but
some space types never initialize/use them. E.g. Sequencer, Nodes etc.
only ever use the "overlay" texture. Eventually when viewport is
"drawn", it combines this uninitialized texture data and then only by
luck it happens that most of the time it is black. But not always!

The textures were only cleared (right now) on Metal backend, under
GPU_clear_viewport_workaround as if it was some driver workaround. Stop
doing that, and just clear them always.

However, there was seemingly a performance issue on OpenGL, when this
clear was being done. At least on my machine (Win10, Geforce RTX
3080Ti), the overhead of doing the clears is measurable, and is caused
by usage of GL4.4 glClearTexImage instead of a framebuffer clear. As if
glClearTexImage makes "pixel data to exist" on the CPU side and then
later on binding this framebuffer sends off that data to the GPU, or
somesuch.

More details in the PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/131518
2024-12-09 13:23:18 +01:00
Sybren A. Stüvel
e909a17554 Anim: when creating action slot by keying, name it after last-used slot
When a new Action slot is created by keying a property, it is now
named after the last-assigned slot. This is in support of the
following scenario:

- Action `A` is assigned, with slot `Legacy Slot`.
- The slot is renamed to `Main Light`, because that's what being
  animated by it.
- Animator wants to try an alternative animation, and unassigns the
  Action.
- Animator starts keying the light, which creates Action `B` and a
  slot.
- This slot is now also named `Main Light`, independently of the
  actual name of the light being animated.
- Animator can switch between actions `A` and `B`, and because the
  slots have the same name, the auto-assignment Just Works™.

Pull Request: https://projects.blender.org/blender/blender/pulls/131600
2024-12-09 12:57:06 +01:00
Laurynas Duburas
b68be2aedd Fix #131451: Crash moving Grease Pencil points
Proportional editing expects `IndexMask` from all Bezier points not only from selection as it affects not only selected curves.
Therefore `selected_editable_strokes` changed `editable_strokes` and initialized with `retrieve_editable_strokes`.

Pull Request: https://projects.blender.org/blender/blender/pulls/131519
2024-12-09 12:48:02 +01:00
Lukas Tönne
0d8f040c8b Fix #130945: Grease Pencil: Crazyspace support in sculpt mode
Grease Pencil v3 did not have crazyspace support yet. Without this sculpting on
deformed geometry (e.g. on top of an armature modifier) will yield incorrect
offsets because the tool writes to original data based on deformed positions.

This patch adds computation of local deformation matrices which are stored in
the `GeometryComponentEditData`. Those matrices are then used to convert local
deformation of the evaluated geometry back to a deformation of the original
geometry. All the relevant sculpt tools support the crazyspace correction now,
using the `compute_orig_delta` helper function.

Computing the deformation matrices should happen alongside modifier evaluation
for any deforming modifier. This has been implemented for the armature modifier,
others can be added.

A fallback implementation for curves could also be added for modifiers that
don't have an easy way to calculate local transformation. A "natural"
orientation for both the original and deformed positions is calculated, then the
difference yields deform matrices. For meshes the approach is to use the surface
normal and a stable tangent space. For curves the common local coordinate frame
based on parallel transport might be used.

Currently crazyspace correction for the _Clone_ tool does not work because of
#131496.

Pull Request: https://projects.blender.org/blender/blender/pulls/131499
2024-12-09 12:33:44 +01:00
Sean
46cd7afcda Grease Pencil: "Set Start Point" operator
Adds back the operator to change the start point on cyclical strokes.
Behaves the same way as in 4.2.

Pull Request: https://projects.blender.org/blender/blender/pulls/128540
2024-12-09 11:04:16 +01:00
Clément Foucault
695620120b Fix #131588: Workbench: Missing or frozen geometry when AA is disabled
The view was not synced when AA was turned off.
2024-12-09 10:55:22 +01:00
Laurynas Duburas
cfa63bfefa Fix #130688: Grease Pencil: Multiframe Editing not applying falloff curve
Mutliframe editing wasn't using the falloff.

The fix adds a new field `Vector<float> grease_pencil_falloffs` to
`struct CurvesTransformData`. References it's values with `TransData.extra`.

Pull Request: https://projects.blender.org/blender/blender/pulls/131147
2024-12-09 10:40:08 +01:00
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