Commit Graph

115670 Commits

Author SHA1 Message Date
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
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