Commit Graph

108002 Commits

Author SHA1 Message Date
Miguel Pozo
def5f86cae Fix: EEVEE-Next: Material compilation
Move pcg functions to eevee_sampling_lib.
Including gpu_shader_common libs in engine code results in double  includes.
2024-03-22 18:58:12 +01:00
Harley Acheson
cfce96dafe Changes needed because of removal of a1, a1 from uibut 2024-03-22 10:31:02 -07:00
Harley Acheson
5d136692e6 Merge branch 'blender-v4.1-release' 2024-03-22 10:27:38 -07:00
Harley Acheson
986e4a8b7f Fix #119384: Outliner Edit Mode Toggle When Data is Shared
This report includes a file that demonstrates a crash when ctrl-
clicking the "dot" icon to add to the objects in edit mode. This is
because the object has a mesh shared with another object that is
already in edit mode. This PR allows editing only one object at a
time between objects that share data.

Pull Request: https://projects.blender.org/blender/blender/pulls/119704
2024-03-22 18:26:29 +01:00
Hans Goudey
00e1b2256b Merge branch 'blender-v4.1-release' 2024-03-22 12:28:51 -04:00
Hans Goudey
ed2cdc6583 Cleanup: Remove unused curves eval cache variable 2024-03-22 12:25:24 -04:00
Hans Goudey
7f4a4fa605 Fix #119787: Curves viewport attribute drawing crash
Caused by 1cca960677.

That commit stated that creating the final subdivided attribute didn't
free the "proc" attribute buffer that contains the data from the Curves
control points. However that wasn't the case, given the call to
`GPU_VERTBUF_DISCARD_SAFE` in that function. That caused a crash when
the overlay engine and EEVEE both wanted to access the VBO and it was
discarded the second time. To fix that, only regenerate the
`proc_attributes_buf` when it doesn't already exist.

This matches the "ensure" behavior that already exists for the
`cache.final[subdiv].attributes_buf` buffer, so conceptually it
seems fine.

Pull Request: https://projects.blender.org/blender/blender/pulls/119795
2024-03-22 17:19:50 +01:00
Guillermo Venegas
7fabf0d896 Fix #119778: Crash in popovers that do not support refreshing
When creating popover with `UI_popover_begin` the popover block
is created just once without a region and since `UI_popover_begin` blocks
are not support refreshing, layout panels may not be compatible
in this kind of popover since open/close state cannot be refreshed either.

Only `UILayout.popover(...)` popovers are supported to have layout panels.

Pull Request: https://projects.blender.org/blender/blender/pulls/119796
2024-03-22 17:09:02 +01:00
Sybren A. Stüvel
aafe045fa0 Refactor: Anim, context function for active/editable/selectable actions
Just some simplification with early `return` / `continue` to reduce
indentation and cognitive complexity.

No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/119794
2024-03-22 16:49:12 +01:00
Jeroen Bakker
463856e6c6 GPU: Remove print statement when frame capturing
When frame capturing cannot be start an error is printed to the console.
Most of the time the issue is that you're not running from within a frame
capturing environment. For example not from your IDE/GPU debugger.

The print statement is often just not that useful. Especially when
running the `WITH_GPU_DRAW_TESTS` where it floods the console.

Pull Request: https://projects.blender.org/blender/blender/pulls/119783
2024-03-22 16:27:52 +01:00
Hans Goudey
3039ea02c6 Refactor: Simplify undo object list creation, use C++ Vector
Replace the use of the `LIB_TAG_DOIT` flag which cwas used to
only process each object data ID once with a Set. Return the objects
or bases in a Vector. Now we only iterate over the view layers bases
once instead of three times.

Pull Request: https://projects.blender.org/blender/blender/pulls/119788
2024-03-22 16:24:30 +01:00
Julian Eisel
b1db1702c6 Cleanup: Deduplicate UI list filtering checks
Followup to 303014bfac.
2024-03-22 16:04:03 +01:00
Sybren A. Stüvel
9f0cc7fe64 Anim: Bone subdivision, ensure bone names are sequential
Ensure that subdividing "Bone" results in a chain "Bone", "Bone.001",
"Bone.002", etc.

Before this commit the order would be "Bone", "Bone.004", "Bone.003",
etc.

This might break add-ons that assume to know the bone names before the
actual subdivision happens. This would always have been fragile, as
there may, for example, already have been a "Bone.001"; in that case
subdividing "Bone" would result in "Bone", "Bone.002", etc. Instead, the
parent-child chain should be followed.

