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.
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
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
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
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
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
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.
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
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
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
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.
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
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
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
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
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.