Commit Graph

114870 Commits

Author SHA1 Message Date
Omar Emara
aff8a8878f Fix: Zero division in Corner Pin node
Points at infinity in the Corner Pin node causes zero division, so
early exit with a zero.
2024-11-12 16:27:29 +02:00
Clément Foucault
df07e91dff Fix: Overlay: Assert when using selection
Caused by copying texture content to a texture
with different format.
2024-11-12 15:25:55 +01:00
Falk David
bbcece38ba Merge branch 'blender-v4.3-release' 2024-11-12 15:12:51 +01:00
Falk David
43fde8c39c Fix: #130045: Crash in length modifier with 2 point curves
The length modifier was not handling 2 point curves correctly.

This change does two things:
1) Fix the crash by copying the original indices for 2 point curves into `dst_to_src_point`.
2) Fallback to `extend_curves_straight` for extending 2 point curves.

Pull Request: https://projects.blender.org/blender/blender/pulls/130122
2024-11-12 15:11:59 +01:00
Falk David
c8211b23c7 Refactor: Add CurvesGeometry::is_empty() function
Previously, some places used `curves.points_num() == 0` some other
places `curves.curves_num() == 0` to check if the geometry is empty.

Rather than having these two ways, add an `is_empty()` function
that replaces all these different checks.

Also update the curves geometry tests to use this function.

Pull Request: https://projects.blender.org/blender/blender/pulls/130168
2024-11-12 14:46:24 +01:00
Falk David
0a51b9a357 Merge branch 'blender-v4.3-release' 2024-11-12 14:45:19 +01:00
Pratik Borhade
22d94df4cf Fix: GPv3: "Only In Multiframe" overlay not working
There were some issues in the code that sets up the draw calls.
The `only_lines` option needs to consider multi frame editing.

Resolves #129873.

Pull Request: https://projects.blender.org/blender/blender/pulls/129944
2024-11-12 14:44:31 +01:00
Clément Foucault
642933ffe6 Metal: Guard advanced vertex format against newer osx version
Fixes a build error on older macos.
2024-11-12 13:06:15 +01:00
Clément Foucault
b17af94e2e EEVEE: Use packed type for codegen structs
This reduces register pressure on mac.

Mr Elephant 17.9s > 17.2s (4% speedup)

Extracted from #116728

Pull Request: https://projects.blender.org/blender/blender/pulls/129605
2024-11-12 12:58:58 +01:00
Omar Emara
3f2f3cb08d Merge branch 'blender-v4.3-release' 2024-11-12 13:54:31 +02:00
Omar Emara
a0cfb0b142 Fix #130134: Double Edge Mask uses too much memory
The Double Edge Mask node uses too much memory when it is not connected
to anything in the Full-Frame compositor. That's because it tries to
allocate a buffer of size 131072x131072, which is due to the cumulation
of multiple issues.

1. The Full-Frame compositor evaluates nodes that are not connected to
   the output.
2. The constant folder assigns a bounds of +-65536 to its output memory
   buffers as a maximum possible value.
3. Then the MemoryBuffer::inflate method doesn't know about the constant
   folder special value, so it tries to allocate a buffer of that size.

The safest fix for now is to clear the output and return early if all
inputs are single value.

The problem is that this issue might happen for other nodes that also
satisfy the 3 issues above, that is, uses inflate and can be constant
folded. I manually checked for such nodes and there are no nodes that
satisfy all three, so hopefully this is isolated to the Double Edge Mask
node.

