Commit Graph

116926 Commits

Author SHA1 Message Date
Hans Goudey
4e18ebee1b Cleanup: Make paint BVH update tags proper private members
Move some functions to be methods of pbvh::Tree instead.

Pull Request: https://projects.blender.org/blender/blender/pulls/133989
2025-02-03 19:36:33 +01:00
Julian Eisel
7d54bfb49c Refactor: Asset system function to get asset libraries as RNA enum
We need some more control through the API here, e.g. for #132747. I
rather make things very explicit on the API calling side.
2025-02-03 19:08:09 +01:00
Clément Foucault
7bdafde54c Fix #133138: Overlay: Assert displaying subdiv surface modifier in edit-mode
The cause was that the shader was expecting both `pos` and `nor`
attribute but only one would be extracted.
This is because the mesh has cage display on but the batch cache
wouldn't extract the `vbo.vnor`.

This patch just make sure the vertex normal just follow the same
condition as the other edit normals batches.
2025-02-03 19:04:05 +01:00
Clément Foucault
b0980a1419 Fix: Overlay: Edit Mesh: Fix normal display with GPU subdivision
Make sure the gpu subdiv shader variant is only used if there
is no cages as the requested batch has a different layout in
this case.

Also add the missing shader variant for vertex normal display
with GPU subdiv.
2025-02-03 19:04:05 +01:00
Clément Foucault
724a065cdc Fix: Overlay: Edit mesh normals display not writting to line buffer
Shader was missing a framebuffer output.
Similar to 58cb2e43a1
2025-02-03 19:04:05 +01:00
Jesse Yurkovich
6c11811710 Cleanup: USD: Use the SdfPath type rather than a std::string
Instead of converting to a string immediately, only convert to a string
when necessary, like for trace logging. This reduces the size of the
`USDPrimReader` base class by 24 bytes, makes several Vectors and Maps
smaller at runtime, and reduces some unnecessary string allocations and
conversions in various other places.

The recently added python Hook `get_prim_path` dictionary will now
contain `SdfPath` objects rather than strings; removing the string
conversion cost when calling other USD APIs like `GetPrimAtPath` which
take in `SdfPath` objects to begin with.

This also makes the code a bit more self explanatory since the type
makes it clear what kind of path you are dealing with.

Pull Request: https://projects.blender.org/blender/blender/pulls/133954
2025-02-03 18:44:07 +01:00
Bastien Montagne
35a4b2ca69 Fix #131894: Linked images can be upacked and file-browsed.
Add proper checks for editable ID to image pack/unpack and file_browse
operators.

Also add similar check to `unpack_item` operator, although in that case
the check has to happen in exec callback, as poll function would not
have required info.
2025-02-03 18:29:14 +01:00
Hans Goudey
1d599b0073 Fix: MSVC build error after recent cleanup 2025-02-03 11:56:18 -05:00
Hans Goudey
e0f44dc8af Fix #133937: Grow/Shrink Visibility missing draw data update
Missing part of b77ff173b0.
2025-02-03 11:33:18 -05:00
Julian Eisel
0225c4635d Cleanup: Remove redundant asset loading icon handling
Since 1f88645728 the loading icon is managed by the UI code, no need to
explicitly set it here.
2025-02-03 16:49:17 +01:00
Hans Goudey
2ea843d141 Cleanup: Remove redundant default constructor assignment
`FindClosestData` already has a default constructor, `= {}`
is unnecessary.
2025-02-03 10:43:15 -05:00
Hans Goudey
5754b28807 Fix #133942: Incorrect curve domain selection comparison
Missing change in ae1a1335b9.
2025-02-03 10:43:15 -05:00
Jeroen Bakker
dda23c53f8 Metal: Add native tile input to workarounds
Native tile input wasn't part of the MTLCapability struct, but stored locally
in the shader generator and checked in MTLFramebuffer. This PR moves it
to the MTLCapability struct and disables it when workarounds are forced.

