Commit Graph

120183 Commits

Author SHA1 Message Date
Campbell Barton
776e2eb707 PyAPI: expose Event.ndof_motion via RNA
Support reading NDOF motion via: even.ndof_motion which exposes:
translation, rotation, progress & time_delta properties.

Based on !139410.

Co-authored-by: Michael Menzi <nakoustix@gmail.com>
2025-06-01 06:39:26 +00:00
Campbell Barton
b4b2518c5b Build: resolve build error with USD enabled 2025-06-01 15:09:25 +10:00
Campbell Barton
d23e3b3863 Fix invalid blend-file writing logic in "Add color jitter support"
Error in [0] caused out of bounds buffer reads when writing CurveMapping
data.

[0]: 96e549c092
2025-06-01 14:46:16 +10:00
Campbell Barton
0e5a5ade32 Cleanup: add missing include 2025-06-01 14:09:16 +10:00
Charles S
96e549c092 Paint: Add color jitter support
Add ability to randomize color of each stroke for or use perlin noise
randomization during the stroke. Works similarly to grease pencil stroke
color randomization. This feature is available for all mesh color
painting modes (Sculpt Paint brush, Texture Paint and Vertex Paint)

This setting is available both as a per-brush setting and a unified
setting on the scene level. Additionally, the equivalent Grease Pencil
options have been migrated to these more generic flags and values.

Based on this [1] RCS request.

[1]: https://blender.community/c/rightclickselect/mwgbbc/

Pull Request: https://projects.blender.org/blender/blender/pulls/128953
2025-05-31 23:48:59 +02:00
Casey Bianco-Davis
2fd5b39a1b Grease Pencil: Edit Mode Outline Strokes operator
This adds an edit mode operator for converting the selected
strokes to outlines, same as it used to work in 4.2 LTS.

Co-authored-by: Falk David <falk@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/139540
2025-05-31 22:38:33 +02:00
Falk David
d332411b21 Grease Pencil: Fill Tool: Draw fill guides
This implements the "boundary strokes" features (from 4.2 LTS).
To make it a bit more clear, the feature is now called "fill guides".
It uses the same `Alt`+`LMB` shortcut.

Fill guides are denoted by a `".is_fill_guide"` attribute set to `true`.
Otherwise they behave as normal strokes.

There is the `Clean Up` > `Remove Fill Guides` operator to remove
the strokes.

This also adds an option to the Fill tool to automatically remove fill
guides once a fill has been created.

Pull Request: https://projects.blender.org/blender/blender/pulls/139293
2025-05-31 12:23:39 +02:00
Maxime-Cots
efd871e9ef USD: Implement new DomeLight_1 Schema for Import
Handle the `DomeLight_1` schema for import and translate to a World
material like what was already done for the original `DomeLight` schema.

The primary difference is that the new schema provides a `poleAxis`
attribute that authoring applications can use to remove ambiguity for
the orientation of the HDRI texture. Some care was made to match
`usdview` with a set of hand-crafted files. However, after matching,
some real scenes ended up displaying differently. These were corrected
but this could mean there's still issues that will need investigation
and fixing in the future.

Co-authored-by: Nig3l <nig3lpro@gmail.com>
Co-authored-by: Jesse Yurkovich <jesse.y@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/137761
2025-05-31 01:15:19 +02:00
John Kiril Swenson
0f37863fba Cleanup: VSE: Replace redundant "Change Effect Input" with "Swap Inputs"
The `SEQUENCER_OT_change_effect_input` operator does exactly the same thing
as `SEQUENCER_OT_swap_inputs` . "Change effect input" in the
"Effect Strip" context menu also seems bugged in recent versions.

Since "Swap Inputs" already has a keybind and the name itself is closer
to its intended use, just use that operator over the other one.

Also poll "Swap Inputs" so it is grayed out if the effect does not take
two inputs.

Pull Request: https://projects.blender.org/blender/blender/pulls/139615
2025-05-30 23:28:06 +02:00
Jacques Lucke
583586bf2d UI: use automatic search box width in more places
Most search-boxes still used a hard-coded width. This has the problem that it is
often too wide or too small for its content. This patch builds on top of
bf696320f6 to make the size of more menus adapt
automatically.

