Commit Graph

136119 Commits

Author SHA1 Message Date
nutti
0d34f59854 Cleanup: Mark method as static to fix pylint error
Pull Request: https://projects.blender.org/blender/blender/pulls/121688
2024-05-13 16:02:56 +02:00
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 8e830a95deac0aa9fa0e.

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
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
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
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
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
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
Lukas Tönne
bacfec10bb Cleanup: GPv3: Rename _defs_paint_grease_pencil for consistency
Rename the `_defs_paint_grease_pencil` toolsystem definition to
`_defs_grease_pencil_paint` for consistency with other definitions,
like `_defs_grease_pencil_sculpt`.
2024-05-13 14:11:59 +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 7ae77e61cd06069ad6517d2684acc487ea661cb6.
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
Pablo Vazquez
6e42c3d920 UI: Sequencer Overlays layout improvements
Follow the layout closer to the 3D Viewport overlays.

* Wider, to fit two-column layout and translations.
* Move general settings on top.
* Move strips-related overlays into their own subpanel.
* Move `Thumbnails` higher up so it's more easily reachable.
* Rename `F-Curves` to `Animation Curves`.
* Remove redundant labels.
* Gray out "Waveform Style" when set to Off.

Pull Request: https://projects.blender.org/blender/blender/pulls/121591
2024-05-13 12:25:35 +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 Stockner
12bf5ff7d4 Cycles: Cleanup: Remove unused hash function
Also move the remaining one to util/hash.h.
2024-05-13 02:48:54 +02:00
Lukas Stockner
4a1597e39a Cycles: Add tests for Thin Film in Principled BSDF 2024-05-12 22:29:08 +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
Clément Foucault
d27cc47a74 Fix: EEVEE-Next: Missing panel in node editor
Fix #120627
2024-05-11 12:47:23 +02:00
Pratik Borhade
05be3413a9 Fix: Warning due to lower case gpv3 menu identifier
Caused by 30e3f14bcd338c3a21b6a222910b8e5870224f30

Pull Request: https://projects.blender.org/blender/blender/pulls/121684
2024-05-11 12:44:26 +02:00
Michael Jones
09ba1486f8 Cycles: Select Metal compute device by default on Apple Silicon machines
_No response_

Pull Request: https://projects.blender.org/blender/blender/pulls/121672
2024-05-11 09:32:55 +02:00
Jacques Lucke
c3fc905544 Fix: potentially missing initialization 2024-05-11 09:30:57 +02:00
YimingWu
c324c19765 Fix #121021: Avoid size change of addon_modules during iteration
Copy modules before filtering `addon_modules` to avoid
change of dictionnary size during iterations. Otherwise errors
can be triggerd when running `python -m pytest test.py` since
it may modify the module dict.

Co-authored-by: Alexis-19 <alexis-19@noreply.localhost>
Pull Request: https://projects.blender.org/blender/blender/pulls/121100
2024-05-11 08:58:20 +02:00
Matthew Krueger
1953f3cd51 Fix #121605: MacOS Crashes on Desktop with shortcut to non-mounted (and non-mountable) drive
By adding NSURLBookmarkResolutionWithoutMounting to options to keep MacOS from attempting to mount shortcuts.

This addresses that blender hangs and crashes if there's a shortcut to a network drive that cannot be mounted at that time.

Pull Request: https://projects.blender.org/blender/blender/pulls/121673
2024-05-11 04:39:33 +02:00
Brecht Van Lommel
0d4e4e3f42 Cleanup: Remove unused scene argument from foreach_nodeclass 2024-05-10 21:58:43 +02:00
Brecht Van Lommel
33e8b12a43 Cleanup: Pass main expand callback directly to function 2024-05-10 21:58:43 +02:00
Aras Pranckevicius
c78e4d203c Fix linux build 2024-05-10 22:35:33 +03:00
Aras Pranckevicius
3582e52f9c UI: Improved overlay text contrast with new outline text decoration
Overlay texts were previously drawn with two sets of shadows:
- 3px blur,
- 5px blur, slightly offset

But since the shadow color was always set to black, it was still
causing legibility issues when the text itself was dark (set
via theme for example).

This PR adds a new "outline" BLF text decoration, and uses that
for the overlays. And it picks text/outline color depending
on the "background" color of the view.

Details:

- Instead of "shadow level" integer where the only valid options
  are 0, 3 or 5, have a FontShadowType enum.
- Add a new FontShadowType::Outline enum entry, that does a 1px
  outline by doing a 3x3 dilation in the font shader.
- BLF_draw_default_shadowed is changed to do outline, instead of
  drawing the shadow twice.
- In the font shader, instead of encoding shadow type in signs of
  the glyph_size, pass that as a "flags" vertex attribute. Put
  font texture channel count into the same flags, so that the
  vertex size stays the same.
- Well actually, vertex size becomes smaller by 4 bytes, since turns
  out glyph_mode vertex attribute was not used for anything at all.

Images in the PR.

Co-authored-by: Harley Acheson <harley.acheson@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/121383
2024-05-10 21:06:44 +02:00
Jeroen Bakker
b78875c675 Vulkan: Disable failing test
Result isn't consistent on Windows platform due to copying structs with arrays.
This is a quick fix and will be looked at next week. The code isn't used at this moment.

Pull Request: https://projects.blender.org/blender/blender/pulls/121670
2024-05-10 20:29:25 +02:00
Iliya Katueshenock
ba4c225737 Cleanup: Protect GValue template from Void pointer
Only typed pointer should go in default constructor with template.

Pull Request: https://projects.blender.org/blender/blender/pulls/121669
2024-05-10 20:28:01 +02:00