Pull Request: https://projects.blender.org/blender/blender/pulls/133818
2025-02-03 16:36:15 +01:00
Julian Eisel
4755503356 UI: Draw subtle background for preview items in menus
Draw a subtle background to make individual parts of each item feel more
connected. E.g. showing loading icons or labels might make it feel like
a bunch of floating icons/labels.

Suggested in #133880.

Pull Request: https://projects.blender.org/blender/blender/pulls/133980
2025-02-03 16:11:55 +01:00
Julian Eisel
1f88645728 UI: Draw loading icon while previews load
Show a dimmed loading icon while previews are being loaded in a
background thread. The asset shelf and asset/file browsers do this
similarly already.

This is implemented in drawing code, so the loading icon will always
appear when an in-progress preview is being drawn. I experimented with
doing this in `ui_def_but_icon()`, but this won't update correctly with
popups that don't support full refreshing.

This also makes any normal icon that is drawn as preview use the normal
icon size. These icons are usually made for smaller sizes and look very
outblown when displayed at the size of a preview. Yet it's useful to
sometimes pass a normal icon. E.g. for the asset shelf we would already
draw the data-block type icon in place of the preview if there was no
preview to display, and we'd use the normal, smaller size already.
Larger can still be drawn differently.
I don't know of any current cases this would affect though.

Pull Request: https://projects.blender.org/blender/blender/pulls/133880
2025-02-03 16:03:06 +01:00
Bastien Montagne
5c1749f7b7 Refactor: Move 'need link' and 'need expand' ID tags to runtime readfile data.
Also adds a new `BLO_readfile_id_runtime_tags_for_write` accessor to
ensure readfile data is created before assigning a tag value.

Followup to 2ec1b6887d. Should cover the last existing ID tags that
can be moved to temp runtime readfile ID data.

This reverts commit aff2cf97a1, and re-apply 2612b27e42 fix the issue
fixed.
2025-02-03 15:18:19 +01:00
carnaval
0e7924ac25 Fix: add missing dependencies for object and collection value nodes
The new Object and Collection constant geometry nodes do not register their dependency on their targets.
This causes the graph not to update properly when they are modified.

Pull Request: https://projects.blender.org/blender/blender/pulls/133784
2025-02-03 15:16:07 +01:00
Jacques Lucke
7c011440c6 Fix #133925: crash when removing animated input socket 2025-02-03 15:14:38 +01:00
Clément Foucault
f4a214166e Fix #133754: Overlay: Geometry Nodes viewer displays blue color for instances
Shader was missing a framebuffer output.
Similar to 58cb2e43a1

On top of that was that the push constant was not
using the right overload.
2025-02-03 15:00:08 +01:00
Nathan Vegdahl
978011fe43 Anim: use legacy names for data created via legacy APIs
Previously, when use of the legacy Action APIs (specifically the `fcurves` and
`groups` properties) caused a new Slot to be created, it would be named "Slot".

This PR changes things so that Slots created that way are named "Legacy Slot",
just like Slots from upgraded legacy Actions.

The rationale is that Slots created in this way are expected (by the code that
created them) to be used as if the Action were still a legacy Action, and it's
good to reflect that in the name of the data. This also makes it clearer to
users when e.g. scripts and addons they're using may not yet have been updated
to fully work with Slotted Actions.

For consistency, this PR also names Layers created in the same way "Legacy
Layer", the same as Layers from upgraded legacy Actions.

Pull Request: https://projects.blender.org/blender/blender/pulls/133888
2025-02-03 14:48:39 +01:00
Clément Foucault
3929a37786 Fix #131506: EEVEE: GP disappear when resolution scale > 1
Now EEVEE outputs the in-progress render depth buffer
for GPencil to intersect with.

The overlays will clear the depth buffer in such situation
and still do the depth prepass for correct intersection.

Moreover, this patch makes overlay engine not requiring
a depth prepass when run with EEVEE at 1:1 render resolution.
This avoids significant overhead of the depth prepass.

