Commit Graph

104254 Commits

Author SHA1 Message Date
Falk David a07a558ac5 GPv3: Add view layer name property
This adds the `viewlayername` property to grease pencil v3 layers.
It's exposed as `viewlayer_render` in python.

Note: this is not used in the renderer yet. Will be used in a following PR.
Pull Request: https://projects.blender.org/blender/blender/pulls/119422
2024-03-14 10:15:07 +01:00
Jason Fielder ecffea86b1 Metal: Fix Storage buffer read sync affecting surfels
Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/119093
2024-03-14 09:40:59 +01:00
Campbell Barton 09666e1498 Fix #119387: Precision transform fails to activate
Regression in [0] caused precision fail to activate in the graph editor
and when pressing shift then control (#119395).

[0]: 060174cf14
2024-03-14 11:20:19 +11:00
Pratik Borhade 847d369fbb Fix #119271: Update stats when switched between workspaces
When workspace is switched, send notifier to clear `view_layer->stats`
then update the stats with repsect to new object interaction mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/119418
2024-03-14 00:42:21 +01:00
Harley Acheson 7852e0a551 Merge branch 'blender-v4.1-release' 2024-03-13 15:02:59 -07:00
Guillermo Venegas 1640121a63 Fix #119183: Use valid style for popup text size calculation
The current font style can be overridden with a input or other widget text style,
this change ensures that the right font style is set so `BLF_width` don't use a
overridden font text style.

Pull Request: https://projects.blender.org/blender/blender/pulls/119442
2024-03-13 23:01:58 +01:00
Iliya Katueshenock d562a9ce43 Fix #118883: Face Corner component shows in Delete Geometry node
Pull Request: https://projects.blender.org/blender/blender/pulls/118917
2024-03-13 15:38:44 -04:00
Hans Goudey b5082f6640 Refactor: Simplify BLI_serialize.hh for asset indexer
- Remove the unnecessary `ContainerValue` from the class hierarchy
- Construct `StringValue` with a `std::string` by value to avoid copies
- Remove some indirection by using type names directly instead of aliases
- Use utility methods to lookup/append specific data types for arrays/dicts
- Simplify conversion from unique_ptr to shared_ptr
- Avoid use of `new` and `delete`
- Avoid creating maps of all elements in vector for a single lookup
2024-03-13 14:52:57 -04:00
Hans Goudey ae12c1bd92 Refactor: Remove unnecessary indirection from classes in asset indexer
The `AssetEntryReader` and `AssetEntryWriter` classes were only used
once and just added indirection hiding the actual logic of reading and writing
asset metadata from the index. It also hid double map lookups and extra
string copies/allocations.
2024-03-13 14:52:57 -04:00
Hans Goudey 24c9f736ff Cleanup: Follow style guide for use of "this" in classes
Also simplify iteration over map keys and slightly simplify string hash.
2024-03-13 14:52:57 -04:00
Germano Cavalcante f6a581e28a UV: Vert and Edge Slide UI improvements
Changes:
- Add Vert Slide and Edge Slide to 'UV -> Transform' menu.
- Add a separator for Vert Slide and Edge Slide in the context menu.
- Don't display the "Correct UVs" option in the Redo menu of UV Editor.
2024-03-13 12:16:19 -03:00
Germano Cavalcante 31745a53f4 Cleanup: early return & avoid compare strings unnecessarily
`transform_poll_property` can be smarter in the conditions.
2024-03-13 12:16:18 -03:00
Thomas Dinges 51a3c03072 Release: Bump to 4.1 RC.
Splash screen by Lynxsdesign
2024-03-13 15:52:53 +01:00
Hans Goudey 6b671c4b54 Cleanup: Use simpler lambda capture
It's typically only worth specifying specific captures when the lambda
is stored as a function object for use later. Since this is just passed
as a FunctionRef as an iteration callback, we can use a less complex
capture here. That also helps clarify that this isn't a callback.
2024-03-13 10:42:00 -04:00
Germano Cavalcante 03735d0339 Fix #119244: Auto-Depth fails when we have arrow gizmos in the 3D View
Caused by dd0e60fb51

That commit was an optimization attempt to reuse the depth buffer
updated by the engines.

But it fails when `GPU_clear_depth` is called for gizmos.

So, due to error proneness, revert that solution for now.
2024-03-13 10:50:14 -03:00
Jacques Lucke 9a127a967b Merge branch 'blender-v4.1-release' 2024-03-13 13:50:17 +01:00
Jacques Lucke 61aaf95709 Fix #119406: Node tools don't work in edit mode with unselected object
It's possible for an object to be in edit mode without being selected. Use the
`FOREACH_OBJECT_IN_MODE_BEGIN` iterator to find all objects in the mode instead.

Pull Request: https://projects.blender.org/blender/blender/pulls/119412
2024-03-13 13:49:35 +01:00
Jacques Lucke 43dbb98625 Merge branch 'blender-v4.1-release' 2024-03-13 13:29:28 +01:00
Jacques Lucke 297157e1c7 Fix #119241: setting edge selection does not work correctly
This was likely a typo in bd4c310a19.

Pull Request: https://projects.blender.org/blender/blender/pulls/119413
2024-03-13 13:25:23 +01:00
Jeroen Bakker f0f911590e EEVEE-Next: Viewport pixel size with up-sampling
EEVEE-Next performes less on integrated GPUs then discrete GPUs.
Most shaders have been analyzed, but there will always be bottlenecks
related to architectural differences.

In order to make EEVEE-Next run smooth on integrated GPUs this change
will implement viewport pixel size option similar to Cycles. The main difference
is that the samples will still be weighted and up-sampled to the final film
resolution. This makes the pixels not look squared in the viewport but will
resolve to something close to the results without up-scaling.

This improves the performance especially on integrated GPUs. The improvement
for discrete GPUs are less noticeable. See here the stats when playing
`rain_restaurant.blend` back on a RAPHAEL_MENDOCINO iGPU.

| Pixel size | Frames per second |
|------------|-------------------|
| 1x         | 0.25 FPS          |
| 2x         | 4.14 FPS          |
| 4x         | 6.90 FPS          |
| 8x         | 9.95 FPS          |

Related to: #114597
See PR for some example images.

Pull Request: https://projects.blender.org/blender/blender/pulls/118903
2024-03-13 12:00:24 +01:00
Jacques Lucke f828f5d664 Merge branch 'blender-v4.1-release' 2024-03-13 10:45:13 +01:00
Jacques Lucke 48aec82426 Fix: memory leak when using node tool in mesh edit mode
Caused by b40a9ce60b.

For the non-edit mode code path, the mesh is freed as part of
`BKE_mesh_nomain_to_mesh`.
2024-03-13 10:44:39 +01:00
Pratik Borhade 615eceb92e Merge branch 'blender-v4.1-release' 2024-03-13 14:20:48 +05:30
Pratik Borhade 0f751c7e7d Fix #119362: Bone collection visibility when moved to root collection
When bone collection is moved to root collection by drag-drop,
visibility of dropped collection is lost. This is due to missing flags
for the root bone collection which cleared `BONE_COLLECTION_ANCESTORS_VISIBLE`
flag of dropped bcol.

Pull Request: https://projects.blender.org/blender/blender/pulls/119366
2024-03-13 09:48:45 +01:00
Campbell Barton 499a2b2b4b Cleanup: remove double-space in exception message 2024-03-13 17:12:51 +11:00
Campbell Barton 571834457b Extensions: treat a new repo with a blank URL as local
Now there is no difference between omitting remote_path or passing
in an empty string.
2024-03-13 17:10:53 +11:00
Campbell Barton 924561680e WM: suppress prints when G.quiet is set 2024-03-13 15:33:02 +11:00
Harley Acheson bc70b597fc UI: Use New Internet Icon
We recently added a new "Internet" icon, meant to represent internet
services and protocols generally, in contrast with the existing "url"
icon which can be seen as being http (web link) specifically.  This
PR just uses this icon for cloud storage uses and for remote extension
repository.

Pull Request: https://projects.blender.org/blender/blender/pulls/119409
2024-03-13 02:39:36 +01:00
Harley Acheson 42e7a720c9 UI: Add "Internet" Icon
Add an icon called INTERNET that looks like our current URL without the
mouse cursor, so it looks less specifically like a web document. So can
be used to represent other internet and cloud-based services.

Pull Request: https://projects.blender.org/blender/blender/pulls/119186
2024-03-13 02:13:07 +01:00
Harley Acheson 443ea628c5 UI: Changes to Small Operator Confirmations
Small operator confirmations get separate confirm and cancel buttons,
better descriptions and configurable confirm button text. But still
popup at cursor location and can be cancelled with mouse movement.

Pull Request: https://projects.blender.org/blender/blender/pulls/118346
2024-03-12 23:12:45 +01:00
Hans Goudey 77b6f5d7e3 Merge branch 'blender-v4.1-release' 2024-03-12 17:34:52 -04:00
Hans Goudey 885b116c75 Fix: Socket names in auto smooth versioning node group
The current naming for node groups is "Socket" rather than "Input".
Also remove translation which is unnecessary since these are just identifiers.
2024-03-12 17:33:47 -04:00
Hans Goudey 6cbdb9c242 Merge branch 'blender-v4.1-release' 2024-03-12 17:12:00 -04:00
Hans Goudey 9141a8cb25 Fix #119398: Weighted normal modifier "Keep Sharp" option missing versioning
The Weighted Normal modifier has a "Keep Sharp" option that used to
recalculate the sharp edge tags based on the mesh's smoothing angle.
To keep the same behavior, an auto smooth versioning modifier has to
be added before that modifier when the option is on.

Pull Request: https://projects.blender.org/blender/blender/pulls/119400
2024-03-12 22:08:19 +01:00
Hans Goudey 51c738da1b Cleanup: Mesh: Use updated "corner" name for variables 2024-03-12 14:55:58 -04:00
Hans Goudey 9cafccf004 Cleanup: Sculpt: Unify face PBVH node face index access
Remove one function from the API.
2024-03-12 14:55:58 -04:00
Hans Goudey b91d0aa0b8 Cleanup: Sculpt: Remove useless comments 2024-03-12 14:55:58 -04:00
Hans Goudey be2944a6b5 Cleanup: Sculpt: Retrieve data directly from mesh
Remove more use of the redundant storage in SculptSession here.
2024-03-12 14:55:09 -04:00
Sean Kim 08801e8930 Cleanup: Extract project gesture to separate file
This PR extracts the `SCULPT_OT_project_line_gesture` operator into its
own file and namespace out of the `paint_mask.cc` file and
`blender::ed::sculpt_paint::mask` namespace.

Pull Request: https://projects.blender.org/blender/blender/pulls/119394
2024-03-12 19:52:50 +01:00
Sean Kim 40dbe99dd9 Cleanup: Migrate face set gesture operators
This PR moves the `SCULPT_OT_face_set_lasso_gesture` and
`SCULPT_OT_face_set_box_gesture` operator out of the `paint_mask.cc`
file and `blender::ed::sculpt_paint::mask` namespace to
`sculpt_face_set.cc` and `blender::ed::sculpt_paint::face_set`.

Pull Request: https://projects.blender.org/blender/blender/pulls/119392
2024-03-12 19:06:14 +01:00
Germano Cavalcante a56a975760 UV: Enable 'Set Snap Base' feature
Just like for objects in 3D View, UVs can also benefit from the
`Set Snap Base` feature (key `B`).
2024-03-12 14:35:52 -03:00
Hans Goudey 06bb8bce26 Cleanup: Remove unused includes 2024-03-12 13:32:01 -04:00
Sean Kim ff34b5f44a Cleanup: Sculpt: Extract trim operators
This PR extracts the `SCULPT_OT_trim_box_gesture` and
`SCULPT_OT_trim_lasso_gesture` into a separate file and
namespace from `blender::ed::sculpt_paint::mask`.

Pull Request: https://projects.blender.org/blender/blender/pulls/119390
2024-03-12 18:24:51 +01:00
Hans Goudey 2c55835c52 Fix: UI: Rename "Bright" property to "Brightness"
"Bright" is an adjective, not a noun.
2024-03-12 13:19:31 -04:00
Hans Goudey 32bc206cc4 Merge branch 'blender-v4.1-release' 2024-03-12 13:18:27 -04:00
Hans Goudey 7d2d590f0e Fix #119307: Anchored multires mask brush broken
I ran into this issue a while ago too, where the vertex iteration
macro didn't process all of the vertices. I didn't figure it out yet,
but it makes more sense in the context of the surrounding code
to specialize this anyway.
2024-03-12 13:17:38 -04:00
Christoph Lendenfeld 1e70c29320 Fix: Slider not respecting bounds when snapping to increments
The issue was that the clamping to the bounds happened before the rounding to the increment step.
In the reported case this led to a divide by 0 error.
The fix is to do the increment first, then the clamp to bounds.

This was reported by Raymond Luc on #117287

Pull Request: https://projects.blender.org/blender/blender/pulls/119367
2024-03-12 17:42:14 +01:00
Jacques Lucke 68c5e35be1 Merge branch 'blender-v4.1-release' 2024-03-12 17:33:59 +01:00
Jacques Lucke ac8835f18b Fix #119350: shifting text overlay text
The issue was that the object location was taken into account twice using
`object_to_world` and `ob->loc`.

Pull Request: https://projects.blender.org/blender/blender/pulls/119378
2024-03-12 17:32:52 +01:00
Sean Kim 1982cad490 Fix: update comparator for std::sort for NamedAttribute
This PR applies a fix for the comparator being passed into std::sort to
avoid potential Mac / libc++ issues as seen in #119189

Pull Request: https://projects.blender.org/blender/blender/pulls/119385
2024-03-12 17:31:02 +01:00
Hans Goudey 20fbaa455e Merge branch 'blender-v4.1-release' 2024-03-12 12:13:40 -04:00
Hans Goudey 3c3f1e6d62 Fix #117603: Auto smooth replacement versioning skipped for link/append
Unfortunately the only versioning code that can "properly" add data-
blocks is not run when linking or appending (`do_versions_after_setup`
has details). The versioning has to be done manually for this case.
Fortunately that is simple since the versioning function already just
operators on a main database.
2024-03-12 12:09:30 -04:00
Philipp Oeser 6bd97d0477 Merge branch 'blender-v4.1-release' 2024-03-12 17:03:27 +01:00
Philipp Oeser 2886859347 Fix #116262: Modal knife tool can crash if used on hidden object
This could happen if objects were hidden after going to editmode and
knife was used on them.

In that case, raycasting would (rightfully) fail, but there is a
fallback in place using the back-buffer selection method (in which the
hidden object is still present). So a face would be found, but this
makes all following code confusing/wrong since we are working with
coordinates / faces under the assumption there would be a valid/
corresponding object to it in `KnifeTool_OpData` > `objects` -- which is
not the case...

So to resolve, just check if the object is visible before calling
`EDBM_face_find_nearest` in knife code.

Alternativeliy, we could also add a check for Base viewport visibility
to all the bmesh `find_nearest` functions (a bit hesitant though since i
am not sure this would be desired in all cases)

Pull Request: https://projects.blender.org/blender/blender/pulls/119383
2024-03-12 17:02:35 +01:00
Hans Goudey 9d76f93451 Merge branch 'blender-v4.1-release' 2024-03-12 11:43:07 -04:00
Iliya Katueshenock 9ee45646b4 Fix #119239: Use attribute names after free
Fix of error introduced in c31718649d. Attribute names will
be freed on domain resizing. This mean, ref-names which is attribute
ids is will be invalid. To avoid this, make sure names will be gathered
only after resize. To avoid unnecessary topology map computation before
mesh resize, check if attributes on required domain exists, instead
of gathering them and check if span is not empty.

Pull Request: https://projects.blender.org/blender/blender/pulls/119242
2024-03-12 16:42:16 +01:00
Hans Goudey 53f0c0a7e1 Merge branch 'blender-v4.1-release' 2024-03-12 11:40:41 -04:00
Hans Goudey 39ebd68a46 Fix #119361: Sculpt face set draw broken with multires
`PBVHVertexIter::g` is the grid index within the node, not the the global grid index.
2024-03-12 11:39:39 -04:00
Hans Goudey daa1739953 Merge branch 'blender-v4.1-release' 2024-03-12 10:54:14 -04:00
Hans Goudey 91466f71f1 Fix #91256, #112646: IDProperty UI data lost when changing type
With some data-type conversions we can do a best-effort conversion of
UI data like default values and min and max to the new data type.
This can help to make Python scripts simpler and to avoid bugs like
#105965.

Pull Request: https://projects.blender.org/blender/blender/pulls/106161
2024-03-12 15:49:20 +01:00
Falk David 3d5e3b60be Fix: GPv3: Add missing call to `selection.finish()` 2024-03-12 15:48:33 +01:00
laurynas aa3ffca8dc Fix #119247: Curves: Extra point in evaluated spline of Curves geometry
In bf17fc8d79  after extending buffer to multiple of 4 there appeared trailing
space in buffer not covered by shader's `for` loop.

Pull Request: https://projects.blender.org/blender/blender/pulls/119346
2024-03-12 15:01:10 +01:00
Falk David 986577f4ce Merge branch 'blender-v4.1-release' 2024-03-12 14:59:23 +01:00
megakite 825e662229 Fix #119021: Crash when adding GP object
Added a null check for RE_GetRenderLayer() which could possibly return
null and then stored in `render_layer`, in order to prevent members of
`render_layer` being accessed in RE_pass_find_by_name(), and thus solved
the segmentation fault.

Pull Request: https://projects.blender.org/blender/blender/pulls/119200
2024-03-12 14:58:05 +01:00
Hans Goudey 04de6472b5 Cleanup: Use C++ Array instead of manual allocation 2024-03-12 09:50:32 -04:00
Hans Goudey c24568ed5c Cleanup: Use trailing underscores for private members 2024-03-12 09:50:32 -04:00
Falk David ee9510cdc3 Merge branch 'blender-v4.1-release' 2024-03-12 14:48:44 +01:00
Omar Emara ca65704164 Cleanup: Missing declaration warning 2024-03-12 15:42:35 +02:00
Iliya Katueshenock 29ff84352f Fix #118905: Geometry Nodes: GP3 component and face corner in separate geometry node
Pull Request: https://projects.blender.org/blender/blender/pulls/118916
2024-03-12 14:41:23 +01:00
Falk David 998514af7b Fix #115313: GPencil brush direction is not kept
The core of the issue was that `sculpt_flag` was used by three different enums (`eGP_Sculpt_Flag`, `eGP_Sculpt_Mode_Flag`, and `eBrushFlags`). This resulted in the flag getting overriden because `ENUM_OPERATORS` expected the maximum value of `eGP_Sculpt_Flag` to be `(1 << 3)` which it wasn't.

The `sculpt_flag` was exposed through python as `"direction"`.
In the UI this meant that it was effectively used as `brush.direction`. This fix replaces `brush.gpencil_settings.direction` with `brush.direction`.
It also makes sure `sculpt_flag` is only ever used with values from `eGP_Sculpt_Flag`.

Pull Request: https://projects.blender.org/blender/blender/pulls/119373
2024-03-12 14:22:52 +01:00
Sean Kim 68afd22501 Sculpt: Add Lasso Hide tool
This commit adds the `SCULPT_OT_hide_show_lasso_gesture` and the
corresponding Lasso Hide tool.

* Exposes the selection type for both the lasso and box hide tools
  as a option in the header
* Adds functionality into `sculpt_gesture.cc` for handling lasso
  selections with the `Outside` selection type

For `SelectionType::Outside`, the current implementation opts to not
do any filtering on the PBVH node level due to cases where the node
is mostly covered by a single gesture.

Addresses one of the tools in #80390

Pull Request: https://projects.blender.org/blender/blender/pulls/119140
2024-03-12 14:19:02 +01:00
Melissa aaadb5005e UV: Support Edge and Vert Slide
This commit adapts the existing Edge Slide and Vert Slide to work with
UVs as well.

It addresses [0] for the addition of an edge slide tool to the UV
Editor.

This feature allows users to slide UVs towards adjacent edges,
providing more convenient ways to edit UV maps.

[0]: https://blender.community/c/rightclickselect/66dbbc

Pull Request: https://projects.blender.org/blender/blender/pulls/119041
2024-03-12 10:15:55 -03:00
Jacques Lucke 03dcc6c211 Merge branch 'blender-v4.1-release' 2024-03-12 14:11:27 +01:00
Iliya Katushenock 7c74a042f2 Fix #119364: capturing attributes on output object instances lose object visibility settings
The regression happened because object instances were turned into normal geometry
instances which don't have object-level visibility settings. Long term, this may not be
something we can support, but it's also not something we should break unnecessarily
and accidentally.

Pull Request: https://projects.blender.org/blender/blender/pulls/119370
2024-03-12 14:10:18 +01:00
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
Miguel Pozo a53e8d6d24 Merge branch 'blender-v4.1-release' 2024-03-11 12:27:39 +01:00
Miguel Pozo 23fd84ffbe Fix #118764: Freezing on Viewport Render Image during shader compilation
The shader compilation job assumes it can only be closed on program
exit, leaving all their materials as queued.
However, render tasks can kill it, causing drw_deferred_shader_add to
get stuck in an infinite loop.

Pull Request: https://projects.blender.org/blender/blender/pulls/119172
2024-03-11 12:25:12 +01:00
Miguel Pozo 6aa50832cf Fix: EEVEE-Next: Workaround for Nvidia shader compiler
Using the previously computed L breaks shadows on reflection probes,
even if the value should be the same.

Pull Request: https://projects.blender.org/blender/blender/pulls/119219
2024-03-11 12:23:07 +01:00
Philipp Oeser dbce0c3183 Cleanup: format 2024-03-11 11:40:04 +01:00
Casey Bianco-Davis ce58a69313 GPv3: Deselect newly drawn strokes
Sets the newly drawn stroke to be deselected. (matching legacy implementation)

Previously the selection attribute was left uninitialized, and would often be outside of the valid range, causing a crash to occur during some operator.

Pull Request: https://projects.blender.org/blender/blender/pulls/119306
2024-03-11 11:20:19 +01:00
Casey Bianco-Davis af6d09b439 Fix: GPv3: Armature modifier crash when vertex groups are empty
A debug error was thrown when the armature modifier was added to a GPv3
object that did not have vertex groups.

Pull Request: https://projects.blender.org/blender/blender/pulls/119301
2024-03-11 10:54:23 +01:00
Campbell Barton 5bb1c07fea Merge branch 'blender-v4.1-release' 2024-03-11 20:25:14 +11:00
Campbell Barton e480b6a50c Fix error accessing the "__class__" on removed data
Accessing `__class__` on a removed object raised an exception, making
`isinstance(ob, cls)` unreliable. Always allow class access.

Resolves issue raised by blender/blender-addons!104958.
2024-03-11 20:23:26 +11:00
Clément Foucault 070d72b8f3 DRW: Fix debug_print using char4 macro
This is a side effect of the new small types
support. We need to avoid using them as local
variables.
2024-03-11 09:52:20 +01:00
Omar Emara 739216dc0f Fix #119264: Crashe when Hue Correct and Curves used together
GPU compositor crashes when the Hue Correct and one of the Curves node
are used together. That's due to a utility function that goes by the
same name in both nodes. To fix this, rename one of them to be more
specific.
2024-03-11 10:48:57 +02:00
Philipp Oeser 7394a4042b Merge branch 'blender-v4.1-release' 2024-03-11 09:33:15 +01:00
Philipp Oeser a8b9a58608 Fix #54468: crash calling transform operators with incomplete regiondata
If we run into NULL `RegionView3D` `regiondata` [which e.g. happens if
we just set `bpy.context.area.type = 'VIEW_3D'` without further actions
in the text editor prior to calling the transform operator], we can make
it gracefully work just by using `t->spacetype = SPACE_EMPTY` in
`initTransInfo`.

Similar check is already done in ba229e3859 (marked /* running in the
text editor */).

Transform code is smart enough to have fallback code in place that sets
matrices etc.

Pull Request: https://projects.blender.org/blender/blender/pulls/119205
2024-03-11 09:27:32 +01:00
Omar Emara f4f22b64eb Compositor: Add Bloom option to Glare node
This patch implements the GPU Bloom glare for the CPU compositor, and
adds a new option for it, leaving the Fog Glow option unimplemented once
again for the GPU compositor.

Pull Request: https://projects.blender.org/blender/blender/pulls/119128
2024-03-11 08:43:52 +01:00
Jason Fielder 06ac33bdd2 Metal: Fix SSBO from VBO size assertion
Resolves assertion firing when creating an SSBO
from a VBO which is not aligned to 16 bytes.
Required to ensure API validation is satisfied.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/119298
2024-03-11 08:28:14 +01:00
Prakhar-Singh-Chouhan 5d076e0e7b Vulkan: Implementing `VKBackend::samplers_update()`
Implemented `VKBackend::samplers_update()`. When triggered,
if the VK Device is initialized, the `device.samplers` are
freed and reinitialized.

Implements: #117019
Pull Request: https://projects.blender.org/blender/blender/pulls/119109
2024-03-11 07:57:52 +01:00
Campbell Barton bd58a9fbbb Merge branch 'blender-v4.1-release' 2024-03-11 17:36:40 +11:00
Campbell Barton 7b4fb47298 Merge branch 'blender-v4.1-release' 2024-03-11 17:36:36 +11:00
Campbell Barton e09f08fa78 Fix #119202: Crash closing the area with a temporary context
When restoring a temporary context, account for changes to the context
made by actions (typically operators) in the script.

There was an incorrect assumption that an override which didn't change
the current context would also be unchanged when restoring the temporary
context's original values.
2024-03-11 17:34:25 +11:00
Campbell Barton 5fe0213659 Fix error that let a temporary context restore a removed region
Missing check from [0] allowed a removed region to be set when exiting
the temporary context.

[0]: 1ec10323ff
2024-03-11 17:13:10 +11:00
Campbell Barton 443e9cba90 Cleanup: unused includes 2024-03-11 14:42:18 +11:00
Casey Bianco-Davis 5b33a7bc62 Fix: Vertex group data lost after draw tool or delete operator.
Fixes vertex group data loss after the `Draw Tool`, `Delete`, `Dissolve` operators.

Note: This is not a exhaustive list and there are other operators that will still loss vertex group data.

Pull Request: https://projects.blender.org/blender/blender/pulls/119034
2024-03-11 03:01:57 +01:00
Jason Fielder 703353b5da Metal: Fix uniform upload for small types
This patch adds special cases to Shader::uniform_int routine
to allow writing of small types (1 bytes, 2 bytes) to the push
constant buffer.

This previously interpreted all incoming push constant data as
integer components only, resulting in rendering artifacts such as
bad SRGB mode selection and shader editor not rendering due
to mis-aligned overlay parameter, as the uniform assignment
would overflow consecutive small types.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/119285
2024-03-10 19:36:30 +01:00
Jacques Lucke 2c5f51e683 Merge branch 'blender-v4.1-release' 2024-03-10 14:04:35 +01:00
Jacques Lucke b020173984 Fix #114120: support output attributes on instanced geometry in geometry nodes modifier
Pull Request: https://projects.blender.org/blender/blender/pulls/119016
2024-03-10 13:02:56 +01:00
Jesse Yurkovich 5ad9f9dc90 Cleanup: unused includes in source/blender/io
Reduce dependence on Blender headers as much as possible and move closer
to an include-what-you-use setup.

- Removes unnecessary includes
- Replaces some includes with more appropriate, narrower, substitutes

Pull Request: https://projects.blender.org/blender/blender/pulls/119234
2024-03-10 04:28:00 +01:00
Campbell Barton e33f5e36ac Cleanup: spacing around C-style comment blocks 2024-03-09 23:40:57 +11:00