Gizmos that contain 3D parts, like the rounded lines of the "Rotate"
gizmo, have a fairly small hit size that make it hard to grab with a
tablet pen. This PR just increases the radius around the pointer
position while using a pen.
Pull Request: https://projects.blender.org/blender/blender/pulls/136847
This is helpful for #133123 where we want to use std::unique_ptr for
a struct with a definition that's ideally unavailable in sculpt_intern.hh.
Just adding the constructor changes the initialization of the struct,
so I added explicit defaults for the struct's fields.
Pull Request: https://projects.blender.org/blender/blender/pulls/137233
With commit bf18e8f814 the Properties editor can filter categories.
There is versioning code to ensure that any existing areas show all by
default. But newly-created Properties areas start without any. For
example, start with Factory Settings and then change the 3D Viewport to
a Properties editor and it will be blank. I'm assuming this is not
intended behavior so this PR makes new editors start with all tabs
shown.
Pull Request: https://projects.blender.org/blender/blender/pulls/137237
Some OpenXR platforms do not support OpenGL or Vulkan. To support these
platforms we use a bridge. Blender still renders in OpenGL/Vulkan, but
will copy the render result into a D3D11 swapchain.
OpenGL doesn this by importing the D3D11 swapchain into the OpenGL
context and perfor OpenGL calls to update the swapchain. However for
vulkan that could lead to construct 3 context for OpenXR
- Blender GPU Context
- OpenXR D3D Context
- New context that imports the Blender render result and the OpenXR
Swapchain image and copies them.
Due to Direct3D limitations importing into a vulkan context has known
issues (driver + extensions). Secondly we are not sure if we are running
on the same device as the OpenXR swapchain. The solution provided with
this PR is to only support CPU data transfers.
**SteamVR using d3d bridge**
SteamVR normally would use the Vulkan binding. But by changing the binding
priority in code you can make it select the D3D bridge.
<img width="1518" alt="Screenshot 2025-04-10 114534.png" src="attachments/f856bb2b-9ad5-4bb2-9cfd-a1412da9edd1">
It has been tested and validated to work using Mixed reality portal as well.
Pull Request: https://projects.blender.org/blender/blender/pulls/137264
The `GeoTreeLog::ensure_evaluated_gizmo_nodes()` reran the iteration
over the tree loggers to add the node ids for the evaluated gizmo.
This wasn't an issue because `GeoTreeLog::evaluated_gizmo_nodes` is
a set, so nothing changed when trying to re-add the same ids.
This sets `reduced_evaluated_gizmo_nodes_` to `true` (probably an
oversight when this got added) so that the function returns early when
called again.
The `Group ID` input on every node is a hidden value except for the
Accumulate Field node. This patch just hides that value to bring it
inline with the other nodes, as different single values are meaningless.
Pull Request: https://projects.blender.org/blender/blender/pulls/137160
The nodes from #134640 were initially built off the Accumulate Field node.
During review for those nodes, certain changes to the code were suggested.
This patch applies the same changes to Accumulate Field node.
These changes namely being:
- Use `std::move` for field inputs
- Use `std::nullopt` as default for `node_type_from_other_socket`
Pull Request: https://projects.blender.org/blender/blender/pulls/137209
Incorrect data format was selected when using CPU data transfers in
OpenXR. It always used `GPU_DATA_HALF_FLOAT`, also when the swapchains
where `GPU_RGBA8`. This resulted in black screens in release mode, and
asserts in debud mode.
Fixed by selecting the correct data transfer data type based on the
swapchain format.
Co-authored-by: jeroen@blender.org <Jeroen Bakker>
Pull Request: https://projects.blender.org/blender/blender/pulls/137269
The attribute search for e.g the attribute name input in
the `Store Named Attribute` node did not list attributes
inside Grease Pencil drawings (curve and point domain).
The fix ensures that for the `GeometryComponent::Type::GreasePencil`
we also iterate over the attributes of each evaluated drawing.
Pull Request: https://projects.blender.org/blender/blender/pulls/137267
One of the calls to get the frame falloff was missing a
check for `use_multi_frame_falloff`.
This puts the conditions for when the multi frame falloff
needs to be calculated in the `get_frame_falloff` function.
That fixes the crash and makes a code a bit easier to read
(without ternary operator).
Pull Request: https://projects.blender.org/blender/blender/pulls/137259
We'd rather aggressively clear asset lists on file save since 9a9e2e19a9 (and
some related commits), seems like we can be a bit more precise here. Only
reload assets from the current file when saving the file, which is quite fast
to do and doesn't happen asynchronously (so UIs showing assets will only show
up once the assets are ready).
Actually we might not have to clear on file save at all, but needs more
testing.
Also fixes disappearing of asset previews on file save.
Pull Request: https://projects.blender.org/blender/blender/pulls/137117
When sculpting a grease pencil object, user can hold `Shift` key to
temporarily switch to smooth brush. Previously it will keep using
whatever brush settings from the original brush for smoothing, which is
not ideal, now it will switch to the actual smooth brush but only keep
the radius the same.
The implementation is largely the same as `smooth_brush_toggle_on` from
`sculpt.cc`, brush is changed and restored in `on_stroke_begin/end`.
Part of #136300
Pull Request: https://projects.blender.org/blender/blender/pulls/136827
The main goal here is to add `GeoTreeLogger.tree_orig_session_uid`. Previously,
it was always possible to derive this information in `ensure_node_warnings`.
However, with closures that's not possible in general anymore, because the
Evaluate Closure node does not know statically which node tree the closure zone
is from that it evaluates. Therefore, this information has to be logged as well.
This patch initializes `tree_orig_session_uid` the same way it initializes
`parent_node_id`, by scanning the compute context when creating the tree logger.
To make this work properly, some extra contextual data had to be stored in some
compute contexts.
This is just a refactor with no expected functional changes. Node warnings for
closures are still not properly logged, because that requires storing
source-location data in closures, which will be implemented separately.
Pull Request: https://projects.blender.org/blender/blender/pulls/137208
The logic to add a file extension to the filename - which runs when
editing the text was not running when resetting/clearing the value.
Resolve by calling `uiBut::func`.
Along with [0], this fixes#134101.
[0]: f2a1c8d77c
When a wide menu is open and you move your mouse outside of it we have
new code that prevents the immediate opening of neighboring menus. But
while in this condition of mouse outside the menu, the rest of the
event processing is not run, so pressing "escape" will not close it.
This PR just moves the conditions around so event handling always
continues unless another menu is opened.
Pull Request: https://projects.blender.org/blender/blender/pulls/137243
Failure to write an image that didn't set `errno` reported:
"Could not write image: Success"
Check errno is non-zero before using it's message,
ideally error prints would be shown here.
* Use C++ math container types instead of arrays
* Use enum class instead of enum
* Use references instead of pointer for PainCursorContext
* Add a few comments
Pull Request: https://projects.blender.org/blender/blender/pulls/137235
Part of #82877
When drawing specialized cursors for the different paint modes via the
`wmPaintCursor` draw callback, tablet tilt direction is unavailable to
use to customize the drawing for the user.
To enable this functionality, this commit adds the `x_tilt` and `y_tilt`
data read while processing MOUSEMOVE events to the `eventstate` variable
so it can be used by consuming functions.
Pull Request: https://projects.blender.org/blender/blender/pulls/137189
- Make the module global and allow usage from anywhere.
- Remove the matrix API for thread safety reason
- Add lifetime management
- Make display linked to the overlays for easy toggling
## Notes
- Lifetime is in redraw. If there is 4 viewport redrawing, the lifetime decrement by 4 for each window redraw. This allows one viewport to be producer and another one being the consumer.
- Display happens at the start of overlays. Any added visuals inside of the overlays drawing functions will be displayed the next redraw.
- Redraw is not given to happen. It is only given if there is some scene / render update which tags the viewport to redraw.
- Persistent lines are not reset on file load.
Rel #137006
Pull Request: https://projects.blender.org/blender/blender/pulls/137106
Even though the default startup already has `Trusted Source` and
`Auto Run Python Scripts` off by default, when resetting their values
to default (right click, Reset to Default) they would be turned on.
It was simply missing explicitly setting this off by default.
Pull Request: https://projects.blender.org/blender/blender/pulls/137205
Caused by d3f84449ad.
The problem was that one SharedCache referenced the data of another,
without using the shared_ptr mechanism that is typically used for that
case. I had forgotten to avoid this-- I already did a similar fix a couple
years ago for curves: b07085fe3c
This time I kept the result as part of the cache to avoid the overhead
of attribute access on every call to `Mesh::face_normals()`.
Pull Request: https://projects.blender.org/blender/blender/pulls/137167
Allow detecting passes that can be skipped without side-effects and
don't submit them.
Eases debugging and profiling, and may provide a performance
improvement.
Pull Request: https://projects.blender.org/blender/blender/pulls/135875
`BLI_assert(b[i] != T(0));` assert in `VecBase operator/(const VecBase &a, const VecBase &b)`. Not an issue in release mode because the result of `math::length(x/0)` evaluates to zero.
Pull Request: https://projects.blender.org/blender/blender/pulls/137203
Broken by 4c9c9af2d6.
When Grease Pencil objects get converted (<= 4.2 to >= 4.3)
the code copies the legacy color over to the new one.
The issue is that the new color is a `float[3]` not a
`float[4]`! Thus the `flag` after the `color` was getting
overridden.
This fixes the issue by replacing the `copy_v4_v4` with a
`copy_v3_v3`.
Pull Request: https://projects.blender.org/blender/blender/pulls/137161
Failure to refresh the highlighted gizmo meant that clicking
on a highlighted gizmo would attempt to activate it even though
it's poll function failed - which crashed in this case.
Resolve the common-case by ensuring a call to refresh the gizmo-map
causes the event system to re-evaluate the highlighted gizmo,
even if the cursor doesn't move.
Since it's still possible the call to "refresh" the gizmo is missed,
gizmo_tweak_invoke now checks the gizmo-groups poll succeeds with an
assert and early return if it doesn't. This would have prevented the
crash although the highlighted-gizmo still won't be reset - causing
the cursor to display as if it's over a gizmo until it's moved.
The original motivation for this was to prepare the API to support having more
than one tree log for each zone. Currently, there is always a well defined tree
log for each zone (when the inspection index is taken into account). However,
for closures that is less true and there may be more than one equaly valid tree
log. While we might still want to show only one value per socket initially, it
would probably be nice in the future to support accessing information from
multiple evaluations at the same time (also for loops).
None of this is implemented here though, it's just a refactor with no expected
functional changes.
Pull Request: https://projects.blender.org/blender/blender/pulls/137166
Reading curves from alembic files did not interpolate the curves between
frames, leading to incorrect motion blur. This uses the existing
`use_vertex_interpolation` flag on the MeshSequenceCache to enable the
subframe interpolation.
Pull Request: https://projects.blender.org/blender/blender/pulls/135698
When toggling area "Fullscreen" with Ctrl-Spacebar, there is a one
pixel vertical change in the top of the area. This fixes that,
removes the border and active area outline. Looks much nicer.
Pull Request: https://projects.blender.org/blender/blender/pulls/137184
- Files cannot exceed 65535 width or height,
attempting to write 65536 would write a zero sized image.
- Ensure that zero sized imbufs are never loaded.
The first two bytes were being checked in the wrong order,
if files using this header were loaded they would detect as IRIS files
from imb_is_a_iris which would then fail to load (printing errors).