Pull Request: https://projects.blender.org/blender/blender/pulls/133971
2025-02-03 14:45:46 +01:00
Clément Foucault
aa8769599c Fix #133775: Overlay: curve attribute is not showing any color in viewport
The curves wireframes should not have any offset applied to them.
This avoid the attribute overlay failling the equal depth tests.
2025-02-03 14:25:00 +01:00
Janne Nylander
b16e7dec28 Grease Pencil: Make "Hide Others" layer operator take layer groups into account
The old behavior for the "Hide Others" operator was to show the active layer, hide the
other layers and not do anything about layer groups. If the active node was a
layer group, nothing would be done.

This new behavior will act based on the active nodes type:
- If the active node is a layer, show active layer and parenting layer groups
- If the active node is a layer group, show all child nodes (layers and layer groups)
  and parenting layer groups

Pull Request: https://projects.blender.org/blender/blender/pulls/133893
2025-02-03 14:07:56 +01:00
Clément Foucault
58cb2e43a1 Fix #133680: Overlay: Poor wireframe quality in Edit mode for NURBS Surface
`lineOutput` was missing from some shaders.

Pull Request: https://projects.blender.org/blender/blender/pulls/133974
2025-02-03 13:58:25 +01:00
Janne Nylander
53255bcf6c Grease Pencil: Make layer locking operator also affect layer groups
Currently, the "Lock all" and "Unlock all" operators only act on layers.

This pull request modifies the `grease_pencil_layer_lock_all_exec` function so
that instead of iterating over Layer of the grease pencil object, it iterates over
TreeNode objects, affecting both Layer and Layer Group objects.

