Commit Graph

109358 Commits

Author SHA1 Message Date
Campbell Barton
01a78bf3e6 Cleanup: avoid matching names for public & static functions
While supported it's confusing to use the same name for a public
function and it's private implementation.
2024-05-14 13:27:18 +10:00
Campbell Barton
521cd53f29 Fix dangling references to temporary variables 2024-05-14 13:13:04 +10:00
Hans Goudey
ac7ceba950 Fix: Asset shelf missing deactivation if new item hidden
When a new item is active, other items are only deactivated in the
`set_state_active` method. This doesn't run if the new item is not
displayed by the shelf for whatever reason (e.g. catalog filters).
To fix this, just set the item inactive. This may be redundant with
the deactivation in `set_state_active`, or it might not be, depending
on whether the active item is visible.

Pull Request: https://projects.blender.org/blender/blender/pulls/121589
2024-05-14 05:11:07 +02:00
Clément Foucault
1589f3713a Fix: EEVEE-Next: Fix Shadow resolution limit step
The step is already multiplied by 0.01 internally.
2024-05-13 23:51:15 +02:00
Harley Acheson
41bbbd2359 UI: Color Tooltips
Hovering over a color button shows a tooltip that includes the color
values and a large sample.

Pull Request: https://projects.blender.org/blender/blender/pulls/117815
2024-05-13 23:48:29 +02:00
Harley Acheson
92e0545e9f UI: Remove BLF_draw_default_shadowed
With Aras's recent changes in #121383, our text shader now supports
outline shadows, which gives a result that has more contrast than can
be achieved with BLF_draw_default_shadowed. This removes that function.

Pull Request: https://projects.blender.org/blender/blender/pulls/121676
2024-05-13 22:32:59 +02:00
Falk David
fccdf7da0c Refactor: GPv3: Paste keyframes operator
The operator used `layer->remove_frame` which has been
replaced with `grease_pencil.remove_frames`.

Also makes a few variables `const` and cleans up some
namings.
2024-05-13 18:41:08 +02:00
Clément Foucault
e72c47751d EEVEE-Next: UI Shadow Resolution Limit
Improve naming and tooltips. Also fix a bug in the UI script.
2024-05-13 18:39:47 +02:00
Falk David
65f05f4284 Cleanup: GPv3: Remove unnecessary layer group API functions
The `LayerGroup` class had an API to add layers and layer groups.
The only thing these did was allocate a new layer/group and then
call the `add_node` API.

This removes these functions (they were only used in a single
place anyway) and does the allocation of the new layer/group
directly in the grease pencil API. This removes a few lines of
code and makes everything a bit easier to read.
2024-05-13 18:01:20 +02:00
Falk David
7006eb4805 Cleanup: GPv3: Rename add_layer to duplicate_layer
There was an overloaded version of `add_layer` that took
a const reference to a source layer. The function would
duplicate that layer.

The function name `add_layer` was a bit confusing in this
case. Calling it `duplicate_layer` makes it a bit clearer.
2024-05-13 17:44:10 +02:00
Sybren A. Stüvel
0caf6397df Anim, remove Action::binding_for_id() method
Remove the `Action::binding_for_id()` method, as it is a bit dangerous,
only useful in a very specific situation, and can be removed altogether
with just a little bit of refactoring. This in turn made some other
functions a bit simpler too.

Almost no functional changes. The only change is that when through some
magic (aka data corruption or other bug) the Binding is no longer valid
for the animated ID's type, the IDs properties may still show as
animated in the interface.

Pull Request: https://projects.blender.org/blender/blender/pulls/121748
2024-05-13 17:30:37 +02:00
Falk David
10b5a401dc Refactor: GPv3: Use insert_frame API in duplicate layer operator
This is part of #121565.

Uses the newer `GreasePencil::insert_frame` API to insert
a key and create a drawing. This means we no longer need
to deal with the drawing index, as this is handled by
`insert_frame` internally.
2024-05-13 17:03:02 +02:00
Iliya Katueshenock
cff53fdb53 Nodes: Increase size of shader attribute name
This can be a path to a property, so this field has to be longer.

Pull Request: https://projects.blender.org/blender/blender/pulls/121595
2024-05-13 16:51:26 +02:00
Clément Foucault
f16f9d9a96 EEVEE-Next: Use closure_light_set in foward lib
Was missing from the commit that introduced it.
2024-05-13 16:33:05 +02:00
Falk David
4f2f97d498 Formatting 2024-05-13 16:28:19 +02:00
Falk David
5c9fad1582 Refactor: GPv3: Use get_drawing_at in various helper functions
Part of #121565.