Pull Request: https://projects.blender.org/blender/blender/pulls/119775
2024-03-22 15:26:22 +01:00
Sybren A. Stüvel
ce8a032ac2 Anim: fix bug in name uniqueness check for editbones
Fix the name uniqueness check for editbones. The function can receive a
"bone to ignore", which would not be properly ignored. If it was found
earlier in `armature->edbo` than another bone with the same name, the
name would incorrectly be marked as unique.

This issue only occurred when a "bone to ignore" was passed to the
uniqueness check. This never actually happens in the current code, but
that's going to change soon.
2024-03-22 15:21:36 +01:00
Christoph Lendenfeld
62f140e048 Anim: Add Sharpness to Ease operator
This PR extends the existing `Ease` operator with a sharpness property.

This means it has two parameters:
* Curve Bend: Define which key to favor. At 0 it's exactly between the two keys.
* Sharpness: Higher values make the change more abrupt.

During modal operation it is possible to switch the slider between those two by pressing `TAB`.

Pull Request: https://projects.blender.org/blender/blender/pulls/117287
2024-03-22 13:22:35 +01:00
Christoph Lendenfeld
646f9bcebe Refactor: Remove bAction argument from insert_keyframe
No functional changes intended.

The `insert_keyframe` function had a `bAction` argument that could be
a `nullptr`. If it was a `nullptr` it would be queried from the `ID`.

However in all cases where it is passed it is also gotten from the `ID`, making
the argument redundant.

This PR removes the argument to simplify the function.

Pull Request: https://projects.blender.org/blender/blender/pulls/119742
2024-03-22 13:18:32 +01:00
Julian Eisel
d470b65f6d Merge branch 'blender-v4.1-release' 2024-03-22 12:28:46 +01:00
Julian Eisel
303014bfac Fix #108078: Crash when inverting results in pose library sidebar
a958ae36e8 introduced support for UI lists to reference items that would
never be shown, regardless of filter settings. This was to skip assets
in the asset view template that were not of the requested type. UI list
sorting code wasn't updated to account for such items that should be
entirely ignored.

Pull Request: https://projects.blender.org/blender/blender/pulls/109157
2024-03-22 12:25:39 +01:00
Aras Pranckevicius
480f2f5bdd Cleanup: Remove unused AviCodecData
Non-ffmpeg movie support was removed in #118409, but I did not
notice that AviCodecData is now not needed.

Pull Request: https://projects.blender.org/blender/blender/pulls/119777
2024-03-22 12:17:49 +01:00
Christoph Lendenfeld
24b4461be3 Anim: restrict keylist creation for NLA drawing code
When previewing an action in the NLA, the drawing code would
calculate the Keylist for the whole action regardless of what is shown.
This patch limits the keylist creation to only do it for the viewport range
increasing performance in the case when less than the whole action is visible.

whole F-Curve visible
* Before 60ms
* After 60ms

zoomed in
* Before 60ms
* After 1.6ms

Pull Request: https://projects.blender.org/blender/blender/pulls/119470
2024-03-22 12:09:39 +01:00
Pablo Vazquez
703435680d UI: Use icon for View in Graph Editor menu item
Use the Graph Editor icon for the "View in Graph Editor" operators,
to make a connection with the entry in the list of editors and the
View menu in the Dope Sheet.

Only use icon on the first item of the section, according to the HIG.
2024-03-22 12:01:29 +01:00
Omar Emara
ba3f37ac6b Cleanup: Remove unused function 2024-03-22 12:43:09 +02:00
Campbell Barton
b057e7f36d Extensions: improve the default value for the extensions module
By default a URL would be used for the module name of new remote repos,
the '.' characters were removed, joining words together.

Even though this often isn't user visible, it is used for extension
directory names, command-line access & may show up in error messages.
2024-03-22 19:37:08 +11:00
Leon Schittek
3d867af642 Fix #115899: Prevent transparent gaps on nodes
Add some padding to the different shapes used to draw nodes to
prevent transparent gaps between them.
Also improve positoning of the node's outline.