In all the cases I've tried, the width-detection code only ran once when the
search is triggered, and not continuously as might happen for some menus as
mentioned in
https://projects.blender.org/blender/blender/pulls/138653#issuecomment-1572027.

Pull Request: https://projects.blender.org/blender/blender/pulls/139423
2025-05-30 22:02:44 +02:00
Nika Kutsniashvili
975c71d43c UI: Fix incorrect capitalizations
Fixing some incorrect capitalizations I've come across

Pull Request: https://projects.blender.org/blender/blender/pulls/139548
2025-05-30 20:59:20 +02:00
Brecht Van Lommel
becc2fa9cb Fix: Metal parallel shader compilation does not respect -t option
This command line option to control the number of threads was already taken
into account for OpenGL and Vulkan.
2025-05-30 17:50:56 +02:00
Miguel Pozo
045926a305 GPU: Always use MTLShaderCompiler
No reason to use the base compiler on Metal.

Pull Request: https://projects.blender.org/blender/blender/pulls/139638
2025-05-30 17:41:13 +02:00
Philipp Oeser
7494a57b16 Fix: Graph Editor Circle/Lasso select fails to select handles
... if "Only Show Selected Keyframes Handles" is turned ON

The piece of code from fa24ad1fd5 -- and that copied from 233c650d55 --
which alters `incl_handles` for Circle/Lasso is outdated...

Atm. it would set `incl_handles` to `false` as soon as either "Show
Handles" is OFF or "Only Show Selected Keyframes Handles" is ON.
So bug-symptoms would be:
- turn ON both "Show Handles" and "Only Show Selected Keyframes Handles"
- select a single keyframe (so its handles are visible)
- try to select that handle using Circle/Lasso
- fail
- (alternatively: select the key using Circle/Lasso >> handles get
selected as well, also a fail)

In b037ba2665 though we introduced
`KEYFRAME_ITER_HANDLES_DEFAULT_INVISIBLE` in which can properly handle
such cases in `keyframe_ok_checks` / `select_bezier_add` /
`select_bezier_subtract`, so it makes sense to only check for "Show
Handles" Circle/Lasso and let `initialize_box_select_key_editing_data` /
`keyframe_ok_checks` / `select_bezier_add` / `select_bezier_subtract`
handle the rest...

Noticed while doing !139349, part of #139314

Pull Request: https://projects.blender.org/blender/blender/pulls/139531
2025-05-30 16:31:51 +02:00
Omar Emara
f54b49b773 Fix #139586: Switch node crops input image
The Switch node in the compositor crops the input image. That's because
the two inputs share the same operation domain.

To fix this, we avoid domain realization for either inputs.

Pull Request: https://projects.blender.org/blender/blender/pulls/139637
2025-05-30 16:25:30 +02:00
Jeroen Bakker
cfe0dc2cc1 Refactor: Vulkan: Reuse GHOST VkInstance
This PR will reuse the VkInstance of GHOST_ContextVK when querying for
possible compatible devices. Previously a temporary VkInstance was
created but could trigger an error in the Vulkan loader.

Pull Request: https://projects.blender.org/blender/blender/pulls/139640
2025-05-30 16:03:45 +02:00
Miguel Pozo
b147b83413 Fix #139590: Draw: Ensure dupli batches are always extracted
Call `duplis.try_add` as part of `drw_engines_cache_populate`.

Pull Request: https://projects.blender.org/blender/blender/pulls/139597
2025-05-30 15:40:46 +02:00
Clément Foucault
940ef330c8 Fix: GPU: Make StaticShader::ensure_compile_async request for ready state
This was missing from the initial implementation.

This did not affect any user code path since they were not
checking for completion and only blocking on first `get`.
2025-05-30 15:21:06 +02:00
Clément Foucault
f82673afd9 Fix: GPU: Invalid logic in StaticShader::get()
Simple oversight. Didn't have any effect.
2025-05-30 15:21:06 +02:00
Julian Eisel
e87a9f2f69 Fix: Asset library tests using wrong internal asset library type
For automated tests we have support for directly loading a directory as
asset library. We might need this for other things too in future, so
this should be supported generally.

