Commit Graph

120055 Commits

Author SHA1 Message Date
notrudyyy
8d11882d07 Fix #128257: Crash when using Set Vertex Colors with no brush
The issue is due to a null pointer dereference in the call to
`IMB_colormanagement_srgb_to_scene_linear_v3` in
`vpaint_get_current_col` in `paint_vertex.cc`.
`BKE_paint_brush_for_read` returns a null pointer and as a result
`brush_color` points to the zero page, thus causing a null pointer
dereference and hence the access violation exception.

Normally, users should not be able to have no brush selected inside
vertex paint mode. Instead of adding null checks everywhere, this
commit protects against this case by switching the poll method to
check for a brush before allowing execution.

Pull Request: https://projects.blender.org/blender/blender/pulls/128260
2024-10-01 00:04:53 +02:00
quackarooni
44fbd69317 Function Node: Value to String Integer subtype
This patch adds an `Integer` type to the Value to String node.
This allows for converting integer inputs into string outputs without
any loss of precision. Something which the original implementation is
not able to do.

This issue becomes evident at values greater than `2 ^ 24` or
`16,777,216`, where the precision loss is high enough that the float
implementation starts skipping certain integers.

Pull Request: https://projects.blender.org/blender/blender/pulls/128362
2024-09-30 23:10:41 +02:00
Harley Acheson
89d7f00ff8 UI: Fix Editor Highlight Top Bar
New editor highlighting (#116684) will sometimes highlight a nearby
area when hovering over the Top Bar. This is caused by the use of the
top-left corner for testing. This just uses the region midpoint
instead.

Pull Request: https://projects.blender.org/blender/blender/pulls/128394
2024-09-30 22:17:56 +02:00
Colin Basnett
22d78c5a8e Geometry Nodes: add Matrix Determinant node
Pull Request: https://projects.blender.org/blender/blender/pulls/128212
2024-09-30 21:30:10 +02:00
Jacques Lucke
8f30c25207 Geometry Nodes: add panel for generated geometry on foreach zone
The panel makes the separation of the main geometry and generated geometry
outputs more obvious.

Pull Request: https://projects.blender.org/blender/blender/pulls/128382
2024-09-30 21:28:20 +02:00
Sean Kim
71033685f6 Fix #128272: Plane Trim applies to incorrect vertices
Missed in 68ef1d6f36

Affects all brushes that use the Plane Trim option:
* Clay Strips
* Multiplane Scrape
* Flatten
* Fill
* Scrape

Pull Request: https://projects.blender.org/blender/blender/pulls/128391
2024-09-30 21:20:40 +02:00
Jacques Lucke
f97fb87212 Cleanup: make utilities for node warnings more reusable 2024-09-30 21:18:08 +02:00
Harley Acheson
5bb7f06409 Fix #127825: Do Not Clear Recent Item If File Not Found
When attempting to load a blend file that is not found or otherwise
invalid we are currently showing an (ugly) popup menu report and then
clearing the item from the Recent Files list. Clearing the list could
be unwanted in the case of files that are temporarily offline. And we
now have the ability to only clear "Items not found" using the "Clear
Recent Files List" operator. This PR removes that clearing.

Pull Request: https://projects.blender.org/blender/blender/pulls/127882
2024-09-30 21:03:09 +02:00
Jacques Lucke
ee348d2bff Fix: missing grease pencil data after duplicate elements or realizing instancecs 2024-09-30 18:31:36 +02:00
Omar Emara
60bb3b6677 Fix #124737: Scale To Render size is not precise
The Scale node in the Scale To Render size mode is not precise in case
of the use of render size percentage. This is due to floating point
imprecisions and we mitigate it by rounding instead of flooring after
multiplying by the percentage.
2024-09-30 18:58:13 +03:00
Pablo Vazquez
d601c21f2f UI: Use Grease Pencil object icon for Dope Sheet
Use the Grease Pencil object icon for the mode selector in Dope Sheet.

Pull Request: https://projects.blender.org/blender/blender/pulls/128385
2024-09-30 17:57:20 +02:00
Omar Emara
1b392ef016 Fix #127093: Kuwahara node produces NaNs
The Kuwahara node produces NaNs if the pixels have a very high local
standard deviation and sharpness is also high. This is because the
weighted sum of the Kuwahara sectors can have a zero total weight, which
causes zero division. To fix this, we return the original color if the
total weight is zero.

Pull Request: https://projects.blender.org/blender/blender/pulls/128378
2024-09-30 17:29:44 +02:00
Bastien Montagne
60908e8819 Refactor: Move bone eyedropper to C++ allocation.
Similar to what was already done for all other eyedroppers a few weeks
ago, part of pre-steps to make PointerRNA non-trivial.
2024-09-30 16:37:11 +02:00
Julian Eisel
88085accf7 Fix: Missing fill tool default brush in grease pencil draw mode
Apparently the name of the default fill brush in the essentials asset
library was changed in 9dfd0a171f.
2024-09-30 16:23:32 +02:00
Falk David
4c17ccbf56 GPv3: Add functions to copy parameters of layers and groups
Adds `BKE_grease_pencil_copy_layer_parameters` and
`BKE_grease_pencil_copy_layer_group_parameters` to copy
the parameters of layers and layer groups without copying
the data.
2024-09-30 16:20:43 +02:00
Falk David
be3e5e979f GPv3: Add function to copy GreasePencil parameters
Adds a kernel function to copy only the `GreasePencil` parameters
and not the layer tree or drawings.
2024-09-30 16:20:43 +02:00
notrudyyy
fcc263162d Fix #128087: EEVEE: Position render pass not in viewport shading panel
Adds Position Render pass to Render Pass enum in Viewport Shading popup for EEVEE.

Pull Request: https://projects.blender.org/blender/blender/pulls/128136
2024-09-30 16:20:14 +02:00
Julian Eisel
2a1004f7af Fix #128335: Activating brush from asset shelf sets tool, but not brush
We'd first set the brush, then change tools, which would again set the
brush to what it was before (switching tools tries to remember its last
used brush). Instead, switch the brush after switching the tool.

Also added a brush API check to test if the brush is valid for the
current mode, so that we don't end up switching tools in that case. This
matches previous behavior where this would be checked as part of setting
the brush already, causing the function to early exit before the tool is
changed.
2024-09-30 16:19:06 +02:00
Jacques Lucke
f839266b78 Geometry Nodes: support dynamic sockets and separators in panels 2024-09-30 16:07:36 +02:00
Omar Emara
161b110746 Fix #127372: Alpha Over has unexpected output size
The Alpha Over node has an unexpected output size in GPU mode. If the
Factor and first Image inputs were connected to the same output, the
size of the output will assume the size of the second Image input, even
though the first Image input has a higher domain priority.

That's because the Alpha Over node is compiled into a Shader Operation
which has a single operation input for all inputs connected to the same
output, but only the domain priority of the first input was considered,
so in the case of the Alpha Over node, the domain priority of the Factor
input was assumed, ignoring the priority of the first Image output.

To fix this, we consider the priority of all inputs connected to the
same output, and assume the highest priority of all.

Pull Request: https://projects.blender.org/blender/blender/pulls/128366
2024-09-30 15:46:09 +02:00
Jacques Lucke
7b79191594 Geometry Nodes: prefer float math node even for integer sockets in link-drag-search
The problem with the Integer Math node is that it is less flexible in common
cases because the other input has to be an integer too. There is no simple way
to switch the node to be a Float Math node (yet), so better insert that
directly. Using the Integer Math node is a more explicit choice now.

Searching for e.g. `iadd` prioritizes the Integer Math node thanks to prefix
search.

Pull Request: https://projects.blender.org/blender/blender/pulls/128370
2024-09-30 15:44:26 +02:00
Jacques Lucke
02ada0d064 Geometry Nodes: use shorter linear gizmo when using box shape
This solves an issue when both linear gizmos happen to be at the same position.
In this case the gizmos became fairly unusable because they overlapped a lot.
They can still overlap of course, but it's more likely that they start at the
same position than that they end at the same position.

Note, when using a transform gizmo, the collision between the scale and
translate gizmo is resolved already. The issue only happens when two independent
Linear Gizmo nodes are used.

Pull Request: https://projects.blender.org/blender/blender/pulls/128371
2024-09-30 15:43:20 +02:00
Sybren A. Stüvel
d58176e1e0 Anim: fix bug in action.fcurves.clear() corrupting F-Curve groups
Calling `action.fcurves.clear()` would clear the F-Curves, but didn't
update the F-Curve groups. This meant that the groups data still had their
original length & offsets into the F-Curves array, causing subsequent
F-Curve creation to crash Blender.

The unit test for this also covers the previous commit.

Pull Request: https://projects.blender.org/blender/blender/pulls/128375
2024-09-30 15:42:58 +02:00
Sybren A. Stüvel
420082d4fe Anim: Fix issue with key insertion for array_index=-1
Fix an issue where Python's `rna_struct.keyframe_insert(path, index=-1)`
would not create any keys. This was caused by the new layered animation
code not taking -1 as an 'all array elements' wild-card.

The accompanying unit test will follow in another commit, as its success
depends on another bugfix as well.
2024-09-30 15:42:57 +02:00
Pablo Vazquez
6b3ce7d664 UI: Graph Editor: Use outline for Y values shadow
Replace the blur shadow on vertical values in the Graph
Editor with an outline to improve readability.

Pull Request: https://projects.blender.org/blender/blender/pulls/128374
2024-09-30 15:42:29 +02:00
Jacques Lucke
675606cbce Fix: wrong enum type in integer math node 2024-09-30 15:40:27 +02:00
Jacques Lucke
fc2b9e3a6b Cleanup: deduplicate switch over socket types to create declarations 2024-09-30 15:39:11 +02:00
Jacques Lucke
267c40db66 Fix #128373: conditional socket visibility in Mesh Line node not working
This was broken by 8027720e51 because
we forget to update the label in the declaration.

This is now reverted for the Mesh Line node, because there is no way to
change the label in the declaration yet. A new patch can be created that properly
updates the Mesh Line node to use the declaration.
2024-09-30 14:54:22 +02:00
Sergey Sharybin
437ca00f92 Fix: Potential memory leak in IK solver
It is possible to have IK solver without actual bones. There was a relation
created for this case, but it was originating from a wrong operation: it
was possible to run into situation when init is not yet done, but cleanup
is already run.

Fix the relation which ensures the order to go from IK initialization and
not the pose initialization. This should ensure proper cleanup order.
There is a relation from pose initialization to IK initialization so this
change should not cause any missing relations.

This should fix the intermittent failure of blendfile_versioning_1_over_8.

Pull Request: https://projects.blender.org/blender/blender/pulls/128267
2024-09-30 14:53:11 +02:00
Falk David
dfc69eb750 Fix: GPv3: Issues in BKE_grease_pencil_nomain_to_grease_pencil
* Handle the case where `drawing_array_num` is 0.
* Reset the pointer of the active node (because it is no longer valid)
* Cleanup copy-paste error in docstring
2024-09-30 14:48:45 +02:00
Alaska
6c52e4752f Fix #128113: Incorrect display of facing overlay on transparent textures in solid mode
Use DRW_STATE_DEPTH_EQUAL when we know the correct
depth buffer values are available

Pull Request: https://projects.blender.org/blender/blender/pulls/128163
2024-09-30 14:35:42 +02:00
Jacques Lucke
d8319f6f50 Fix: Geometry Nodes: propagate gizmo values through muted nodes 2024-09-30 14:34:51 +02:00
Pratik Borhade
45813afbc0 GPv3: Show select operators in vertex paint mode
They are greyed out due to wrong poll function.

Pull Request: https://projects.blender.org/blender/blender/pulls/128364
2024-09-30 14:31:27 +02:00
Pratik Borhade
6d8e642367 GPv3: Increase minimum rows in layers panel
There is empty space between the layers panel and the properties below.
Increase minimum rows to remove the empty area.

Pull Request: https://projects.blender.org/blender/blender/pulls/128368
2024-09-30 14:30:33 +02:00
Laurynas Duburas
71098ce904 Overlay-Next: Add NURBS edit handles
Draws NURBS edit handles in Overlay-Next.

Rel #102179

Pull Request: https://projects.blender.org/blender/blender/pulls/128093
2024-09-30 14:27:21 +02:00
Clément Foucault
d401b36509 GPU: Metal: Fix background render crash
GHOST_CreateSystemBackground was not being
followed by the now mandatory GPU_backend_ghost_system_set
2024-09-30 14:20:12 +02:00
Jacques Lucke
5163af816d Fix: Geometry Nodes: propagate edit data through foreach zone
Without this, gizmos don't work in some cases.
2024-09-30 14:14:22 +02:00
Jacques Lucke
1b31a44935 Geometry Nodes: support inverse evaluation for Integer Math node for gizmos 2024-09-30 14:00:32 +02:00
Laurynas Duburas
e40c9b414a Overlay-Next: Attribute viewer
Rel #102179

Pull Request: https://projects.blender.org/blender/blender/pulls/127772
2024-09-30 13:55:05 +02:00
Omar Emara
412e07173f Fix #127243: Crash when viewing invalid images
Blender crashes when viewing invalid images in the compositor. That's
because cached images will not be null, but will be unallocated, so to
fix this, we check allocation status as well as nullptr in the image
node.
2024-09-30 14:42:47 +03:00
Clément Foucault
a39a966328 Overlay-Next: Fix glitches with the grid
The vertex array was allocating uninitialized memory.
This fixes the API usage mistake and do the
intended reserve call.
2024-09-30 13:05:02 +02:00
Clément Foucault
5c42dd3ae7 Overlay-Next: Fix wrong uniform size error 2024-09-30 13:05:01 +02:00
Julian Eisel
9c519d8b69 Fix #128349: Right clicking a sculpt brush in tool settings crashes
Getting the active tool from context doesn't work exactly when executed
from the properties editor, which shows the active tool settings of the
3D view. Make the brush tool code fallback to the active tool from the
3D view, so it can be called from the properties.
2024-09-30 12:43:43 +02:00
priera
ce7667f3b1 GPv3: Join Operator
Adds the `Join` operator in edit mode to connect the selected strokes
by their endpoints.

Resolves #113582 and #113570.

Pull Request: https://projects.blender.org/blender/blender/pulls/117916
2024-09-30 12:16:40 +02:00
Jeroen Bakker
91eac6c771 Cleanup: Make format 2024-09-30 12:07:18 +02:00
Jeroen Bakker
ac24912736 Fix #128315: EEVEE: Uneven cryptomatte levels
When using uneven cryptomatte levels the number of cryptomatte layers
weren't sufficient due to rounding error.

Issue should be backported to 4.2

Pull Request: https://projects.blender.org/blender/blender/pulls/128358
2024-09-30 12:04:44 +02:00
Sybren A. Stüvel
2d5591b63f Cleanup: mark unused variables as such
Mark two `unassign_ok` variables as unused in non-debug builds. They're
only checked in `BLI_assert` calls.

No functional changes.
2024-09-30 11:59:45 +02:00
Sybren A. Stüvel
259091363f Refactor: Anim, remove use of MutableSpan in layered Actions C++ wrappers
Users of the layered Actions API should never mutate the data via these
spans, and so the functions should always return just a `Span<>`.

No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/128264
2024-09-30 11:51:14 +02:00
Jason Fielder
eb3fe75392 Metal: Add support for parallel compilation and precompilation specialisation
This speeds up EEVEE startup and material compilation time.

Authored by Apple: James McCarthy
Pull Request: https://projects.blender.org/blender/blender/pulls/125657
2024-09-30 11:21:28 +02:00
Jacques Lucke
13391c14d8 Spreadsheet: use more obvious fallback name for geometries
Instead of `Geometry`, the fallback name is now `(Geometry)`. The goal is to
make it more obvious that this is not the actual name, but just a fallback. With
some luck it also motivates people to use better custom names.

The same thing is done for grease pencil layer names.

Pull Request: https://projects.blender.org/blender/blender/pulls/128207
2024-09-30 11:18:01 +02:00