Pull Request: https://projects.blender.org/blender/blender/pulls/119001
2024-03-22 09:15:00 +01:00
Campbell Barton
01f8e20681 Cleanup: remove return value from ED_object_add_generic_get_opts
This was never false, many callers already ignored the return value.
2024-03-22 19:12:27 +11:00
Campbell Barton
1d9ed41560 Cleanup: minor edits to code-comments 2024-03-22 19:12:27 +11:00
Leon Schittek
5acf2984d4 Node Editor: Improve padding around buttons and sockets
Make the padding that is added above and below buttons and sockets
more consistent across nodes.

Pull Request: https://projects.blender.org/blender/blender/pulls/118972
2024-03-22 09:09:47 +01:00
Omar Emara
ac7309f95e Compositor: Add Float2 data type
This patch adds the Float2 data type to the MemoryBuffer class.

Needed by #119414.

Pull Request: https://projects.blender.org/blender/blender/pulls/119738
2024-03-22 08:51:24 +01:00
Campbell Barton
02681bd44d UI: support layout panels in popovers
Make use of UI_popup_dummy_panel_set so layout panels can be used.
2024-03-22 17:36:45 +11:00
Campbell Barton
44defbd2c7 Extensions: add BLENDER_USER_EXTENSIONS user directory
Replace: `{BLENDER_RESOURCE_PATH_USER}/extensions`
With:    `{BLENDER_USER_EXTENSIONS}`

This follows BLENDER_USER_CONFIG & BLENDER_USER_SCRIPTS conventions.
Reading the environment variable and accessible via
`bpy.utils.user_resource('SCRIPTS')`
2024-03-22 16:08:25 +11:00
Campbell Barton
6bfc8612bf Cleanup: remove BLENDER_USER_AUTOSAVE
This was only used on WIN32 when the temporary directory didn't exist.
When the check was added [0] this made some sense because it relied on
`U.tempdir` existing, since then additional checks have been added to
ensure a temporary directory can be used. Further, this fall-back
location isn't documented in the user manual.

[0]: 615db01b01
2024-03-22 16:08:25 +11:00
Campbell Barton
e4b7f4d884 Suppress noisy color-management prints when using --command 2024-03-22 16:08:25 +11:00
Aaron Carlisle
02578117cd Merge branch 'blender-v4.1-release' 2024-03-21 23:48:14 -04:00
Hans Goudey
c61ecf1f40 Cleanup: Move Mesh edit_mesh pointer to runtime data
The edit mesh is never saved to files, so it should be in the runtime struct.

Pull Request: https://projects.blender.org/blender/blender/pulls/119766
2024-03-21 23:18:49 +01:00
Hans Goudey
b9ef66693a Fix #119754: Edit mode modifier deform data copy crash
Caused by ddcfc46ee6.

That commit assumed that the cage mesh always had the deformed
position and normal data. But that isn't true, as shown in the example
in the report. To fix the bug, simplify things, and make the goal clearer,
just copy the struct directly.

Pull Request: https://projects.blender.org/blender/blender/pulls/119755
2024-03-21 21:22:51 +01:00
Hans Goudey
575a5c0502 Fix #119744: Regression: Geometry Nodes: Default input not working
Caused by 25a10c211f.

The socket_type field for socket declarations wasn't set for declarations
created from the node group interface DNA tree structure. Arguably the
socket types should be set by the constructors, but setting it in one more
place isn't bad either, and is a simple fix for now.
2024-03-21 13:18:43 -04:00
Hans Goudey
040ff38fcd Fix: ID namemap assert in auto smooth versioning code
When "moving" the new node group to the same library as the object, its
original name has to be cleared from the name-map as well. That's
because there is a separate name-map for each library. I had this in
the original PR, but incorrectly removed this because I thought it was
unnecessary.

Pull Request: https://projects.blender.org/blender/blender/pulls/119747
2024-03-21 17:26:45 +01:00
Omar Emara
d8a89aa972 Compositor: Add MemoryBuffer constructor from size
This patch adds a new MemoryBuffer constructor from width and heights.
Useful for temporary allocations where we don't care about the area.
2024-03-21 17:35:19 +02:00
Omar Emara
f6657db713 Compositor: Add utility for nearest interpolation
This patch adds a utility function for nearest interpolation with
clamped boundaries and normalized coordinates to the MemoryBuffer class.
Similar to the GLSL texture() function.
2024-03-21 17:26:33 +02:00
casey bianco-davis
20b614ab8e GPv3: Fill texture coordinates system
This is implements the system texture coordinates for GPv3.

This pull request adds:
- System for storing and viewing texture coordinates.
- Texture coordinates are convert when covering from legacy to GPv3,
   (Tested with object and layer transformation)
