Commit Graph

130225 Commits

Author SHA1 Message Date
Philipp Oeser 0eb279de54 Fix #66286: DblClick to rename UIList items within a popover not working
Looks like most of `ui_apply_but_XXX` or `ui_do_but_XXX` functions rely
on `uiHandleButtonData` (and not necessarily context).

Now the problem from a popover in `ui_but_list_row_text_activate` was
that the label button to be set in BUTTON_ACTIVATE_TEXT_EDITING for
renaming could not be found because it was using the "wrong" region from
context (`CTX_wm_region` - which still seem to point to the region the
popover was spawned from). The correct region is available in
`uiHandleButtonData` though, so now use this instead.

Not totally sure if `CTX_wm_region` should actually be correct in all
cases - which would hint at an underlying problem of not setting it
right - but since other functions rely on `uiHandleButtonData` as well,
this fix seems to make sense.

Fix should go into LTS I think.

Pull Request: https://projects.blender.org/blender/blender/pulls/114363
2023-11-07 10:11:30 +01:00
Hans Goudey ae1b4a6a28 Cleanup: Consolidate draw attribute extraction
Use the same attribute conversion class for PBVH and regular
mesh attribute extraction. This makes the GPU formats we use
for each attribute type more explicit and centralizes the conversions
from the attribute types to the GPU types. It's also a bit more aligned
to how we could use implicit sharing for GPU vertex buffer data.

Unfortunately it isn't possible to use this same code for curves
and point clouds because they use textures for their evaluated data,
and 3-wide vectors (e.g. `float3`) aren't supported on GPUs with our
current texture abstraction. For generic attributes, the long term
approach will probably be to use an SSBO instead.

Pull Request: https://projects.blender.org/blender/blender/pulls/114340
2023-11-07 10:05:13 +01:00
Hans Goudey 15f1fe5ddb Cleanup: Add missing includes to node anonymous attribute header 2023-11-07 09:50:51 +01:00
Jeroen Bakker b56382b38a Cleanup: Make format 2023-11-07 08:04:17 +01:00
Jason Fielder bbb71f0859 Metal: Ensure pending MTLSafeFreeList is released on shutdown
Ensure that on closing of the application, all pending
SafeFreeLists are released. A new change to ensure
release of SafeFreeLists was always deferred until
full completion of GPU buffers meant that a pending
MTLSafeFreeList container may not be released on
shutdown.

This change ensures that the container is fully
destructed on final shutdown.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/114532
2023-11-07 07:53:20 +01:00
Alaska 967e36cf68 UI: Don't show HDR setting when using False Color view transform
False Color view transforms doesn't show HDR values.

Pull Request: https://projects.blender.org/blender/blender/pulls/114503
2023-11-07 07:48:54 +01:00
Alaska d6cafda3bb Fix #114491: Incorrect HDR tooltip
Mention that AgX also doesn't produce HDR information for the
HDR display feature on macOS.

Pull Request: https://projects.blender.org/blender/blender/pulls/114502
2023-11-07 07:45:36 +01:00
Campbell Barton 611930e5a8 Cleanup: use std::min/max instead of MIN2/MAX2 macros 2023-11-07 16:33:19 +11:00
Campbell Barton 6297bbe931 License headers: attribute copyright to "Blender Authors"
See #110784, it seems that merging functionality reintroduced the old
convention.
2023-11-07 15:42:52 +11:00
Campbell Barton dfd363edbd Cleanup: add SPDX-FileCopyrightText 2023-11-07 15:37:47 +11:00
Campbell Barton 79917e7bb3 Cleanup: minor corrections & clarifications for undo tests 2023-11-07 15:17:26 +11:00
Richard Antalik 9463135fed Fix incorrect assumption when handling overlap
In `shuffle_seq_time_offset_get()` code tried to check whether
`strips_to_shuffle` would overlap with each other, but this was done
incorrectly. This check relied on result of `shuffle_seq_test_overlap()`
but that function assumes, that only 1 strip of its input is transformed
by `offset`. This means, that if 2 strips are moved by same offset and
overlap is checked against each other it could result in true return
value. However this is checked in the code already by
`strips_to_shuffle.contains(seq_other)`, in which case loop continues.
This resulted in emmision of warning which was incorrect.