Pull Request: https://projects.blender.org/blender/blender/pulls/133838
2025-02-03 13:14:41 +01:00
Julian Eisel
7acd7e1246 UI: Rewrite asset shelf preview loading
- Fixes preview flickering on actions like undo/redo in the asset shelf (#93726), not yet for the
  file browser.
- Fixes #130861.

Makes the asset shelf use the asynchronous preview loading system of the UI instead of the file
browser one. The issues above where mostly caused by the file browser caching design.

The asset system and its UIs can now manage previews independently of the file browser back-end.
This is another step towards making the asset system independent of the file browser, see
https://developer.blender.org/docs/features/asset_system/fundamentals/from_file_browser_to_asset_system/.
Code to query asset previews through file browser types is removed.

Quite some work was done to prepare the UI preview system for this, to make it on par with the file
browser preview system. E.g.: 9d83061ed4, 315e7e04a8, 5055adc1c0, 16ab6111f7.

Note that the same change should be done to the asset/file browser, but this requires more work.

Pull Request: https://projects.blender.org/blender/blender/pulls/131871
2025-02-03 13:13:53 +01:00
Omar Emara
2d1e64d32d Fix: Simple Star glare fails in Metal GPU back-end
The Simple Stare glare code writes and reads from the same image in the
same invocation, so we need to insert a fence after the writes.

This is not very efficient, and we can probably use a single fence
between the causal and anti-causal passes. But this can be implemented
later as an optimization.

Pull Request: https://projects.blender.org/blender/blender/pulls/133968
2025-02-03 13:05:46 +01:00
Nathan Vegdahl
b5005cd99c Anim: make RNA Slot.target_id_type writable when not yet specified
When loading old blend files, versioned Actions can end up having a slot with an
'UNSPECIFIED' `target_id_type`. Assigning the slot to an ID will then set the
slot's `target_id_type` to match the type of the ID, but there was previously no
way to directly set it via Python if needed.

This PR changes the writability of `target_id_type` to match the extent of its
mutability when assigning a slot to an IDs. Which is to say, it can be set if
it's 'UNSPECIFIED', but not otherwise.

RNA doesn't have a good way to represent this, so we accomplish this with a
custom set function that simply ignores the write if the slot's `target_id_type`
isn't 'UNSPECIFIED'. This isn't ideal, but is the least-bad solution at the
moment.

Pull Request: https://projects.blender.org/blender/blender/pulls/133883
2025-02-03 13:01:47 +01:00
илья _
b7085d8554 Fix: Geometry Nodes: muted nodes have incorrect socket usage inferencing
Only inputs that are passed through internal links are used by the outputs.

Pull Request: https://projects.blender.org/blender/blender/pulls/133903
2025-02-03 12:44:06 +01:00
Brecht Van Lommel
c7eb2f4204 Refactor: Remove _DEBUG, use WITH_DRAW_DEBUG instead
The `_DEBUG` flag is interfering with oneTBB, and now that there is a
`WITH_DRAW_DEBUG` option this is more appropriate.

See #115774 for more context.

Pull Request: https://projects.blender.org/blender/blender/pulls/133950
2025-02-03 12:32:04 +01:00
Sietse Brouwer
68c7d93b5f Fix: Grease Pencil: Gizmos in wrong position when layer has transform
In Grease Pencil edit mode, the gizmos for move, rotate, scale etc. were shown in the wrong
position when the layer had a transform. With this fix, the layer transform is taking into
account when calculating the position of the gizmo.

Pull Request: https://projects.blender.org/blender/blender/pulls/133641
2025-02-03 11:25:01 +01:00
Lukas Tönne
dc8b2c4bf7 Fix #133096: Specialized function to copy Grease Pencil layers from other objects
Grease Pencil layers can only be duplicated on the same object. Duplicating layers
from other objects will not insert the drawings into the target object and just
assume that drawing indices remain valid, which is not the case. The subsequent
drawing index user update crashes Blender.

This fix adds a new `copy_frames_from_layer` function that makes a full copy
of layer data, regardless of where that layer originates from. This is safe to use
with layers that live in other objects.

Pull Request: https://projects.blender.org/blender/blender/pulls/133722
2025-02-03 11:00:16 +01:00
Philipp Oeser
ae23bcdc1a Fix #133959: Grease Pencil Reproject Strokes is wrong
Mistake in 7f5c803a8b

Was missing to move the point into layer space (from worldspace) again.

Pull Request: https://projects.blender.org/blender/blender/pulls/133961
2025-02-03 10:42:02 +01:00
Campbell Barton
295cb017c2 Fix #133806: Use operator region for redo from Adjust Last Operation HUD
Store the the HUD now stores the index of the region type so when there
are multiple views of the same type (typically quad view), the correct
region is used.

Ref !133935
2025-02-03 19:45:40 +11:00
Omar Emara
1a973bcb06 Cleanup: Compositor: Forward declare DerivedResources 2025-02-03 10:40:30 +02:00
Campbell Barton
ded798ba28 Fix #133921: Borderless windows on Wayland when run from VSCode
Workaround a problem where Electron overrides XDG_CURRENT_DESKTOP
by checking if an "ORIGINAL_" prefixed version of the variable.
2025-02-03 19:35:11 +11:00
Jeroen Bakker
27b9173081 Cleanup: Code-style
Remove commented out parameter-name from header.
2025-02-03 08:06:10 +01:00
John Kiril Swenson
0141bbb71c Cleanup: VSE: Clarify selection code
Rename a few functions to more accurately express their intent:
- `sequence_handle_size_get_clamped()` ->`strip_handle_draw_size_get()`
- `clickable_handle_size_get()` -> `inner_clickable_handle_size_get()`

Additionally:
- Move check for making strips unclickable when they are short enough in
  the vertical direction from `sequencer_main_cursor()` to
  `ED_sequencer_get_handle()`.
- Use `inner_clickable_handle_size_get()` in box select with handles.
- Add clarifying comments that calculate exact handle sizes.

There should be no functional changes (barring a tiny change in box
select with handle calculation).
2025-02-02 22:53:07 -06:00
Jesse Yurkovich
3c9a71b46f Fix #132465: Align Alembic/USD crease values with that of OpenSubdiv
In order to better interop with the broader Alembic/USD ecosystem, align
the crease values we export with what we believe is expected by native
OpenSubdiv, a 0-10 range.

On import we will translate the native OpenSubdiv range back into
Blender's 0-1 range.

To account for SubD assets produced by Blender before this change, a
compat check is put in place for both Alembic and USD to use the old
methodology when encountering such files. The compat check makes use
of the Blender version we place inside the format's metadata fields. Old
assets loaded into a new Blender will look ok. New assets loaded into an
old Blender would need to be reworked.

Pull Request: https://projects.blender.org/blender/blender/pulls/132582
2025-02-03 04:38:58 +01:00
Aaron Carlisle
3369d12abb UI: Fix "Levels" Consistency between Subdiv and Multires Modifiers
The Subdivision Modifier used "Levels" and the Multiresolution Modifier used "Level". This difference is changed to be "Levels" for both, which aligns with similar UI terminology where plural forms indicate adjustable values, such as "Render Samples".

Ref blender/blender-manual#105098
2025-02-02 20:13:39 -05:00
Harley Acheson
f631607df4 UI: Status Bar Confirm Then Cancel
When displaying keymaps on the Status Bar we prefer to show Confirm and
then Cancel.  We have a few places where these are reversed
accidentally. This just makes these consistent with the rest.

Pull Request: https://projects.blender.org/blender/blender/pulls/133947
2025-02-03 01:17:12 +01:00
Harley Acheson
02765b76cc UI: Fly Navigation Status Bar Display
Simplify and enhance the status bar display while in Fly navigation.
Combines some keymaps together, uses toggles, shows acceleration.

Pull Request: https://projects.blender.org/blender/blender/pulls/133945
2025-02-03 00:55:15 +01:00
Harley Acheson
3723906e30 UI: Walk Navigation Status Bar Display
Simplify and enhance the status bar display while in Walk navigation.
Combines some keymaps together, uses toggles, shows acceleration and
jump height values.  Goes from about 1600 pixels wide at 1X scale to
about 1250 pixels even though it shows more information.

Pull Request: https://projects.blender.org/blender/blender/pulls/133928
2025-02-02 20:29:37 +01:00
Campbell Barton
b2dc852b1b Docs: note why operator "register" flag is set without "undo" 2025-02-02 15:25:34 +11:00
Pratik Borhade
175d812797 Fix #109631: Restore default value operator removes redo panel
Inside `wm_operator_finished`, hud_status is set to `CLEAR` after `reset
to default value` operator.  `CLEAR` status further calls
`ED_area_type_hud_clear()` to free the hud region. This happens as
`do_register` is false due to missing `OPTYPE_REGISTER` flag.

Ref: !133761
2025-02-02 15:00:42 +11:00
Campbell Barton
7f57f5c6d6 Unbreak build WITH_PYTHON=OFF
Also correct argument handling when Python arguments were passed in,
which were attempting to handle the following parameters as arguments
instead of skipping them.
2025-02-02 14:39:34 +11:00
Campbell Barton
7413a8a4f0 Refactor: clarify logic for 3D view dolly, improve docs
The dolly operators poll function was set to `view3d_rotation_poll`
instead of `view3d_zoom_or_dolly_poll` which reads like a mistake.

As it happens this didn't cause any user visible problems because
RV3D_LOCK_ZOOM_AND_DOLLY is only set when all other locks are set.

Nevertheless, logically the dolly operator should check that dolly
is not locked. Updated the poll function for dolly to check neither
rotation or zoom/dolly is locked with comments noting why both are
needed.

Also expand on code-comments for why dolly enforces perspective view.
2025-02-02 13:58:34 +11:00
Campbell Barton
36531006da Cleanup: use const pointer for the gravity vector 2025-02-02 13:58:34 +11:00
Campbell Barton
4cd827870d Cleanup: quiet check_spelling_* targets
Also correct outdated references to `ghash`.
2025-02-02 13:58:34 +11:00
Sean Kim
857e9cbbef Cleanup: Minor changes to sculpt brush helper functions
* Moves into the blender::ed::sculpt_paint namespace
* Removes `SCULPT_` prefix
* Adds `brush_uses_vector_displacement` for common usage elsewhere

Pull Request: https://projects.blender.org/blender/blender/pulls/133900
2025-02-01 19:44:32 +01:00