Directories loaded as asset libraries this way would internally be
treated as a Preferences on-disk library, which isn't correct. This
didn't cause any known issues, but with blender/blender!138150 it would
make tests fail incorrectly.
2025-05-30 15:05:47 +02:00
Hans Goudey
8e2c6bc617 Fix: Various fixes to unused CustomData to AttributeStorage conversion
So far this is unused, but it's used in #139165, and that pointed out
some obvious flaws in the code, like the resulting AttributeStorage
being completely ignored, and old CustomData layers not being freed.
Restructure the API a bit to make it simpler to use, and also make it
keep the non-generic layers in CustomData. That's not necessary for
point clouds but it will be necessary for curves (the next step) since
they have vertex groups.

Pull Request: https://projects.blender.org/blender/blender/pulls/139609
2025-05-30 14:46:39 +02:00
Omar Emara
0c061e686a Compositor: Add support for Group Input node
This patch adds support for Group Input nodes in scene compositor node
trees. The inputs return the pass that correspond to their name in the
active scene and view-layer. Image is an alias for the combined pass.

This fixes #137943 for the compositor.

Pull Request: https://projects.blender.org/blender/blender/pulls/139584
2025-05-30 12:43:17 +02:00
Pratik Borhade
9f32cd8d65 UI: UIList: Highlight active element when hovered
Similar to outliner when mouse is over active UIList element, highlight
it with the color which is mix of inner and text theme color.

Pull Request: https://projects.blender.org/blender/blender/pulls/139067
2025-05-30 12:37:56 +02:00
Lukas Tönne
3b66d4af87 Fix: Geometry Nodes: Show menu socket name in boolean Switch nodes
The socket name on Menu sockets is hidden by default to save layout space.
In some nodes with multiple menu inputs (switch nodes) this leads to ambiguity,
so the socket name is enabled explicitly for these node types. This was already
done for Menu Switch nodes but not for the boolean Switch node yet.

Pull Request: https://projects.blender.org/blender/blender/pulls/139628
2025-05-30 11:54:20 +02:00
Jason C. Wenger
321e49a643 Nodes: make frame bounding box account for extra rows data
Previously, extra rows nodes did not properly apply margin to the frames which contain them.

Pull Request: https://projects.blender.org/blender/blender/pulls/139564
2025-05-30 10:29:00 +02:00
Jeroen Bakker
5e690aa217 Fix: Shader CPP compiler error
Shader CPP compiler broke due to recent shaders not including the
correct resources.
2025-05-30 09:30:42 +02:00
Clément Foucault
65f7a2c79f Overlay: Batch async compile shaders to improve cold startup times
The default viewport startup time goes from 15.1s to 3.2s.
2025-05-30 09:14:02 +02:00
Clément Foucault
c3f4dd27f1 GPU: Add async compilation to StaticShader class
This allow to easily request async compilation
in a safe way for every static shader.

The get function will always wait if async
compilation has been requested.
2025-05-30 09:14:02 +02:00
Clément Foucault
87bab6b425 Fix: GPU: Failling test caused by missing push constant 2025-05-30 09:14:02 +02:00
Sean Kim
308e47ef17 Fix #139617: Crash when activating brush
It is possible on file load that the `previous_active_brush_reference`
is an invalid old memory location. To prevent this, set the ptr to
nullptr on file load, as it should only be used within a given session.

Pull Request: https://projects.blender.org/blender/blender/pulls/139618
2025-05-30 07:39:23 +02:00
Pratik Borhade
2b0cc73ef6 Modifiers: Change softbody fuzzy default value
Set fuzzy=1 when softbody modifier is added. As of now, value is 0, this
raises concern of division by zero so bump it to 1.
Updated `softbody_test.blend` to fix the failing test.
Resolves #137849

Pull Request: https://projects.blender.org/blender/blender/pulls/137878
2025-05-30 06:32:08 +02:00
John Kiril Swenson
d3d4124ce6 Cleanup: VSE: Standardize "Crossfade" and "Gamma Crossfade" naming
Use these terms over "Cross" and "Gamma Cross" in the UI/RNA
when referring to effect strips.

Keep it as "Cross" for blend modes for now (which is in and of itself
a bit of a weird naming. In the future, we should consider unifying
our blend mode types with compositor ones for consistency).