- Textures are set to the drawing plane.

Pull Request: https://projects.blender.org/blender/blender/pulls/119303
2024-03-21 16:07:18 +01:00
JonasDichelle
8812be59a4 Compositor: Make Hue Correct node wrap
Compositor: Make Hue Correct node wrap

This patch makes the Hue Correct node as well as the Hue Correct VSE
modifiers to wrap, such that no discontinuities occur for the red hue.
Since it now wraps, the default curve preset now exempts the last point
of the curve.

A new CUMA_USE_WRAPPING flag was added to specify wrapping for curve
maps. The implementation works by adding two virtual points before and
after the terminal points in the curve map, such that their handles
match, and would then produce a continues curve.

This is a breaking change, since existing curves were also adjusted
using versioning. However, the change will not be significant, since in
most realistic cases, the terminal points will be close to each other,
and even with wrapping, the connection will be very sharp, almost
matching the old behavior.

Pull Request: https://projects.blender.org/blender/blender/pulls/117114
2024-03-21 15:35:02 +01:00
Christoph Lendenfeld
6a55a126e9 Anim: Only sort FCurves that need it
Before this PR the sorting function would receive all FCurves from
the `anim_data` ListBase and sort them + recalculate the handles.

Considering we are already checking
IF an `FCurve` needs sorting we might as well use
that and limit the sorting to FCurves that actually need it.
Doing that gives the following performance uplift.

| - | Before | After |
| - | - | - |
| Moving 1 key only | 109ms | 0.72ms |
| Moving 1 key of each FCurve | ~2000ms | ~2000ms |

Pull Request: https://projects.blender.org/blender/blender/pulls/119735
2024-03-21 15:11:19 +01:00
Omar Emara
2906ea9785 BLI: Add nearest interpolation with clamped boundary
This patch adds clamped boundaries variants of the nearest interpolation
functions in the BLI module. The naming convention used by the bilinear
functions were followed.

Needed by #119414.

Pull Request: https://projects.blender.org/blender/blender/pulls/119732
2024-03-21 13:22:10 +01:00
laurynas
e2bdaf8ec7 Fix #119686: curves editmode handles are displayed in sculptmode
Curves cage overlay for sculpt mode restored to prior #119053 state.

Pull Request: https://projects.blender.org/blender/blender/pulls/119717
2024-03-21 12:24:29 +01:00
Philipp Oeser
6db5cf09e0 Merge branch 'blender-v4.1-release' 2024-03-21 11:53:31 +01:00
Philipp Oeser
5fa1915d47 Fix #119715: Curve sculpt puff brush causes hairs to move erratically
Caused by 98bf7a8d7a / ff7b8f3412

Since the `curve_weights` array was created uninitialized, and the above
commits were doing `math::max_inplace` on the uninitialized data, this
could end up with garbage values.

Now initialize the array properly to prevent this.

Pull Request: https://projects.blender.org/blender/blender/pulls/119730
2024-03-21 11:52:31 +01:00
Christoph Lendenfeld
adef64db06 Refactor: BeztMap struct
No functional changes.

The `BeztMap` struct is used when sorting Keyframes during transformations
in the Graph Editor.

Things that were changed:
* Removed unneeded `newIndex`. This was just the index of the
`BeztMap` in the array, which we already have since we iterate with a for loop.
* Access the `BezTriple` array by index instead of pointer offsets.
This makes it a bit easier to see what's happening.
* Renamed struct members to clarify their use.
* Remove forward declaration of certain variables (e.g. loop counter vars)

Pull Request: https://projects.blender.org/blender/blender/pulls/119733
2024-03-21 11:50:51 +01:00
Philipp Oeser
475865ddb7 Merge branch 'blender-v4.1-release' 2024-03-21 11:13:23 +01:00
Omar Emara
20f930c8d8 Cleanup: Clarify comment in MemoryBuffer class 2024-03-21 12:01:39 +02:00
Pratik Borhade
bc74bbef0b Fix: GPv3: Empty grease pencil object crash
The `bounds` is `nullopt` when the number of points is 0 at current frame.
The fix uses `value_or()` to make sure we get some bounds.
Also uses `Bounds<float3>` instead of `std::optional<Bounds<float3>>`
in `gpencil_object_cache_add`.

Pull Request: https://projects.blender.org/blender/blender/pulls/119690
2024-03-21 11:00:39 +01:00