Commit Graph

103448 Commits

Author SHA1 Message Date
Campbell Barton
91011b06a0 Merge branch 'blender-v4.0-release' 2023-10-06 17:15:10 +11:00
Campbell Barton
edfc78e0f2 Merge branch 'blender-v4.0-release' 2023-10-06 17:15:07 +11:00
Campbell Barton
35edcf2ed6 Fix #107594: Phantom cursor motion when resizing windows under Wayland
Resizing a window in Wayland caused cursor motion events in the window
which could be seen as buttons flashing when the cursor was detected
as hovering over buttons.

This was caused by two bugs:

- Missing checks for failure to access the cursor location before
  converting the coordinates from GHOST to screen-space meant the
  wmWindow::eventstate location would move each time the location
  was updated.

- Resizing the window wasn't detecting state changes and would
  continuously send window activation events. Window activation set
  wmWindpw::addmousemove which triggered the previous bug, making the
  cursor flicker during resize.

This commit only addresses the first issue, where failure to access
the cursor location wasn't accounted for
(window activation will be fixed separately).

All GHOST_GetCursorPosition & wm_cursor_position_get calls now account
for failure, resolving uninitialized stack memory use in some cases.

This resolves similar issues for macOS, WIN32 & X11 although it seems
likely these platforms rarely fail to access the cursor location.
2023-10-06 17:12:32 +11:00
Jeroen Bakker
4a94e17156 Cleanup: Remove unused attribute in GLShaderInterface 2023-10-06 07:47:08 +02:00
Jeroen Bakker
c801c73d79 Python: Update BGL Deprecation Warning
BGL is deprecated and will not work on Metal devices. Although the
inital plan was to remove it in Blender 4.0, We don't see any harm
to still have it in the code-base until OpenGL itself is deprecated.

Add-on developers are warned when using the BGL module that the
add-on/script will not work on all platforms.

There are still some limitations inside the GPU module that needs
a more friendly API. This API isn't clear at this time.

Pull Request: https://projects.blender.org/blender/blender/pulls/112579
2023-10-06 07:37:44 +02:00
Campbell Barton
bd66e2e662 Cleanup: use defines for superscript numbers in unit.cc 2023-10-06 14:12:26 +11:00
Campbell Barton
2b77cd726d Cleanup: wrap definitions across multiple lines, add struct identifiers
When units were initially defined having each on their own line was
compact, since them more fields have been added, making the lines
overly long and the difference between each field non-obvious.

Further, the conversion from C to C++ [0], wrapped definitions onto the
same line (for some reason), resulting in lines over 700 wide.

Use clang-format & add struct ID's for clarity.

