Use enum types for event modifier and types,
`wmEventModifierFlag` & `wmEventType` respectively.
This helps with readability and avoids unintended mixing with other
types. To quiet GCC's `-Wswitch` warnings many `default` cases needed
to be added to switch statements on event types.
Ref !136759
MacOS generally uses mouse cursors we specifically made for that
platform. But in some cases, like WM_CURSOR_WAIT, the OS does not have
an equivalent and we don't have a platform-specific one. So it then
uses of of our base custom cursors. This type of cursor is always
enlarged on Mac high-DPI displays like Retina. So no need to ever
supply larger versions of this type of cursor as it will just get
huge.
Pull Request: https://projects.blender.org/blender/blender/pulls/136005
Neighboring areas can have right-aligned and left-aligned scroll bars
that doesn't leave room for area resizing. This PR carefully reduces
the scroll bar zone size at the area edge. To ensure that the behavior
you get matches the mouse cursor you see, this corrects an error that
we were not setting cursor when transitioning from area border to
scroll bars.
Pull Request: https://projects.blender.org/blender/blender/pulls/136794
Add icons to the rna enum definitions for socket types so they
are displayed in all socket type selection lists like the ones on the
various loop zones.
These places were missed, when the socket icons were added in
commit 821e0024d4.
Pull Request: https://projects.blender.org/blender/blender/pulls/136707
Before #136334 hovering over a zone used to open closed regions, we
would show left/right or up/down directional arrow cursors. That PR
replaced those with chevron cursors that point in the specific
direction the region would open. That change has caused some confusion
so this PR restores those old cursors.
Pull Request: https://projects.blender.org/blender/blender/pulls/136583
This happened because the viewport was drawn after
the UV editor when some update occur (e.g. canceling an
operator). The requested UV edit batch would require only
one specific UV channel. The viewport, in need of a different
UV channel, requested a VBO rebuild (freing the old UV VBO)
but did not correctly clear the UV batches that were referencing
the said VBO. This lead to use after free which would sometime
works because the same memory would be reused for a random new
batch.
Pull Request: https://projects.blender.org/blender/blender/pulls/136780
Part of incoming refactors in interface layout C++ code, this enables
forward declaring this enum type outside of `layout_interface.cc`. The
enum is renamed as `ItemInternalFlag` and moved to the `blender::ui`
namespace. `uiItemInternalFlag` is preserved as a shorthand for
`blender::ui::ItemInternalFlag`.
No user visible changes expected.
Pull Request: https://projects.blender.org/blender/blender/pulls/136782
I get a warning in a bunch of places where `library_ensure_catalogs_in_path` is
called. This is a known false positive of GCC. To workaround the warning, the
`AssetCatalogPath` can be constructed in a separate statement to avoid
implicitly constructing it as temporary value when calling
`library_ensure_catalogs_in_path`.
Pull Request: https://projects.blender.org/blender/blender/pulls/136762
Render Overlay Meshes after the Grid.
As a side effect, in-front wireframe objects are now displayed behind
non-in-front edit mode overlays.
Co-authored-by: Clément Foucault
Pull Request: https://projects.blender.org/blender/blender/pulls/136764
Part of incoming refactors in interface layout C++ code, this enables
forward declaring this enum type outside of `layout_interface.cc`. The
enum is renamed as `ItemType` and moved to the `blender::ui` namespace.
`uiItemType` is preserved as a shorthand for `blender::ui::ItemType`.
No user visible changes expected, layout introspection will still print
item types using property enum identifier format.
Pull Request: https://projects.blender.org/blender/blender/pulls/136740
Different areas of this code were using different checks for whether a
specific curve combination has caps or not. Extract the check to a separate
function to avoid that problem.
Fix an issue where copy-paste of keyframes was broken when action groups
are collapsed. It was caused by the `ANIMFILTER_LIST_VISIBLE` filter
flag; removing it (as it was before the bug-introducing commit) resolved
the problem.
Pull Request: https://projects.blender.org/blender/blender/pulls/136768
This is done because the library is necessary to make certain FFTW
functions thread safe, see #136557 as well.
Also pass each library variable separately to
`find_package_handle_standard_args` instead of as a list, as otherwise
it won't correctly detect if `libfftw3f` or `libfftw3f_threads` is
missing. This is because CMake considers a value false if it contains
`-NOTFOUND` at the end, but not if it's in the middle. For example,
CMake considers
`.../libfftw3f.a;.../libfftw3f_threads.a;FFTW3_LIBRARY_D-NOTFOUND` to be
false, but
`.../libfftw3f.a;FFTW3_LIBRARY_THREADS_F-NOTFOUND;.../libfftw3.a` to be
true.
---
I noticed that some other find modules also have the same list issue. I guess it was done this way to make CMake print all the found libraries instead of only the first.
Pull Request: https://projects.blender.org/blender/blender/pulls/136692
Due to !133498 layers containing incorrect material indices could lead to generating
to many GPU resources crashing Blender. As there is a maximum number of material slots
we can limit it.
This is just a safeguard for incorrect values in material_index attribute layer. Working with
this material index attributes should automatically limit, but I leave that to the modeling
module.
Pull Request: https://projects.blender.org/blender/blender/pulls/136302
This was only working if one had `+ Non-Grouped Keyframes` enabled.So
code wasnt finding the bone name in the groups of the Action.That in
turn was caused by the fact that `animviz_calc_motionpaths` solely uses
`BKE_action_group_find_name` [which is documented to support only legacy
Actions].
To resolve, check if the action is legacy, otherwise get the
`Channelbag` and use its `channel_group_find`
Pull Request: https://projects.blender.org/blender/blender/pulls/136757
After reviewing the locations where `GPU_flush()` are used it doesn't seem
to be harmfull to include these for the Vulkan backend as well. Hopefully
will save some lag that can happen when submitting one huge render graph.
Improved playback of rain_restaurant.blend where frames could be dropped
resulting into UI lag.
Pull Request: https://projects.blender.org/blender/blender/pulls/136654
In light of recent changes by Jeroen, #124515 seems to have been resolved properly, rather then using this workaround.
This also sidesteps the issue seen in #136633 which only happens when GPU sibdiv is disabled.
Pull Request: https://projects.blender.org/blender/blender/pulls/136678
Part of incoming refactors in interface layout c++ code, this enables
forward declaring this enum type. Enum is renamed as `EmbossType` and
moved to `blender::ui` namespace. No user visible changes expected.
Pull Request: https://projects.blender.org/blender/blender/pulls/136725
Calling `merge all` operation in an empty list triggers the crash. Check
node size before further evaluation to prevent the crash
- Add GP object
- Remove all layers
- Execute `Merge All` operation
Pull Request: https://projects.blender.org/blender/blender/pulls/136652
uv_select_all_perform had split the UV_SYNC_SELECTION
case into a separate block which complicated changes in this area.
Now each UV select function handles the sync-select case.
Also make UV's const when only used for comparison.
Caused by 6c05859b12
OpenVDB does not handle transformations with determinants smaller than
3e-15 and throws an `ArithmeticError` when a `Transform` is created
with invalid values.
To avoid abrupt crashes on the user side, this commit catches the error
and displays a warning message.
Pull Request: https://projects.blender.org/blender/blender/pulls/136690
This adds a new Camera Info node to Geometry Nodes. It provides information
about the passed in camera like its projection matrix and focus distance.
This can be used for camera culling which was must more complex before.
It also allows building other view-dependent effects.
Pull Request: https://projects.blender.org/blender/blender/pulls/135311
Found this while reviewing #136021. It's somewhat surprising that this didn't cause issues before.
This patch also adds some unit tests for `BLI_str_endswith` and `BLI_str_startswith`.
Pull Request: https://projects.blender.org/blender/blender/pulls/136679
In Geometry Nodes a geometry is represented by a `GeometrySet`. This is a
container that can contain one geometry of each of the supported types (mesh,
curves, volume, grease pencil, pointcloud, instances). It's possible for a
`GeometrySet` to contain e.g. a mesh and a point cloud.
This patch creates a Python wrapper for the built-in `GeometrySet`. For now,
it's main purpose is to consume the complete evaluated geometry of an object
without having to go through complex hoops via `depsgraph.object_instances`. It
also also allows retrieving instances that have been created with legacy
instancing systems such as dupli-verts or particles.
In the future, the `GeometrySet` API could also be used for more kinds of
geometry processing from Python, similar to how we use `GeometrySet` internally
as generic geometry storage.
Since we can't really have constness guarantees in Python currently, it's
enforced that the `GeometrySet` wrapper always has its own copy of each geometry
type (so e.g. it does not share a `Mesh` data-block pointer with any other place
in Blender). Without the copy, changes to the mesh in the geometry set would
also affect the evaluated geometry that Blender sees. The copy has a small cost,
but typically the overhead should be low, because attributes and other run-time
data can still be shared. This should be entirely thread-safe, assuming that no
code modifies implicitly shared data, which is forbidden. For historic reasons
there are still cases like #132423 where this assumption does not hold in all
cases. Those cases should be fixed. To my knowledge, this patch does not
introduce any new such issues or makes existing issues worse.
Pull Request: https://projects.blender.org/blender/blender/pulls/135318
Adds a new argument for the class constructor as well as a new macro to
support printing the rolling average of a number of samples intead of
the total average.
This can be useful for getting a sample of an average durations in
functions that are continually running, e.g. the main event loop.
Pull Request: https://projects.blender.org/blender/blender/pulls/136530