Pull Request: https://projects.blender.org/blender/blender/pulls/130163
2024-11-12 12:53:23 +01:00
Omar Emara
d787922df9 Compositor: Implement Plane Deform for new CPU compositor
Reference #125968.
2024-11-12 13:48:26 +02:00
Omar Emara
741c7d8a8a Compositor: Implement EWA filtering for new CPU compositor
Reference #125968.
2024-11-12 13:46:01 +02:00
Omar Emara
9d82daefdd Fix: Zero division in Plane Deform node
Points at infinity in the Plane Deform node causes zero division, so
early exist since they needn't be accumulated.
2024-11-12 13:44:01 +02:00
Pratik Borhade
bf7cd4f975 Merge branch 'blender-v4.3-release' 2024-11-12 16:40:27 +05:30
Pratik Borhade
4e907829d3 Fix #128099: Outliner isolate collection tweaks linked data
Mistake in e494a44024
Even though collection/object PointerRNA argument is same in most cases,
use `layer_or_collection_prop` in if() before assigning value to
collection property (`base_or_object_prop`argument value is  null in function
call from `_isolate_flag()`).

Pull Request: https://projects.blender.org/blender/blender/pulls/129250
2024-11-12 12:07:59 +01:00
Falk David
0e37d6fd3d Merge branch 'blender-v4.3-release' 2024-11-12 11:57:45 +01:00
Falk David
32c76ee768 Fix: GPv3: Unused parameter in remove_from_vertex_group
Caused by 5585d29d30.
Forgot to remove the parameter.
2024-11-12 11:56:59 +01:00
Pratik Borhade
5585d29d30 Fix: GPv3: Vertex group functions edit all keyframes
Instead of looping through all drawings in the vertex group kernel
function, loop through all/visible drawings in the operators and
pass a single drawing to `remove_from_vertex_group`.

Continuing !129789.

Co-authored-by: Falk David <falk@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/129890
2024-11-12 10:44:59 +01:00
Campbell Barton
4306e746a5 Fix #129630: Inconsistent marker selection
- Modifications for marker selection to use the same behavior as
  key selection in the dopesheet.
- Animation editors now mask out events for the timeline (when there are markers).
- Resolve logical conflicts with the Dope sheet keymap.
- Add Shift Drag & Ctrl Drag for box select & de-select.

Pull Request: https://projects.blender.org/blender/blender/pulls/129841
2024-11-12 10:37:51 +01:00
Falk David
f28bbfc702 Merge branch 'blender-v4.3-release' 2024-11-12 10:22:32 +01:00
Sybren A. Stüvel
ae5717905b Fix #130090: Grease Pencil object in NLA cause Blender to crash
Add some missing `nullptr` and `ale->type` checks to ensure the
assmptions the rest of the code makes holds.

The direct cause of this issue is likely
822907a68d. The root cause is the hard to
predict behaviour of the animation filtering system combined with a lot
of pointer casts without testing whether the data is actually of the
expected type.

Pull Request: https://projects.blender.org/blender/blender/pulls/130148
2024-11-12 10:19:27 +01:00
Omar Emara
b98185a035 Fix: Anti-Alias node produces wrong value when unlinked
The Anti-Alias node produces wrong values when unlinked due to a switch
case that mistakenly fall-through.
2024-11-12 07:49:51 +02:00
Colin Basnett
aa0ffb04f9 Fix: Outliner not immediately updated when parent bone property changed
This fixes an issue where the outliner would not be immediately
updated after changing the parent of a bone. The issue was simply
that the outliner was not being flagged to update in the callback
function.

Pull Request: https://projects.blender.org/blender/blender/pulls/129933
2024-11-12 04:57:37 +01:00
Pratik Borhade
1d14390f99 Fix #129297: Gizmo missing for unlocked layer when autolock inactive is on
`set_active_node` call from `grease_pencil_copy_data` resets inactive
layer again as locked before executing the drawing code. Since property
is only operated on layers, it is possible to remove the code from
`set_active_node()` and only have it in `set_active_layer()`.

Pull Request: https://projects.blender.org/blender/blender/pulls/129465
2024-11-12 09:09:28 +05:30
Sean Kim
406f259920 Merge branch 'blender-v4.3-release' 2024-11-11 11:05:59 -08:00
Sean Kim
009fb327ee Fix #130101: Boundary brush radius uses incorrect initial value
Introduced in 99c55bdbfb