The issue is fixed by continuing loop if `strips_to_shuffle` contains
`seq_other` as first precondition to signify, that this is expected and
in fact inevitable case. `shuffle_seq_test_overlap()` does not check
whether 2 passed strips are equal, rather `BLI_assert` is used to
signify, that this is not valid use-case.

Since the warning can not happen, the logging was removed.
2023-11-07 05:06:33 +01:00
Richard Antalik 570799374f Fix #114542: VSE overlap not handled correctly
Caused bu mistake in refactoring - tested `seq` instead of `seq_other`.
2023-11-07 05:06:32 +01:00
Campbell Barton f2fcfc8730 Tests: move undo tests from SVN into tests/python/ui_simulate 2023-11-07 14:55:30 +11:00
Campbell Barton 1496aa9d3e Tests: support running Blender with pre-compiled WAYLAND libraries 2023-11-07 14:15:12 +11:00
Campbell Barton b771ce8ce4 Build: disable some unnecessary tools & options for WESTON 2023-11-07 14:14:54 +11:00
Campbell Barton 865944734f Build: add the WESTON compositor for Linux
WESTON is used when WITH_UI_TESTS is enabled.

Note that the system WESTON installation can be used by setting
WESTON_BIN to a path on the users system.

Ref !114164.
2023-11-07 12:57:45 +11:00
Campbell Barton 126f3bcfc1 Tests: support running graphical tests as part of CTests
User a Blender wrapper `tests/utils/blender_headless.py` to runs a
graphical instance of Blender within a headless weston compositor.

Currently only WAYLAND is supported as a back-end, support for other
platforms is possible. The tests can run from X11 since the tests don't
depend on existing instances of X11 or WAYLAND.

- Each test runs a separate headless instance of WESTON
  since the overhead is minimal, this allows tests to run in parallel
  without interfering with each other.

- There is a CMake option WESTON_BIN, when left empty the weston
  from LIBDIR is used. Otherwise this can point to the weston binary
  installed on the users system.

- In most cases simulated events are needed to implement these tests
  (running blender with `--enable-event-simulate`).

- This commit adds 14 undo tests - simulating user interaction as well
  as undo/redo actions, ensuring the desired result is reached.
  Other kinds of UI tests could be added in the future.

Ref !114164
2023-11-07 12:40:12 +11:00
Campbell Barton afd5faceec Tools: add edit to use std min/max instead of MIN2/MAX2 macros 2023-11-07 11:57:02 +11:00
Campbell Barton aaf05c2497 Cleanup: various C++ changes (use nullptr, function style casts) 2023-11-07 11:35:16 +11:00
Campbell Barton 1e66938d7a Cleanup: spelling in comments, format 2023-11-07 11:35:16 +11:00
Campbell Barton c450b5f2b8 Cleanup: use full sentences in writefile.cc, minor clarifications
Also correct doxy-sections.
2023-11-07 11:31:02 +11:00
Campbell Barton 79840a9ec6 Cleanup: early returns in BLF, use full scentences 2023-11-07 11:31:01 +11:00
Julian Eisel 480dceab12 Asset shelf: Drag over checkboxes to enable/disable catalogs in selector
Makes it possible to swipe over the checkboxes used to enable or disable
catalogs in the asset catalog selector popup, to batch enable or disable
the ones dragged over.

