Commit Graph

120055 Commits

Author SHA1 Message Date
Jacques Lucke
82c6678c39 Merge branch 'blender-v4.1-release' 2024-03-12 13:33:18 +01:00
Jacques Lucke
b40a9ce60b Fix #114438: wrong undo after running node tool in mesh edit mode
I think the issue is that the run-node-group operator overwrites the data stored in the
`Mesh` while mesh edit mode operations typically only change the `BMEditMesh`. It
seems like that causes issues because the mesh edit mode undo stack does not
keep track of changes to the `Mesh`. When hitting undo, Blender assumes that the
`Mesh` stored in the object has not changed and therefore it does not have to be
read from the undo step again.

The preliminary fix implemented here is to just not change the `Mesh` but only the
`BMEditMesh` like any other edit mode operator. This seems to solve the issue.
I haven't quite figured out yet how to tell the undo system that the `Mesh` has to be
loaded from the undo step when undoing out of mesh edit mode. Doing that might
provide a better solution.

Pull Request: https://projects.blender.org/blender/blender/pulls/119015
2024-03-12 13:28:26 +01:00
Clément Foucault
a3d0145c93 GPU: Fix usage of char4 in opensubdiv shader
`char4` are defined as `int4` from now on. This
created a compiler error.
2024-03-12 12:46:52 +01:00
Pratik Borhade
40156dfba3 Fix #119309: Face Set from Visible crash with multires
Fix is same as 18912561b5 / 72d324bd81