Pull Request: https://projects.blender.org/blender/blender/pulls/130154
2024-11-11 20:02:36 +01:00
Hans Goudey
7d68a4ca14 Refactor: Sculpt: Shape key deformation consistency & deduplication
Make use of the struct and patterns from 005e02d008 to make
the view places that deform shape keys more similar. While they each are
slightly different for valid reasons, with this change they follow the
same structure and use the same helper struct.

Pull Request: https://projects.blender.org/blender/blender/pulls/129901
2024-11-11 19:35:24 +01:00
Hans Goudey
312052112a Cleanup: Remove references to legacy Grease Pencil type
See #123468.

Pull Request: https://projects.blender.org/blender/blender/pulls/130151
2024-11-11 19:11:03 +01:00
Falk David
4bf63b69f0 Merge branch 'blender-v4.3-release' 2024-11-11 18:43:57 +01:00
Jacques Lucke
3f3f8d315d Fix: don't show Geometry Nodes modifier gizmos for unselected objects
It's unexpected that the gizmos show for unselected objects.

Pull Request: https://projects.blender.org/blender/blender/pulls/130144
2024-11-11 18:42:53 +01:00
Clément Foucault
6e16447145 EEVEE: Add assertion that all random numbers are between 0 and 1
This ensures the result of the random number generator is
well defined and that we can trust the output to feed into
functions like `sqrt`.
2024-11-11 18:42:22 +01:00
Lukas Tönne
1158130995 Fix #129324: Merge Down operator always appends merged layers at the end
The Merge-Down operator for layers was inserting existing layers first,
then appending the 2 merged layers at the end (top of stack).

Now merged layers are inserted at the position of the layer below the
active, so the layer order remains unchanged.

Note that merging a layer group has a similar issue, with the new
layers getting appended at the top. This is a bit more difficult because
looping only over layers drops the relative ordering of groups and
layers. A separate fix is needed for that.

Pull Request: https://projects.blender.org/blender/blender/pulls/130146
2024-11-11 18:42:10 +01:00
Hans Goudey
70483bef74 Cleanup: Remove asset header include from BKE_context.hh
Trying to reduce the number of indirect includes.
2024-11-11 12:23:42 -05:00
Jacques Lucke
0d6d54d565 Fix: don't show Geometry Nodes modifier gizmos for unselected objects
It's unexpected that the gizmos show for unselected objects.

Pull Request: https://projects.blender.org/blender/blender/pulls/130144
2024-11-11 18:20:46 +01:00
Falk David
9323a646b3 Merge branch 'blender-v4.3-release' 2024-11-11 18:19:34 +01:00
Falk David
0d1d3d12ba Fix: GPv3: Inconsistent behavior when adding a layer group
When a layer group was active, new groups would be created at
the top of the layer tree which is inconsistent with how layers are
added.

This fixes the behavior. When a group is active, newly added groups
are moved into that group.
2024-11-11 18:18:47 +01:00
Falk David
753e6952b9 Fix: GPv3: Inconsistent behavior when updating the active node after removal
The code that was updating the active node after removing a layer/group
was not handling all cases correctly.

The fix updates the logic for setting the active node:
1. If the node is a non-empty group and we're keeping the children, then set
the active node to the top node in the group.
2. Otherwise, if the node has a node below it (in the same group), set it to be the active one.
3. Otherwise, if the node has a node above it (in the same group), set it to be the active one.
4. Otherwise, if the parent is not the root group, set the parent to be the active node.
5. Otherwise, clear the active node.

This behaves the same as in Krita.

Pull Request: https://projects.blender.org/blender/blender/pulls/130126
2024-11-11 18:18:24 +01:00
Pratik Borhade
9a59372f07 Fix #130034: GPv3: Deleting root layer group leads to crash
The code was relying on the layer cache through `groups_for_write`/`layers_for_write`.
The `group->runtime->layer_group_cache_` stores all the child groups instead
of groups on first level. This leads to crash when recursively deleting
group i.e. group at third level has been deleted but `layer_group_cache_`
of first level group will still point to address of freed memory.

The fix removes the use of the cache and iterates over the direct
children in `group.children` and deletes them recursively.