Might also enable this feature for other cases where checkboxes are
displayed.
2023-11-06 22:22:54 +01:00
Julian Eisel 837e33c054 Merge branch 'blender-v4.0-release' 2023-11-06 21:54:33 +01:00
Julian Eisel abe925d0c6 Fix #114436: Crash when right clicking certain, nested, popup dialogs
`CTX_wm_region()` isn't reliable with popups. Handling should use
`uiHandleButtonData.region` instead, which respects popup regions.
2023-11-06 21:53:41 +01:00
Miguel Pozo 0db6d8a5fc EEVEE-Next: Fix shadow tests
Fix an issue in `find_first_valid` where Nvidia would incorrectly
increment `src` after return.
This should fix the issue where some tiles would stay corrupted
until resetting EEVEE.

Initialize tiles_data in `TestAlloc` so it doesn't fail in debug builds.

Pull Request: https://projects.blender.org/blender/blender/pulls/114550
2023-11-06 20:35:14 +01:00
Aras Pranckevicius 6e4adbe694 Cleanup: use_holes arg to isect_point_poly_v2 has been ignored since 2013
07851dd8df made the use_holes argument be no longer used.
2023-11-06 20:51:21 +02:00
Aras Pranckevicius 03bbdd804c Cleanup: move math_geom.c to c++ 2023-11-06 20:51:13 +02:00
Brecht Van Lommel adb41fe6b2 Merge branch 'blender-v4.0-release' into main 2023-11-06 19:13:18 +01:00
Brecht Van Lommel fe9e28c086 Fix build error on macOS x86, after Metal motion blur workaround
Ref #114544
2023-11-06 18:50:25 +01:00
Brecht Van Lommel 0dad164505 Fix #114540: macOS crash on startup after recent changes in c2b755a3c0
Thanks to Michael Parkin-White for finding the cause.

Ref #114513
2023-11-06 18:37:45 +01:00
Bogdan Nagirniak 10848b9774 Fix #114229: Hydra MaterialX crash when node name starts with digit
Pull Request: https://projects.blender.org/blender/blender/pulls/114471
2023-11-06 18:11:38 +01:00
Michael Jones 4f52ab0b49 Cycles: Workaround MetalRT TLAS build hanging in some motion blur scenes
This PR works around an issue where zero-filled motion TLAS instance descriptors can cause unexpected hangs during downstream TLAS builds on M3. Instead of zeroing the descriptor we insert an explicit "null" BLAS, achieving the same result.

Pull Request: https://projects.blender.org/blender/blender/pulls/114544
2023-11-06 17:30:48 +01:00
Alaska f1116f64bd Fix #114435: Harsh Principled BSDF Subsurface transition in EEVEE
Fixes a harsh transistion between diffuse and subsurface scattering
materials in the Principled BSDF as a user increases the Subsurface
Scattering Weight from 0 to 1.

Pull Request: https://projects.blender.org/blender/blender/pulls/114500
2023-11-06 17:25:14 +01:00
Thomas Barlow 9956ef4622 PyAPI: Allow prop collection raw array read access for non-editable props
Non-editable prop collection items would always fall back to the slower
loop in `rna_raw_access`.

This patch changes `RNA_property_collection_raw_array` to only fail with
non-editable items when intending to set values, allowing for the faster
raw array access to occur when reading values in `rna_raw_access`.

This brings the Python API `bpy_prop_collection.foreach_get` performance
of `Mesh.vertex_normals`/`polygon_normals`/`corner_normals` up to the same
speed as generic `FLOAT_VECTOR` attributes with the same domains.

Given a mesh with 393216 corners:

Using `foreach_get` with the "vector" prop and a compatible buffer object:
- Corner vector attribute: ~0.9ms
- Corner normals (before): ~7.9ms
- Corner normals (after):  ~0.9ms

Using `foreach_get` with the "vector" prop and a Python list:
- Corner vector attribute: ~11.0ms
- Corner normals (before): ~18.0ms
- Corner normals (after):  ~11.0ms