Updates `get_editable_frames_for_layer` and
`retrieve_editable_drawings_grouped_per_frame`
functions to not use drawing indices, but the
`get_drawing_at` function.
2024-05-13 16:27:46 +02:00
Iliya Katueshenock
75d17b1db5 Cleanup: Move BKE_node to namespace
Move all header file into namespace.
Unnecessary namespaces was removed from implementations file.
Part of forward declarations in header was moved in the top part
of file just to do not have a lot of separate namespaces.

Pull Request: https://projects.blender.org/blender/blender/pulls/121637
2024-05-13 16:07:12 +02:00
Sybren A. Stüvel
d94a56bdad Anim: merge Animation data-block into bAction
The new/experimental, layered `Animation` data-block is merged with the
existing `bAction` data-block.

The `Animation` data-block is considerably newer than `bAction`, so the
supporting code that was written for it is also more modern. When moving
that code into `bAction`, I chose to keep the modernity where possible,
and thus some of the old code has been updated as well. Things like
preferring references over pointers.

The `Animation` data-block is now gone from DNA, the main database, etc.
As this was still an experimental feature, there is no versioning code
to convert any of that to Actions.

The DNA struct `bAction` now has a C++ wrapper `animrig::Action`, that
can be obtained via `some_action->wrap()`.

`animrig::Action` has functions `is_empty()`, `is_action_legacy()`, and
`is_action_layered()`. They **all** return `true` when the Action is
empty, as in that case none of the data that makes an action either
'legacy' or 'layered' is there.

The 'animation filtering' code (for showing things in the dope sheet,
graph editor, etc) that I wrote for `Animation` is intentionally kept
around. These types now target 'layered actions' and the
already-existing ones 'legacy actions'. A future PR may merge these two
together, but given how much work it was to add something new there, I'd
rather wait until the dust has settled on this commit.

There are plenty of variables (and some comments) named `anim` or
`animation` that now are of type `animrig::Action`. I haven't renamed
them all, to keep the noise level low in this commit (it's already big
enough). This can be done in a followup, non-functional PR.

Related task: #121355

Pull Request: https://projects.blender.org/blender/blender/pulls/121357
2024-05-13 15:58:04 +02:00
Iliya Katueshenock
73d75be5de Fix: Nodes: Don't show default value in reroute dummy tooltip
This is issue that was acsidentially introduced in 8e830a95de.

Pull Request: https://projects.blender.org/blender/blender/pulls/121689
2024-05-13 15:48:15 +02:00
Pratik Borhade
fa72f9a5d8 GPv3: Swap layer order in Stroke primitive
This makes the layer order of stroke object of both GPv2 and GPv3 consistent.
Resolves #121734.

Pull Request: https://projects.blender.org/blender/blender/pulls/121741
2024-05-13 15:46:00 +02:00
Sybren A. Stüvel
ac4e00da0d Refactor: return C++ type in BKE_pose_minmax() instead of return params
Return a `std::optional<Bounds<float3>>` instead of having two return
parameters and returning a `bool`.

No functional changes.
2024-05-13 15:42:33 +02:00
Sybren A. Stüvel
81d73881ca Cleanup: Return early in BKE_pose_minmax
Reduce cognitive complexity by returning early in `BKE_pose_minmax()`.

Also rename `changed` to `found_pchan`, as that explains better what's
being tracked.

No functional changes.
2024-05-13 15:42:33 +02:00
Sybren A. Stüvel
b4cc9329e5 Refactor: Anim, remove 'use_hidden' from BKE_pose_minmax()
Remove the `use_hidden` parameter of the `BKE_pose_minmax()` function.
This parameter was only used with `use_selected` set to the same value,
with the following effects:

- Both set to `true`: only selected bones are considered. Since hidden
  bones are automatically deselected, this effectively excluded hidden
  bones.
- Both set to `false`: explicitly excludes hidden bones.

So in both use cases hidden bones were ignored, which IMO is the correct
approach anyway, as the bounding box is used for centering in view,
snapping to bounding box, etc.

No functional changes.
2024-05-13 15:42:33 +02:00
Sybren A. Stüvel
6212c3c374 Fix #121161: Regression: Frame Selected Includes Hidden Bones
Refactor `BKE_armature_min_max()` so that it calls `BKE_pose_minmax(ob,
use_hidden=false)`. The former took neither bone visibility nor custom
bone shapes into account when computing the bounding box. Now these two
are unified, fixing the regression.