Pull Request: https://projects.blender.org/blender/blender/pulls/139606
2025-05-30 03:41:10 +02:00
John Kiril Swenson
d90896ebc7 Fix: VSE: Add missing effect types to "change effect type" menu
PR #139514 just copied the "add effect" menu, but forgot the
other possible effect types (crossfade, gamma crossfade, adjustment).
2025-05-30 03:41:09 +02:00
John Kiril Swenson
47b881fc6f Fix: VSE: Reassign Inputs erroring
With the change to a new `strip_effect_get_new_inputs` prototype
in #138016, this call got overlooked. The bool would sneak in
as an `int` and silently fail.
2025-05-29 20:11:16 -05:00
Campbell Barton
50f3240abd Cleanup: spelling & duplicate terms (check_spelling.py) 2025-05-30 11:03:56 +10:00
Sean Kim
9ecee59ee7 Fix: Sculpt Filter tools may not initialize radius
Introduced in 6d0c33e8e7

Pull Request: https://projects.blender.org/blender/blender/pulls/139611
2025-05-30 03:01:51 +02:00
Harley Acheson
370d8956ae Fix #137735: Scale Icon Border Intensity by Icon Alpha
When an icon is drawn with both lowered opacity and a border shadow
(used to increased contrast in Light theme), it will look darker
because more of the dark shadow is visible through the icon. This PR
fixes this by scaling the shadow by the opacity.

Pull Request: https://projects.blender.org/blender/blender/pulls/139610
2025-05-30 02:48:07 +02:00
Sean Kim
af31eeb900 Sculpt: Lower Multires leaf node limit to 800
In a prior commit, the Mesh Paint BVH leaf node limit was reduced from
10000 faces to 2500 faces. This commit makes a proportional change
for the Multires paint BVH.

In performance testing of just the brush evaluation, this change
represents a 3x speedup (from 0.6326s to 0.2135s) on a Multires grid
with 25m vertices at multires level 5.

In a simulated brush stroke testing similar to what a user would do,
on a grid of 6m vertices at multires level 5 this change equals a 1.4x
improvement from 41.8 to 58.6 FPS.

See the related PR for the raw data and testing methodology.

Related to #137871

Pull Request: https://projects.blender.org/blender/blender/pulls/139311
2025-05-29 21:45:17 +02:00
Hans Goudey
91803e130f Cleanup: Grammar: Fix uses of "for e.g."
e.g. stands for "exempli gratia" in Latin which means "for example".
The best way to make sure it makes sense when writing is to just expand
it to "for example". In these cases where the text was "for e.g.", that
leaves us with "for for example" which makes no sense. This commit fixes
all 110 cases, mostly just just replacing the words with "for example",
but also restructuring the text a bit more in a few cases, mostly by
moving "e.g." to the beginning of a list in parentheses.

Pull Request: https://projects.blender.org/blender/blender/pulls/139596
2025-05-29 21:21:18 +02:00
Hans Goudey
5747f839e8 Cleanup: Grammar: Fix uses of "it's own" 2025-05-29 14:41:20 -04:00
John Kiril Swenson
1834f9f200 VSE: Improve "Change Effect Type" operator
- Previously, effects could be changed into types that take different
amount of inputs, e.g. from "add" to "glow", which led to undefined
and glitchy behavior (unreported bug). Fix by requiring same input count
for new effect.
- Previously, strip names were not updated when changing effect type,
which tended to be confusing. Now, if the default name was not changed,
update to the new effect type name.
- Remove "effect strip" menu from color and text strips. Although they
are effects internally, to a user, this is not clear, and providing the
option to modify effect inputs in these cases doesn't really make sense.

Pull Request: https://projects.blender.org/blender/blender/pulls/139514
2025-05-29 20:28:20 +02:00
Sean Kim
5402ce3929 Cleanup: Remove unnecessary qualifiers in BKE_paint.hh
Pull Request: https://projects.blender.org/blender/blender/pulls/139571
2025-05-29 20:02:32 +02:00
Sean Kim
000c635542 Cleanup: Remove unnecessary const in BKE_brush.hh
Pull Request: https://projects.blender.org/blender/blender/pulls/139570
2025-05-29 20:01:50 +02:00
Miguel Pozo
2db0b92280 GPU: Add CompilationPriority
Allow adding compilation batches to different priority queues.
Set priorities so static shaders are always compiled first,
then materials, and optimized materials last.