Pull Request: https://projects.blender.org/blender/blender/pulls/114063
2023-11-06 15:51:07 +01:00
Miguel Pozo 6d0b5e2ace EEVEE-Next: New shadow settings
Remove `Material > Shadow Mode` and use `Object > Shadow Ray Visibility`
and `Material > Transparent Shadows` instead.

The versioning system auto-updates objects/materials in EEVEE
scenes so their behavior is as close as possible to the previous one.

Update Cycles to use the native `use_transparent_shadow` property.

Note:
Material changes don't set any `recalc` flag on the objects that use
them, so the EEVEE Next shadow maps don't update when changing
settings/nodes.
Fixing this issue is required for 4.1, but it's out of the scope of this PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/113980
2023-11-06 15:45:00 +01:00
Omar Emara 5258b17ef6 Fix #114260: Compositor sometimes produces straight alpha
The compositor sometimes produces straight alpha even though
premultiplied alpha is expected. Moreover, there is an inconsistency
between the CPU and GPU compositors.

For the GPU compositor, this is because GPU textures sometimes store
straight alpha, while the compositor always expects premultiplied alpha,
so we need to premultiply the alpha in those cases.

For the CPU compositor, this is because the image operation didn't
premultiply the alpha of byte textures, so we need to ensure
premultiplied alpha in those cases.

There is a data loss issue in case of byte images, since the IMB module
unpremultiplies premultiplied images then the compositor premultiplies
it again. But this will be handled in a different patch since it require
some design and refactoring first.

Pull Request: https://projects.blender.org/blender/blender/pulls/114305
2023-11-06 15:15:22 +01:00
Bastien Montagne 056595e5fb Merge branch 'blender-v4.0-release' 2023-11-06 13:10:49 +01:00
Bastien Montagne 46e291470f I18N: Updated translations from git/weblate repository. 2023-11-06 13:09:17 +01:00
Bastien Montagne e31a05b56f Merge branch 'blender-v4.0-release' 2023-11-06 12:49:05 +01:00
Falk David 2529aa6584 GPv3: Include current frame in multi-frame editing
When enabling multi-frame editing, also include the current frame
as editable. Not just the selected frames in the dopesheet.
This was a regression introduced in #114283.
2023-11-06 12:29:33 +01:00
Bastien Montagne 551927bbe3 Fix crash when opening AssetShelf the first time, in some cases.
When click-dragging on the 'up-arrow' of the asset-shelf to show it the
first time, some resizing operation could get called before the shelf
region was initialized, leading to crash on null pointer access.
2023-11-06 11:58:41 +01:00
Pratik Borhade e5327fa5b7 Fix #114521: Walk navigation global up does not work
Mistake in 93f6001683

Pull Request: https://projects.blender.org/blender/blender/pulls/114526
2023-11-06 11:24:36 +01:00
Campbell Barton c2b755a3c0 Cleanup: remove unsafe string API use for MTL shader generation on macOS
Ref !114513
2023-11-06 21:23:08 +11:00
Sybren A. Stüvel 45c74d8c9f Fix array out-of-bounds in VSE drawing code
Change `bg_colors[4]` to `bg_colors[3]` as the array has only 4 elements.
2023-11-06 11:02:07 +01:00
Campbell Barton f533fade0f Merge branch 'blender-v4.0-release' 2023-11-06 20:58:21 +11:00
Campbell Barton 27bb822511 Cleanup: remove unused variable 2023-11-06 20:58:11 +11:00
Campbell Barton c7afbbc836 Fix potential buffer overflow in strcpy use on macOS
The null byte wasn't taken into account when allocating memory
to strcpy into.

The calculation to check if allocation was needed  was also wrong,
causing allocation for every string.

In practice it's not so likely users would ever hit this since
the function tended to over allocate, even in the case an off by one
error occurred, in all likelihood the room would already be available.

Ref !114512
2023-11-06 20:54:21 +11:00
Omar Emara 99712d17fd Merge branch 'blender-v4.0-release' 2023-11-06 11:49:24 +02:00