Pull Request: https://projects.blender.org/blender/blender/pulls/130082
2024-11-11 17:54:59 +01:00
Pratik Borhade
b0f05228f9 Fix #130034: GPv3: Deleting root layer group leads to crash
The code was relying on the layer cache through `groups_for_write`/`layers_for_write`.
The `group->runtime->layer_group_cache_` stores all the child groups instead
of groups on first level. This leads to crash when recursively deleting
group i.e. group at third level has been deleted but `layer_group_cache_`
of first level group will still point to address of freed memory.

The fix removes the use of the cache and iterates over the direct
children in `group.children` and deletes them recursively.

Pull Request: https://projects.blender.org/blender/blender/pulls/130082
2024-11-11 17:53:13 +01:00
Germano Cavalcante
2ddab48cab Merge branch 'blender-v4.3-release' 2024-11-11 13:42:42 -03:00
Germano Cavalcante
61f503a197 Fix: error in previous commit 2024-11-11 13:41:58 -03:00
Germano Cavalcante
d7ac528d53 Merge branch 'blender-v4.3-release' 2024-11-11 13:35:57 -03:00
Germano Cavalcante
fe37ede725 Fix: warning due to b4154c
No parentheses around comparison in operand of ‘==’ [-Wparentheses]
2024-11-11 13:34:59 -03:00
Hans Goudey
dd651ef5d6 Fix #130086: Weight/vertex paint non-deform modifiers wrong positions
The PBVH vertex positions accessor functions have to match the logic in
`sculpt_update_object`. When there were topology changing modifiers
before deform modifiers it didn't. `BKE_crazyspace_build_sculpt` just
skips the topology changing modifiers, and the resulting positions
are stored in `ss.deform_cos`, which we need to access here.

Pull Request: https://projects.blender.org/blender/blender/pulls/130139
2024-11-11 17:24:13 +01:00
Lukas Tönne
dbbacbffaf Merge branch 'blender-v4.3-release' 2024-11-11 17:12:17 +01:00
Lukas Tönne
9fb185d31d Fix #130066: Crash after joining Grease Pencil objects
The Join operator for Grease Pencil was making a shallow copy of the drawings
array, with the assumption that the source object would no longer be needed.
This is not the case, the source object is still in the blend data and still
shares the same drawings pointer as the target object. This is invalid, the
drawings should owned by one object.

To fix this the patch makes a deep copy of the drawings so the source and target
have their own sets of drawings. Data is still shared at the CustomData level,
so these copies are not very expensive.

Pull Request: https://projects.blender.org/blender/blender/pulls/130140
2024-11-11 17:10:26 +01:00
Hans Goudey
e88ac07046 Fix #130098: Sculpt sample detail operator crash on failure
Check the error status from the function that updates the active vertex.
Also add `PROP_HIDDEN` to the operator's properties so the redo panel
doesn't show; that seemed extra weird to display on failure.

Pull Request: https://projects.blender.org/blender/blender/pulls/130142
2024-11-11 17:06:22 +01:00
YimingWu
37ec4b5430 Fix #129883: GPv3: Build modifier frame timing is not correct
When the duration of a frame is shorter than the build time specified in
the modifier, build modifier should shorten the build time to allow the
frame to be fully built within the frame duration. This fix made the
timing behaviour the same as GPv2.

Pull Request: https://projects.blender.org/blender/blender/pulls/129894
2024-11-11 16:53:39 +01:00
Hans Goudey
c709b59539 Refactor: Use blender::Map for screen context lookup
This moves from `GHash` to the type-safe and better-performing `Map`.
It uses the construct on first use idiom to simplify creation and freeing
of the map, removing the need to register an at-exit callback.

The change was initially motivated by seeing the hash lookups in a profile
of drawing a large node tree. Though my testing wasn't exactly scientific,
I did observe a few percent performance improvement with this change.

Pull Request: https://projects.blender.org/blender/blender/pulls/129954
2024-11-11 16:29:20 +01:00