`BKE_armature_min_max()` is now basically a thin wrapper that uses more
modern C++ types in its signature. This will be cleaned up in a
follow-up refactor commit.

Another difference is that these functions return the AABB in different
coordinate spaces (object vs. world). This isn't done entirely correctly
(just transforming the two extreme points), but in a way that is
symmetrical with `BKE_object_minmax()`.

Pull Request: https://projects.blender.org/blender/blender/pulls/121739
2024-05-13 15:42:33 +02:00
Sybren A. Stüvel
547067f599 Cleanup: Anim, add const to BKE_pose_minmax()
Make the `Object *` argument `const` in `BKE_pose_minmax()`. There is no
writing to the object to cache the bounding box, and that's now clear from
the declaration as well.

No functional changes.
2024-05-13 15:42:33 +02:00
Falk David
281bbe198d Cleanup: GPv3: Use get_drawing_at in modifier util functions
Part of #121565.

Instead of accessing the drawing indices directly, use
`get_drawing_at` in the utility functions.

Pull Request: https://projects.blender.org/blender/blender/pulls/121732
2024-05-13 15:40:36 +02:00
Falk David
a80d53bd75 Cleanup: GPv3: Use get_drawing_at in get_evaluated_grease_pencil_drawing_deformation
Part of #121565.

Use the `get_drawing_at` function instead of reading the drawing indices.
This gets us closer to not exposing the drawing indices
at all.
2024-05-13 14:54:20 +02:00
Clément Foucault
c7bc3334ad EEVEE-Next: Shadow: Add Maximum Resolution Option
This adds a light parameter to avoid near camera pixels
allocating too much shadow resolution.

This is more intuitive than the scale shadow setting and
allows reducing the precision without changing the look
of distant shadows.

For sun lights, the property sets the minimum pixel
size the shadow can contains. This allows to
remove a lot tilemap close up.

For local lights, there is another additional property
to set the maximum resolution in shadow space (like
EEVEE-Legacy) instead of in world space (like sun
lights). This allows making older files lighter and
allow a more conservative approach to resolution.

This add versionning code to handle EEVEE-Legacy files
that had fixed resolution per light type.

The resolution setting is always in world space distance
as the maximum shadow resolution distribution might change
in the future or be dependent on other parameters
(like beam angle). This ensure that there is no
dependency on these parameters, but make the
setting use very small units. But this is more of
a UI problem.

Pull Request: https://projects.blender.org/blender/blender/pulls/121701
2024-05-13 14:34:11 +02:00
Clément Foucault
ab48b08cde Fix: EEVEE-Next: Avoid syncing issues on AMD with cryptomatte
There was a missing barrier, which created
blocky, non-deterministic artifacts in the
cryptomatte render tests.
2024-05-13 14:10:26 +02:00
Jeroen Bakker
e0da623d33 Vulkan: Don't record drawlist commands for invalid batches
Overlay engine extra layer can record draw list commands with an
empty index buffer. This would not affect any pixels and should be
ignored.

Issue detected when vulkan validation layers are turned on and loading
default scene.

Pull Request: https://projects.blender.org/blender/blender/pulls/121736
2024-05-13 14:09:37 +02:00
Jeroen Bakker
5c369768d7 Vulkan: Revert incorrect fix for begin rendering
Reverting a quick fix which didn't solve the root cause. The root
cause was fixed by #121723.

Pull Request: https://projects.blender.org/blender/blender/pulls/121726
2024-05-13 13:28:05 +02:00
Brecht Van Lommel
7f912e09c7 Assets: Sort by library name if all else is equal
Previously this would be random, which makes the order in the asset
shelf unpredictable when duplicating an essentials brush asset and
keeping the same name.
2024-05-13 13:22:49 +02:00
Falk David
22d8d52058 Temp fix: Assert in CTX_wm_region_popup_set for debug builds
Caused by 7ae77e61cd.
Opening files and templates would cause an assert to be hit in
debug mode.

For now, comment the assert out to temporarily fix the issue.
2024-05-13 13:11:18 +02:00
Falk David
750ab86b5c Cleanup: GPv3: Use get_drawing_at in grab sculpt tool
Part of #121565.

Instead of using the drawing index to get the drawing,
use `get_drawing_at`.

