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).
When you open a menu or popover, moving your mouse to a neighboring
root menu button will switch to that one. For example when you open the
"File" menu and move to the right to have "Edit" open automatically.
This currently causes problems with some neighboring menus. This PR
adds a safety padding to the open item. This generally means that once
you open a menu, you will need to move your mouse into the neighbor's
content, not just hit the edge.
Pull Request: https://projects.blender.org/blender/blender/pulls/135692
When a menu is open, moving your mouse to a neighboring menu can cause
that menu to open, closing the open one. This is very problematic when
the open menu is very wide because users are likely to travel over
other menus while moving toward items in far columns. Typically this is
the "change area" menu, but this can happen with any wide menu. This PR
just checks the menu width and turns off this feature when it is wide.
Pull Request: https://projects.blender.org/blender/blender/pulls/136528
Currently scroll bars that are in regions that are set to "region
overlap" (like Tool Bar and Side Bar using a transparent background)
will fully hide when your mouse is not near them. This PR removes that
feature so that they are treated like in other areas. This way you can
always see that there are portions of the region scrolled away and what
proportion. A less jarring transition since it is only 0.4 - 1.0,
rather than 0.0 - 1.0.
Pull Request: https://projects.blender.org/blender/blender/pulls/136571
This draws a highlight line on the active edge of regions, like side
bars and toolbars, while dragging to resize them. Similar as we do for
area resizing. This has marginal utility while using a mouse, but is
much more important when using a pen. More so when the pen has a
minimum pressure for clicking. Even more so when using touch as your
finger covers the hit target.
Pull Request: https://projects.blender.org/blender/blender/pulls/136337
This commit allows to specialize or optimize properties editor for
particular workflows by hiding individual tabs. The filtering is done on
editor level, currently in editor options popover panel.
Primary motivation was to allow strip properties to be moved to
properties editor. The filtering is beneficial, as usually it does not
make sense to show strip propeties in modelling workspace and in video
editing workspace other properties would introduce quite a bit of noise.
Ref. #115626
Pull Request: https://projects.blender.org/blender/blender/pulls/115624