Pull Request: https://projects.blender.org/blender/blender/pulls/139456
2025-05-29 19:43:02 +02:00
Richard Antalik
7169ee7850 VSE: Scene strip invalidation
Previously there was no mechanism to invalidate scene strip cache, when
changes were made to scene that the strip renders. Because of this, the
cache had to be cleared manually, even for other strips.

Strip invalidation is performed from function
`ED_render_id_flush_update`.
Recalc flags like selection or frame change are ignored as they are
unlikely to influence the rendered image.
When some ID is changed, all scene strips using
`DEGEditorUpdateContext::scene` will be invalidated.

Limitations:
- Because frame change is ignored, changes to physics caches would not
invalidate VSE strips
- Only active scene will be invalidated this way. So if an object is
linked to 2 scenes, inactive scene cache would be invalid
- If animated object is moved, and there is VSE preview to be updated
Scene re-rendering in VSE would cause object to snap to its evaluated
position. This is because scene frame is changed by VSE. Reported in
#139501.

To refresh VSE preview after cache is invalidated, relatively big chunk
of code was copied from `view3d_main_region_listener` to VSE preview
listener. Cases that would not result in visual changes like selection
were excluded.

Fixes #113137.

Pull Request: https://projects.blender.org/blender/blender/pulls/138231
2025-05-29 19:08:32 +02:00
Harley Acheson
b26c2c1b38 Fix #139248: Update IME Data with GHOST_kEventImeComposition Event
Before e4aa758d70 we kept a pointer to ghost IME data, but with that
change we instead maintain a local copy of that data instead. This
means that we have a copy of it with GHOST_kEventImeCompositionStart,
but we don't update our copy when we get GHOST_kEventImeComposition.
This is where (at least on Windows) when we get the composition result,
the final string to be inserted.

Pull Request: https://projects.blender.org/blender/blender/pulls/139557
2025-05-29 18:40:51 +02:00
Clément Foucault
9a87594e93 Fix #138920: EEVEE: Crash when switching workspace with world volume
This was caused by the volume module not being available in
`begin_sync`.

The fix is to split `modules_init` into `init` and `begin_sync`
to always init the modules when creating the `DRWContext`.

Pull Request: https://projects.blender.org/blender/blender/pulls/139442
2025-05-29 17:08:27 +02:00
Aras Pranckevicius
4a328b5a63 Nodes: Voronoi node CPU optimizations
Several small speedups for Voronoi node (no behavior change). This
affects Cycles and CPU execution of Voronoi node e.g. in Compositor.

- F1 mode: when evaluating distance for Voronoi cells, use a faster
  distance estimation, and only do final distance calculation on the
  resulting closest cell. This is only really relevant for the default
  Euclidian distance, where this saves a square root per evaluated cell
  (in 3D Voronoi case saves 26 square roots; in 4D case saves 80 square
  roots).
- N-Sphere Radius mode: speedup by doing squared distance calculations.
  We only need to find the closest one, so again doing the square root
  per cell is not needed here.

Something like 5%-10% speedup for F1 3D Voronoi; more performance details
in the PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/139490
2025-05-29 15:40:31 +02:00
Jeroen Bakker
c56a855b9f Fix #139565: PyGPU: Add builtin point shaders
This PR adds builtin shaders for drawing points. Using `FLAT_COLOR`,
`SMOOTH_COLOR`, `UNIFORM_COLOR` can lead to undesired behavior
on Metal and Vulkan backends. To ensure future compatibility this PR
adds `POINT_FLAT_COLOR` and `POINT_UNIFORM_COLOR`.

The point size can be set using `gpu.state.point_size_set`.

Pull Request: https://projects.blender.org/blender/blender/pulls/139583
2025-05-29 14:36:32 +02:00
Jacques Lucke
fd58d730b0 Fix #139516: crash when enabling shader node previews 2025-05-29 13:56:28 +02:00