Pull Request: https://projects.blender.org/blender/blender/pulls/121731
2024-05-13 12:13:50 +02:00
Falk David
69f3062909 Cleanup: GPv3: Use get_editable_drawing_at in draw tool
Instead of using the `drawing_index` use the `get_editable_drawing_at`
function to retrieve the drawing.
2024-05-13 11:43:22 +02:00
Falk David
7f8d4df410 UI: Add eyedropper button to camera focus distance
Blender already had the ability to sample the depth with an eyedropper
and fill the focus distance (see `"ui.eyedropper_depth"`). But this feature
was fairly hidden. You had to hover over the `focal_distance` property
in the camera data panel and then press `E` (then sample a distance
in the 3D viewport).

This patch adds a `prop_data_path` property to the `ui.eyedropper_depth`
operator to allow specifying the property that should be filled with the
depth value.

The idea for this is taken from `wm.radial_control`, which also uses this
approach to write to a property. This allows us to add the eyedropper
as a button.

Pull Request: https://projects.blender.org/blender/blender/pulls/121486
2024-05-13 11:01:57 +02:00
Aras Pranckevicius
39150096d8 Fix #121720: OBJ does not import some curves properly
If a curve was not using U parameter range of 0..1, the importer
did not properly detect whether the "U endpoint" flag should
be set on it. Fixed that, along with test coverage for the case.
2024-05-13 11:45:20 +03:00
Jeroen Bakker
b998697d4f Vulkan: Fix out of bound access in begin rendering
There is an implementation flaw in the render graph where local pointers
cannot be updated, but the data it refers to can be reallocated to
another location.

The cause of this is that the nodes use an union, which can only contain
simple constructed structs (eg memcpy). this union is stored in a vector
and can relocate the union. Any local pointers can (and will) become
invalid.

This PR is a quick fix by updating the pointers just before sending
them to the command buffer. In future a better fox needs to be done
as part of #121649.

Pull Request: https://projects.blender.org/blender/blender/pulls/121723
2024-05-13 09:35:36 +02:00
Jason Fielder
405be29540 Metal: Fix texture update data sizing for compressed textures
Resolves issue for texture data upload sizing not taking
compressed texture input data size into account.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/121210
2024-05-13 09:35:08 +02:00
Sergey Sharybin
f9f7173a15 Cleanup: Strict compiler warning, unused function argument
Pull Request: https://projects.blender.org/blender/blender/pulls/121725
2024-05-13 09:29:38 +02:00
Jeroen Bakker
ca40b12240 Vulkan: Remove unneeded device usage in render graph tests
The render graph tests initialized a command buffer wrapper that
requires a working device. The wrapper was not used, but when
destructing it would try to deallocate the command buffer, which
cannot be done as that requires a working device as well.

This PR removes the unneeded command buffer wrappers in the test
cases.
2024-05-13 08:32:58 +02:00
Campbell Barton
83b6a4dfbd Extensions: add a repository option to check for updates on startup
Optionally check for updates on startup (disabled by default),
used when experimental extensions support is enabled.
2024-05-13 12:38:46 +10:00
Charles Wardlaw
2db96ee8ca Build: USD: Small fix to allow compiling against both 23.11 and 24.05
The API in question was modified as part of [1] several months ago. The
example scene in the PR now displays correctly with both USD versions.

[1] 7469ddd8bd

Pull Request: https://projects.blender.org/blender/blender/pulls/121636
2024-05-13 03:02:31 +02:00
Lukas Tönne
db1443249c GPv3: Snap operators for edit mode
Implements snapping for grid, selected-to-cursor, and cursor-to-selected,
as well as the regular menu and pie menu for these operators.

Pull Request: https://projects.blender.org/blender/blender/pulls/121582
2024-05-12 10:24:07 +02:00
Clément Foucault
e63fef6162 Fix: EEVEE-Legacy: Broken Specular BSDF 2024-05-11 17:08:15 +02:00
Clément Foucault
b76960673f Fix: DRW: Thread safety in pointcloud IBO builder
`GPU_indexbuf_add_tri_verts` is not threadsafe.
Use direct memory access.

Also cleanup to increase code clarity.
2024-05-11 15:40:44 +02:00
Clément Foucault
73a496121b DRW: PointCloud: Multithread index buffer creation 2024-05-11 14:00:28 +02:00
Clément Foucault
41b0e11839 DRW: Reduce number of bits used to store shape indice
Fix #108901
2024-05-11 14:00:28 +02:00
Aras Pranckevicius
aa350a945d Cleanup: format 2024-05-11 14:42:34 +03:00
Clément Foucault
414854a09f Metal: Change error assert into system backtrace
This matches the behavior of the GL backend debug.
2024-05-11 12:47:23 +02:00