Pull Request: https://projects.blender.org/blender/blender/pulls/119311
2024-03-12 16:37:07 +05:30
Howard Trickey
17b2ff6119 Refactor: rename files mesh_boolean_convert to mesh_boolean.
A follow-up to previous commit that moved these files to geometry.
The _convert suffix made sense at one point but is now just confusing.
2024-03-12 07:00:33 -04:00
Falk David
6a016ce255 Cleanup: Remove unnecessary check
fd92647f added an early return so now this check is no longer needed.
2024-03-12 11:25:48 +01:00
Falk David
fd92647f34 Fix: GPv3: Add missing check in get_mutable_attribute
The function didn't return early in case the domain was empty.
The fix makes sure we return an empty `MutableSpan` in this case
(add doesn't try to create a new custom data layer).
2024-03-12 11:16:59 +01:00
Campbell Barton
5fd64db1cf Merge branch 'blender-v4.1-release' 2024-03-12 16:39:59 +11:00
Campbell Barton
59cba89f1b Merge branch 'blender-v4.1-release' 2024-03-12 16:39:56 +11:00
Campbell Barton
1fa2a1a74d Fix error freeing bpy_struct sub-classes WITH_PYTHON_SECURITY enabled
Python's behavior changed since this feature was added causing the
object to be tracked when freed by Python's subtype_dealloc even
if Blender has not tracked the data. Detect this case and untrack
the object before freeing.
2024-03-12 16:37:36 +11:00
Campbell Barton
658ef7c730 Fix missing call to PyObject_GC_UnTrack WITH_PYTHON_SECURITY
Untrack all newly created objects, although this code-path only runs
when creating the type fails - which is an exceptional case.
2024-03-12 16:36:12 +11:00
Campbell Barton
6e497434ba Merge branch 'blender-v4.1-release' 2024-03-12 14:59:15 +11:00
Bill Spitzak
4b7cc5b660 Fix #46809: History gets rearranged in Python console
Lines in the history never change, each input line is added to the
end (unless it is a duplicate of the last item).
A new history_index member keeps track of where the up/down arrows have
moved in the history.

Preserved the previous down-arrow behavior of going to the item after
the one that was copied, this is useful in Python for re-entering a
multi-line block.

Ref !119356
2024-03-12 14:56:14 +11:00
Germano Cavalcante
e0c26a19e6 Fix #119305: Edge slide is not working properly
This is a improved solution compared to 20dbcd8814

Caused by 930b11b0fe.

When checking edges that share faces between them, the `find_best_dir`
method cannot use edges that were added in the current loop.
2024-03-12 00:29:00 -03:00
Habib Gahbiche
7512ca18e3 Cleanup: make format 2024-03-11 22:37:39 +01:00
Habib Gahbiche
4231eb482f Fix Flip Node producing corrupt image when used with Translate Node
Previously, all information outside the render area did not get considered because transform operations such as translation and rotation might cause the output area to be smaller.

In this patch, the whole image gets flipped regardless of the output area, which makes the behavior consistent with the GPU compositor.

Pull Request: https://projects.blender.org/blender/blender/pulls/119278
2024-03-11 22:29:43 +01:00
Habib Gahbiche
f64d02ecb1 Fix CPU Compositor: Translate node with wrapping enabled produces corrupt image
Rendering with F12 causes some inconsistencies between canvases and areas of interest. This is due to some corrections of composite node canvas to fit to the render size, which are not necessary for the Viewer Node. This patch fixes the issue by considering the input image as a whole before translating.
Note: this is still consistent with immediate realization of transform nodes in GPU compositor, where nodes are to be evaluated from left to right.

Pull Request: https://projects.blender.org/blender/blender/pulls/119276
2024-03-11 22:08:49 +01:00
Lukas Tönne
054ef616ce Fix #117997: Crash trying to copy vertex group attributes as spans
Grease Pencil provides custom vertex group attributes as VArrays that
are a view on the `MDeformVert` buffer. These attributes are not spans,
which the curve conversion code was expecting. Non-span VArrays must be
materialized first.

Pull Request: https://projects.blender.org/blender/blender/pulls/119212
2024-03-11 20:52:14 +01:00
Hans Goudey
958eeea9a8 UI: Small fixes in tool settings property descriptions 2024-03-11 15:34:10 -04:00
Hans Goudey
68ac54bbcc Fix #119250: Python: World matrix for newly created objects is not identity
Initialize these like other fields in the object runtime struct.
2024-03-11 15:34:10 -04:00
Jacques Lucke
d6829fa7cc Merge branch 'blender-v4.1-release' 2024-03-11 19:49:34 +01:00
Jacques Lucke
9feb02e9ad Fix #113170: node editor background color affects node panel color
The offset `-15` that's passed to `UI_GetThemeColorShade4fv` is chosen so that the color
stays almost the same in the default theme.

Pull Request: https://projects.blender.org/blender/blender/pulls/119283
2024-03-11 19:47:52 +01:00
Hans Goudey
6f4718242e Fix #119304: Assert copying transform data in OBJ and STL export 2024-03-11 14:36:36 -04:00
Jacques Lucke
b4e3a00cd3 Merge branch 'blender-v4.1-release' 2024-03-11 19:35:26 +01:00
Jacques Lucke
c5443ec80d Fix #90999: crash when converting volume grid with high indices to dense volumes
There seems to be an integer overflow in OpenVDB code. For now just avoid rendering
the volume when the indices are very large, which is an extreme case anyway.

Pull Request: https://projects.blender.org/blender/blender/pulls/119279
2024-03-11 19:34:57 +01:00
Hans Goudey
dc9249c97f Fix #110562: Crash animating node property affecting socket visibility
For various reasons, the animation system can't properly update the node tree
so that the socket availability caused by changing node enum properties
propagates completely. So animating node properties that affect
socket visibility to change isn't possible without issues like crashes.
Unfortunately that wasn't disallowed before. In this commit there is
a balance of disabling animation on sockets that could reasonably expected
to affect socket visibility, and minimizing breaking changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/119221
2024-03-11 19:26:58 +01:00
Hans Goudey
23ebc45f70 WM: Add dynamic callback version of operator "depends on cursor" flag
For node tools, I would like to give the option of invoking the operator from the
menu, but waiting for a mouse click for the future "Mouse Position" node. Not
all node tools should do that though, and they all use the same operator type,
so it needs to depend on an operator callback. That's implemented here.

Pull Request: https://projects.blender.org/blender/blender/pulls/118983
2024-03-11 19:23:16 +01:00
Jacques Lucke
b33ec06283 Merge branch 'blender-v4.1-release' 2024-03-11 19:18:07 +01:00
Iliya Katushenock
bca31c3846 Fix: handle cyclic links when detecting dangling reroutes
Fix of error from 95810eec8f

Pull Request: https://projects.blender.org/blender/blender/pulls/119335
2024-03-11 19:17:27 +01:00
Howard Trickey
70fa3becad Refactor: Move mesh_boolean_convert from blenkernel to geometry.
Header file is renamed to GEO_mesh_boolean_convert.cc and
files that included it are updated to use that path.
This is in preparation for bigger changes to the internal
boolean API, which make more sense as a "geometry" API
than a kernel API.

Pull Request: https://projects.blender.org/blender/blender/pulls/119336
2024-03-11 18:17:57 +01:00
Harley Acheson
1f1fbda3ee UI: template_ID button Width Minimums
Use the prior fixed button widths as minimum sizes for the template_ID
new and open buttons. That way they will look the same as before under
most circumstances but will still adjust rather than overflow for
longer content or larger text sizes.

Pull Request: https://projects.blender.org/blender/blender/pulls/119330
2024-03-11 17:31:04 +01:00
Sybren A. Stüvel
c7e4365d7a Merge remote-tracking branch 'origin/blender-v4.1-release' 2024-03-11 17:16:32 +01:00
Sean Kim
1df10d0d25 Fix #119014: Crash on keymap editing for Mac
Due to differences with the libc++ std::sort implementation that has a strong
requirement on strict weak ordering.

Pull Request: https://projects.blender.org/blender/blender/pulls/119189
2024-03-11 16:31:08 +01:00
Germano Cavalcante
976a8012d1 Fix: wrong conditional check in 'transform_mesh_edge_slide_data_create' 2024-03-11 12:25:06 -03:00
Germano Cavalcante
fcfce8f69f Fix: unhandled empty Optional in 'bounds_min_max()'
Snap for meshes without vertices raised an error in debug build.
2024-03-11 12:25:06 -03:00
Hans Goudey
f6f767b879 Cleanup: Rename "me_eval" to "mesh_eval"
Similar to 854cdd1180
2024-03-11 11:21:18 -04:00
Sebastian Parborg
013cd3d1ba Fix: Remove duplicate image_add operators in the 3D view port
As part of #118623, we discovered that the operator used for adding images in the 3D viewport was not the same when drag and dropping as when adding it from the add menu. This lead to different and potentially confusing behaviour for the user when they use both.

This patch removes the python operator and unifies the functionality into one operator. It also renames the operator to be in line with the other "Add X" object operators.

Pull Request: https://projects.blender.org/blender/blender/pulls/118973
2024-03-11 16:18:25 +01:00
Jacques Lucke
4d0936c7d7 Fix #119316: instancing lamps does not work
The issue was that calling `ensure_geometry_instances` converts all instances to a
geometry, even the ones that can't be converted. The comment already says that
non-geometry instances should stay intact, but that didn't work correctly yet:
```
  /**
   * If references have a collection or object type, convert them into geometry instances
   * recursively. After that, the geometry sets can be edited. There may still be instances of
   * other types of they can't be converted to geometry sets.
   */
```

Pull Request: https://projects.blender.org/blender/blender/pulls/119324
2024-03-11 15:58:40 +01:00
Jacques Lucke
deb332601c Fix #113090, #111450, #104909: node rna properties collide with built-in names
This fixes the following name collisions:
* Compositor Box/Ellipse Mask node: `width` -> `mask_width`
  (also renamed the `height` property accordingly)
* Shader AOV Output node: `name` -> `aov_name`
* Geometry Color node: `color` -> `value`.

Those are breaking changes unfortunately, because looking up those property
names yielded the node-specific and not the common property. Therefore, this is
targeted at `main` instead of `4.1`.

Pull Request: https://projects.blender.org/blender/blender/pulls/119284
2024-03-11 15:57:30 +01:00
Hans Goudey
3c908dc7f5 Merge branch 'blender-v4.1-release' 2024-03-11 10:43:55 -04:00
Hans Goudey
8b9abd09c8 Fix #119270: Multires color attribute fallback drawing changed to black
Before e05c36f56d the fallback for unsupported attributes was
white. That's arbitrary, but not worth changing.
2024-03-11 10:41:38 -04:00
Jacques Lucke
ad9d93ef13 Merge branch 'blender-v4.1-release' 2024-03-11 15:40:43 +01:00
Iliya Katueshenock
95810eec8f Fix #106235: use first non-dangling link of multi-input socket for internal link
Pull Request: https://projects.blender.org/blender/blender/pulls/119280
2024-03-11 15:39:02 +01:00
Falk David
771538f362 Fix: GPv3: Eraser used wrong layer index
The `execute_eraser_on_drawing` expects the first argument to be the layer index, but the drawing index
was passed to the lamda.
The fix makes sure to pass the active layer index.
Also return early if there is no active layer.
2024-03-11 14:44:46 +01:00
Jacques Lucke
55cda490ab Fix #119171: show node panels when they have ui even if they don't have sockets
Pull Request: https://projects.blender.org/blender/blender/pulls/119287
2024-03-11 14:08:59 +01:00
Germano Cavalcante
20dbcd8814 Fix #119305: Edge slide is not working properly
Caused by 930b11b0fe.

The `find_best_dir` method needs to break the loop of edges that share
faces if these edges go beyond those selected for slide.
2024-03-11 09:23:15 -03:00
Bartosz Kosiorek
0a1dd4be05 UI: Add and improve more shader node descriptions
Pull Request: https://projects.blender.org/blender/blender/pulls/119169
2024-03-11 13:19:17 +01:00
Pratik Borhade
04d37cd887 Fix #119309: Face Set from Visible crash with multires
Fix is same as 18912561b5 / 72d324bd81

Pull Request: https://projects.blender.org/blender/blender/pulls/119311
2024-03-11 13:01:24 +01:00
Lukas Tönne
f04bf1694f Fix #118509: Make sure to use valid indices in frame maps
Moving a set of keyframes could cause crashes by setting invalid
`drawing_index` in `GreasePencilFrame` data.

The transform operator for grease pencil keyframes can add and remove
keyframes by overwriting existing frames. The `move_duplicate_frames`
function in particular has to keep track of drawing user counts to
ensure that the drawings referenced by the frames are still alive at the
end.

This was broken when moving multiple keyframes at once, such that later
keyframes would overwrite the target positions for earlier frames (for
example moving frames [1,2,3] to [2,3,4]). The `move_duplicate_frames`
was first removing the source frame and then adding it back at the
destination. In case the source frame was already the destination of an
earlier keyframe, this will cause incorrect user count because the frame
being removed is not the same as the one being added back.

To avoid this problem, remove all the source keyframes first before any
other modification of the destination layer. That way we can be sure the
frames at the source index is actually the expected frame.

Pull Request: https://projects.blender.org/blender/blender/pulls/119207
2024-03-11 12:50:19 +01:00
Pratik Borhade
51bcaad457 GPv3: Set dash segment active
When new dash segment is added in empty list, it is not set as active.
This is because active_index value becomes greater than segment_num.

Pull Request: https://projects.blender.org/blender/blender/pulls/119318
2024-03-11 12:30:38 +01:00