[0]: 129f78eee7
2023-10-06 13:57:52 +11:00
Campbell Barton
ade74a6584 Merge branch 'blender-v4.0-release' 2023-10-06 13:27:23 +11:00
Campbell Barton
5e2b8c43e4 Fix invalid collection length for dummy unit collection
While this didn't show up as a bug, if this length was used it could
result in an out of bounds read.
2023-10-06 13:23:42 +11:00
Campbell Barton
a52c597051 Cleanup: correct argument name (wasn't following conventions) 2023-10-06 12:50:51 +11:00
Campbell Barton
71b1712d79 Cleanup: spelling in comments 2023-10-06 12:50:27 +11:00
Jesse Yurkovich
9a5f5ca6a9 Cleanup: make format 2023-10-05 18:11:54 -07:00
Jesse Yurkovich
d47ceb53f8 Cleanup: Replace usage of old BLI_array macros with C++ types
This replaces the older dynamic c arrays with blender::Vector as
appropriate. Many files required minimal changes and the before/after
are quite similar.

There's 3 remaining usages of the old machinery but those will require
more involved changes and design.

See #103343

Pull Request: https://projects.blender.org/blender/blender/pulls/110981
2023-10-06 03:02:17 +02:00
Lukas Stockner
7d908ed091 Merge branch 'blender-v4.0-release' 2023-10-06 02:26:33 +02:00
Hans Goudey
ecb52140cd Fix #113128: Socket hide value not copied to group input
This needs to be copied explicitly to the interface socket.

Pull Request: https://projects.blender.org/blender/blender/pulls/113286
2023-10-06 00:43:45 +02:00
Brecht Van Lommel
1849e192fa Merge branch 'blender-v4.0-release' into main 2023-10-05 22:03:29 +02:00
coyo_t
b0706a57ac Fix #106760: Cycles OSL boolean socket not working
Pull Request: https://projects.blender.org/blender/blender/pulls/109576
2023-10-05 21:55:10 +02:00
Brecht Van Lommel
9e8ded92e5 Merge branch 'blender-v4.0-release' into main 2023-10-05 20:00:07 +02:00
Denis Kovacs
7a9284107d USD: Improve camera import/export and round-tripping
Fix various issues in import and export of cameras.

* Wrong units and flipped shift values on import
* Wrong clip start lower range on import
* Wrong units for aperture and focal length properties on export
* Issue with auto sensor fit and height > width on export

Pull Request: https://projects.blender.org/blender/blender/pulls/112905
2023-10-05 19:47:11 +02:00
Miguel Pozo
40f93532bb Fix: EEVEE-Next: Irradiance Grid baking
Regression caused by e2cef1c713
2023-10-05 19:37:04 +02:00
Jason Fielder
57a3ab29cc Metal: EEVEE Next: Optimize Virtual shadow maps for Apple Silicon
Optimization of EEVEE Next's Virtual Shadow Maps for TBDRs.
The core of these optimizations lie in eliminating use of
atomic shadow atlas writes and instead utilise tile memory to
perform depth accumulation as a secondary pass once all
geometry updates for a given shadow view have been updated.

This also allows use of fast on-tile depth testing/sorting, reducing
overdraw and redundant fragment operations, while also allowing
for tile indirection calculations to be offloaded into the vertex
shader to increase fragment storage efficiency and throughput.

Authored by Apple: Michael Parkin-White

Co-authored-by: Michael Parkin-White <mparkinwhite@apple.com>
Co-authored-by: Clément Foucault <foucault.clem@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/111283
2023-10-05 19:02:39 +02:00
Bastien Montagne
acde11f159 Cleanup: wmJobs: Use defined startjob callback type everywhere.
For some reasons, `WM_jobs_stop` and `WM_jobs_kill` would use their own
'type' of function pointer - and not even a matching one!

Among (many) other reasons why this was bad, it required very stupid
casting from code using these functions - and made editing wmJob `startjob`
signature needlessly complicated.
2023-10-05 16:13:15 +02:00
Miguel Pozo
b4de568cc4 EEVEE-Next: Tests support
Enable tests for EEVEE Next.

As a workaround for allowing the use of EEVEE Next (still an
experimental feature) with `--factory-startup`, `arg_handle_engine_set`
enables the feature when `-E BLENDER_EEVEE_NEXT` is used.
In addition, EEVEE Next is always registered, so it's available when
calling `WM_init`.
If it's actually disabled, it will be immediately unregistered after that.

Notes:
- `get_gpu_device_type` always fails with error:
  > GPU API is not available in background mode
- Setup and tests are the same as EEVEE. There are many tests that
  only make sense for Cycles, and many EEVEE Next features that are
  not actually tested.

Pull Request: https://projects.blender.org/blender/blender/pulls/112161
2023-10-05 16:02:49 +02:00
Sergey Sharybin
361d4abbfc Merge branch 'blender-v4.0-release' 2023-10-05 15:18:05 +02:00
Sergey Sharybin
ba767610cf Fix #113280: Incorrect display of Cycles border render while rendering
A regression since d579ac2b3f.

Cycles delays allocation of the render buffers, which makes it impossible
to access effective render resolution during rendering. This was making the
drawing code to fall-back to the full scene resolution with only percentage
and crop accounted for.

This change makes it so an empty ImBuf is used to communicate the render
result resolution. It does not have any pixel buffer associated with it,
which actually matches the behaivor prior to the offending commit.

Pull Request: https://projects.blender.org/blender/blender/pulls/113282
2023-10-05 15:16:15 +02:00
Bastien Montagne
6aba08288b Merge branch 'blender-v4.0-release' 2023-10-05 14:40:28 +02:00
Damien Picard
730bb2ee3e I18n: make new bones and bone collections' names translatable
Newly created bones and bone collections get a default name. Like
other types of data, these names should be translated if the user
enabled the translation of new data in the preferences.

This commit adds the appropriate `DATA_()` macro:
- when creating a new armature;
- when creating a new bone;
- when creating a new bone collection through `ANIM_bonecoll_new()`;
- when ensuring that a new bone collection has a unique name;
- when renaming a bone collection;
- in the bone collection tests, to check that new bones have the
  expected translated name.

It also sets the default value of the bone name in the
`ARMATURE_OT_bone_primitive_add()` operator to a null string instead
of "Bone", so that the default name may be chosen while checking for
unique names, since an empty string will default to the translation.

Pull Request: https://projects.blender.org/blender/blender/pulls/113171
2023-10-05 14:38:51 +02:00
Sybren A. Stüvel
0e420ea7ba Merge remote-tracking branch 'origin/blender-v4.0-release' 2023-10-05 14:36:46 +02:00
Omar Emara
a609af06f9 Cleanup: Clarify the use of DrawDataList 2023-10-05 14:49:51 +03:00
Omar Emara
8860dc9910 Fix: GPU compositor always returns first view
The experimental GPU compositor always returned the first view in
multi-view rendering. This patch fixes that by also checking for the
view name of the context when searching for the appropriate pass.
2023-10-05 13:51:56 +03:00
Jeroen Bakker
355f457cd4 EEVEE-Next: Fix Reflection Probes Sampling
When the scene has reflection probes the sampling would be reset
each frame making the viewport always redraw and not resolve.

The reason was a logic error that was introduced when we introduced
a less flickering update for reflection probes.

Pull Request: https://projects.blender.org/blender/blender/pulls/113281
2023-10-05 11:27:31 +02:00
Jeroen Bakker
f1c0ec3c4b EEVEE-Next: Remove Unused Resources in Probe Capture Pipeline
The probe capture pipeline still had some bindings from the previous
implementation. This could result in overwriting the `gbuf_header_tx`
with the incorrect texture as it was sharing the same binding.

This PR removes the unused light probe bindings.

Pull Request: https://projects.blender.org/blender/blender/pulls/113276
2023-10-05 10:52:47 +02:00
Jeroen Bakker
3d1da2532b EEVEE-Next: Fix Crash With Exact 128 Resources
When the scene has exact 128 resources or a multiple in the scene
Blender crashes as the velocity buffer doesn't allocates the
right amount of space inside its buffer.

Pull Request: https://projects.blender.org/blender/blender/pulls/113277
2023-10-05 10:52:26 +02:00
Damien Picard
e773e0952a I18n: fix translation of Grease Pencil 3.0 layer names
The Grease Pencil 3.0 layers and groups were not properly translated:
- The layers and groups' names were translated during display in the
  layer list. Since they are data, they should be left untranslated at
  this time.
- On object creation, the names "GP_Layer", "Color", "Lines", and
  "Fills" were not translated at all.
  This adds DATA_() macros around to translate them if the user has
  enabled translation of new data names.
- The functions returning unique names for layers and groups
  unique_layer_group_name() and unique_layer_name() would return
  "GP_Layer" and "GP_Group" by default.
  These defaults are now translated.
- When adding new layers and groups, the name was always hardcoded to
  "GP_Layer" and "GP_Group" because the operators' properties for the
  names defaulted to that, and prop defaults cannot be translated.
  Instead, make them default to a null string, but choose an
  appropriate name when executing the op. This name is chosen by
  unique_layer_name() and unique_layer_group_name(), whose defaults
  are now translated.

Pull Request: https://projects.blender.org/blender/blender/pulls/112930
2023-10-05 10:51:31 +02:00
Campbell Barton
ad1f146735 Merge branch 'blender-v4.0-release' 2023-10-05 15:05:34 +11:00
Campbell Barton
325e8ea605 Merge branch 'blender-v4.0-release' 2023-10-05 15:05:31 +11:00
Campbell Barton
c1ee3f9759 UI: correct names for sequencer modifiers
The commit that de-duplicated arrays [0] changed the user visible names
since the names didn't match exactly.

[0]: 9f06aec32f
2023-10-05 15:03:31 +11:00
Campbell Barton
2cf8c7ecf4 Docs: note why the wait cursor isn't set for the startup file 2023-10-05 14:56:29 +11:00
Campbell Barton
6f23344a7a Merge branch 'blender-v4.0-release' 2023-10-05 13:58:49 +11:00
Campbell Barton
36056ba37a Merge branch 'blender-v4.0-release' 2023-10-05 13:58:46 +11:00
Campbell Barton
9d20632925 Cleanup: ensure trailing newline, delete trailing space 2023-10-05 13:57:14 +11:00
Campbell Barton
3859a08704 Cleanup: use the name 'ot' for wmOperatorType for unused arguments 2023-10-05 13:55:35 +11:00
Campbell Barton
de89decd77 Cleanup: include argument names in callbacks
While not essential it gives a hint to the naming conventions for
function arguments.
2023-10-05 13:45:19 +11:00
Campbell Barton
f5b71e5152 Cleanup: rename Global "lib" & "ima" for clarity
Rename members to make it clear they're for the last used file-paths:

- ima -> filepath_last_image
- lib -> filepath_last_library
2023-10-05 13:33:37 +11:00
Campbell Barton
ed7b7c2cde Merge branch 'blender-v4.0-release' 2023-10-05 13:16:23 +11:00
Campbell Barton
60b2b663cc Merge branch 'blender-v4.0-release' 2023-10-05 13:16:20 +11:00
Campbell Barton
222d7b9184 Merge branch 'blender-v4.0-release' 2023-10-05 13:16:15 +11:00
Campbell Barton
eafceab73b Merge branch 'blender-v4.0-release' 2023-10-05 13:16:12 +11:00
Campbell Barton
9d4dc5376c Fix #112377: Edit Source missing info in the status bar
Reports from the internal operator weren't forwarded to the Python
operator, they were printed in the console instead.

Resolve by moving the operator to C++, use a utility function
to launch the external editor instead of an operator.
2023-10-05 13:09:47 +11:00
Campbell Barton
c9130e38e3 Cleanup: spelling in comments 2023-10-05 13:07:58 +11:00