This reverts commit afec64739a.
The commit introduces a regression where opening the Asset Browser opens
the File Browser instead, same for other editor sub-types, see
blender/blender#134630.
blender/blender!134642 proposes a different solution and reverts this,
which I prefer too. Better to the revert separately from trying a
different fix for the initial bug, makes reviewing easier too.
This main thread check was introduced in 4536a4c610. At the time OpenGL
only ever worked in the main thread, but that limitation was lifted in
Blender 2.80.
With this operator being converted to use the jobs system, it now needs
to work in non-main threads. Note that this code does not run in parallel
with main thread drawing anyway, because of WM_job_main_thread_lock_acquire
and draw manager locks. What changed is that we can now activate OpenGL
contexts on other threads.
Pull Request: https://projects.blender.org/blender/blender/pulls/134696
The original report stumbled upon this issue with a more tricky
configuration when light linking is combined with light tress.
However, the actual contributing factor was a mesh with emission
shader which is not assigned to any triangles. This triggered a
bug in the BoundBox::transformed() which converted non-valid bounds
to bounds by performing per-corner growing.
Additionally fix incorrect handling of shared nodes which only
worked for leaf nodes. This was due to the fact how the measure
was accumulated: it is possible that add() is called with an empty
measure.
Pull Request: https://projects.blender.org/blender/blender/pulls/134699
Caused by 1bde901bf2
`UI_BTYPE_CURVEPROFILE` button has undo flag set. see button-layout in:
`edbm_bevel_ui() -> uiTemplateCurveProfile()`.
This forces an undo push with the help of `ui_apply_but_undo/ui_apply_but_funcs_after`.
To handle the situation, skip undo push for buttons in hud region.
Pull Request: https://projects.blender.org/blender/blender/pulls/134552
The issue was that with the move to Grease Pencil v3,
annotations and normal GP use different IDs and support to show annotations
wasn't added back in.
This makes it so annotation keys are shown if "Only Show Selected" is disabled,
which works in the Dope Sheet and in the timeline.
In order to not show annotations of the scene twice, the scene-specific code is removed.
The annotations are now shown in a more generic way.
Pull Request: https://projects.blender.org/blender/blender/pulls/134565
Node region is not tagged to redraw when animation slot is changed.
`action_slot` RNA prop has `NC_ANIMATION`notifier set, use the same in
`node_region_listener` to tag region redraw.
Pull Request: https://projects.blender.org/blender/blender/pulls/134435
This reverts 06a2617107.
Commit has introduced few errors from user perspective (#134277) and
python side (#134380). Best to revert it now then handle the bug fixes later.
The error in #134380 was due to `context.layer_collection` and
`active_layer_collection` returning excluded collection.
Pull Request: https://projects.blender.org/blender/blender/pulls/134546
Nothing but improvements to comments in this area of code to better
explain the complexity of Emum list row and column calculation. These
things change wrapping and column count to suit available space and
needs better explanation.
Pull Request: https://projects.blender.org/blender/blender/pulls/134719
For non-categorized lists, rather than always trying to find optimal
rows and columns, revert to prior behavior and only reflow if needed,
when the calculated rows are greater than maximum rows. This is less
disruptive, has less changes at small sizes where this doesn't matter.
Yet still does the job when things get too large to fit, or the list
is very long.
Pull Request: https://projects.blender.org/blender/blender/pulls/134713
When needing a friendly title and icon for windows and screen areas we
use SpaceType callbacks. For Node editors this could crash for custom
node trees that are unregistered. node_tree_type_find returns nullptr
since this custom tree type is not in the map. In this case just return
translated "Node Editor".
Pull Request: https://projects.blender.org/blender/blender/pulls/134692
This PR changes the default user preferences so that the Translation
Options are enabled. Otherwise with fresh install changing language
only translates tooltips.
Pull Request: https://projects.blender.org/blender/blender/pulls/134649
The compositor leaks memory in certain setups where a transformed result
is linked to two inputs in the same pixel node. This happens due to an
overestimation in the computation of reference counts of those results.
Since pixel operations might share the same input for multiple links in
the node tree, the reference count should be corrected to take that
sharing into account.
This sharing was previously accounted for as part of releasing inputs in
the pixel operation, but input processors didn't take that into account,
so the realize on domain input processor would leak memory. So to fix
this, we correct the reference count at the evaluator level instead,
such that input processors can safely operate on the correct reference
count.
Pull Request: https://projects.blender.org/blender/blender/pulls/134666
Fixed use of lists using multiple arguments - `list` only
support a single argument.
Noticed working with fake-bpy-module - providing multiple
arguments to `list` resulted in typing error (e.g. "Too many type
arguments provided for "list"; expected 1 but received 2").
Pull Request: https://projects.blender.org/blender/blender/pulls/134663
The main issue was that the code was using
`foreach_editable_drawing_with_automask` which shouldn't have been
the case since there is no "masking" to be done when pasting strokes.
Additionally the code was computing the view position of every
pasted point and then computing the offset to move the points to the
mouse position.
Instead, we compute the center of the 3d bounds of the pasted strokes
and then project only the center to the view. From there we can offset
all the points to move them under the mouse cursor.
It's a bit weird to do this projection of the center to the view and
I believe we mainly do it to reuse the `DeltaProjectionFunc`.
There are cases where the projection of the center to the view will fail
which can lead to unexpected behavior on the user end. For now we
just leave the pasted strokes where they were copied from, which
isn't ideal. But this can be improved later.
Pull Request: https://projects.blender.org/blender/blender/pulls/134589
The vulkan backend was implemented with async in mind, however the one place
where Blender uses for async was implemented blocking. This PR splits the
readback into flushing the command and waiting for readback.
**Performance**
Improvement of animation playback performance of shader balls.blend is around 10%.
Shader balls.blend frame: 1-100, 10 x animation playback
| Branch | Total time | Average time |
| -------------------- | ---------- | ------------ |
| blender-v4.4-release | 26851 ms | 2685 ms |
| This PR | 23675 ms | 2367 ms |
Pull Request: https://projects.blender.org/blender/blender/pulls/134227
This patch modifies the logic behind handling NDOF device events on
macOS so that it can benefit from the `Blender` profile available in
3DConnexion driver v10.8.7 and later.
A new device command was introduced: `kConnexionCmdAppEvent`, which is
sent by the driver upong getting an apprioriate NDOF device button
input. This allow the driver to consumes all NDOF device input and then
send appropriate app events based on its configuration instead of
forwarding raw data to the application directly.
When using 3DConnexion driver versions prior to v10.8.7, the behavior
is unchanged. This approach allows for supporting all of the SpaceMouse
Enterprise buttons, long presses included (solving issue #119206 on macOS)
Co-authored-by: Sergey Sharybin <sergey@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/126694
The warning to check if two numbers are nearly equal when comparing
floats didn't take negative numbers into account, causing -1.0 & 0.0
for e.g. to be considered not equal but close.
This also resolves a divide by zero.
In a recent commit (1), a bug was fixed where the generated texture
coordinates on volumes in Cycles with OptiX OSL was incorrect.
Due to this fix, OptiX OSL now passes render tests in scenes that use
that feature, so this commit enables those tests on that platform.
(1) 0177537c9a
Pull Request: https://projects.blender.org/blender/blender/pulls/134629
The issue here is that the individual components of TypeDesc are 8-bit each,
but the code was applying a 4-bit mask. It just so happens that the only
case where this matters is TypeDesc::MATRIX44, since its value is 16.
In Cycles lights can be given a light falloff node to control their
light falloff.
This worked by multiplying the light's strength by different
combinations of the ray length, which would be FLT_MAX for
distant lights. This resulting in almost every configuration of the
light falloff node overflowing when used on distant lights, which is
undesirable.
This commit fixes this issue by ignoring most of the functions of the
light falloff node when used on a distant light.
And in the process fixes a small discrepancy between SVM and OSL when
using the light falloff node on distant lights.
Pull Request: https://projects.blender.org/blender/blender/pulls/134539
This shouldn't really affect the release since original point cloud data is hidden
but it might and the fix is trivial anyway: everything is selected when there's no
attribute, just like curves.
With ba9417470e we are assigning keyboard accelerator shortcuts to
menu items containing toggles. This PR makes the assignment to these
new items not occur on the first pass of doing so. This is less
disruptive in that first-letter shortcuts will remain the same from
prior versions, with only mid-word shortcuts possibly changing.
Pull Request: https://projects.blender.org/blender/blender/pulls/134526
When copying (`Ctrl+C`) some ranges of points in the same stroke,
the points would still be copied as one stroke and not split into
multiple strokes.
This was a regression in behavior from 4.2.
Now we use the `remove_points_and_split` to split the selected
points into individual strokes.
The issue is that the existing curves did not have an explicitly set radius.
When adding new curves with an explicit radius, the radius of the old curves was
initialized to 0 and thus becoming invisible. This patch changes it so that all
the existing curves do get a default radius. The `radius_for_write` methods is
currently only used in places that overwrite the entire array, so adding the
default there shouldn't affect anything unintentionally.
Pull Request: https://projects.blender.org/blender/blender/pulls/134445
free_memory queries were disabled due to runtime driver issues on Linux
when using jemalloc.
compute-runtime introduced a fix for these issues with
8527779778
which is part of versions 31740 and higher, and matches the currently
required min-driver version, so we can restore this feature.
Pull Request: https://projects.blender.org/blender/blender/pulls/134542
When calling the `lookup_or_add` functions on `MutableAttributeAccessor`
we need to make sure that the writer is actually created and the call
did not fail.
This fixes many of the instances where we would use an unchecked
attribute writer and potentially crash.
Pull Request: https://projects.blender.org/blender/blender/pulls/134413