Commit Graph

116632 Commits

Author SHA1 Message Date
Jeroen Bakker
2bd4e101a0 Fix #130106: Vulkan: Pixelbuffer performance
Cycles uses pixel buffers to update the display. Due to making things
work the vulkan backend downloaded the GPU allocated pixel buffer to the
CPU, Copied it to a GPU allocated staging buffer and update the display
texture using the staging buffer. Needless to say that a (CPU->)GPU->CPU->GPU
roundtrip is a bottleneck.

This PR fixes this by allowing the pixel buffer to act as a staging
buffer as well.

Viewport and final image rendering performance is now also similar.

| **Render** | **GPU Backend** | **Path tracing** | **Display** |
| ---------- | --------------- | ---------------- | ----------- |
| Viewport   | OpenGL          | 2.7              | 0.06        |
| Viewport   | Vulkan          | 2.7              | 0.04        |
| Image      | OpenGL          | 3.9              | 0.02        |
| Image      | Vulkan          | 3.9              | 0.02        |

Tested on:
```
Operating system: Linux-6.8.0-49-generic-x86_64-with-glibc2.39 64 Bits, X11 UI
Graphics card: AMD Radeon Pro W7700 (RADV NAVI32) Advanced Micro Devices radv Mesa 24.3.1 - kisak-mesa PPA Vulkan Backend
```

Pull Request: https://projects.blender.org/blender/blender/pulls/133485
2025-01-23 14:58:49 +01:00
Brecht Van Lommel
426a9cdcbb Fix: Rendered animation player text too small on macOS 2025-01-23 13:32:50 +01:00
Brecht Van Lommel
d5d686d540 Fix: Build error with draw test after recent cleanup 2025-01-23 13:17:20 +01:00
Pratik Borhade
1dff92e8d2 Fix #133454: Grease Pencil: Overlays not updated with selection mode
This is due to missing depsgraph update and notifiers to redraw the
viewport region. `ensure_selection_domain` returns false when entire
domain elements are/ain't selected. This makes the `changed` boolean
false that further prevents update calls. Now fixed with bitwise
condition.

Pull Request: https://projects.blender.org/blender/blender/pulls/133463
2025-01-23 12:40:21 +01:00
Pratik Borhade
01db7f00f0 Fix: Grease Pencil: Auto merge affects cyclic curves
Do not add end points of cyclic curves in KD-tree to skip them from
further processing.

Pull Request: https://projects.blender.org/blender/blender/pulls/133425
2025-01-23 12:25:44 +01:00
Sean Kim
a4a0c81cd6 Overlay: Fade Inactive Geometry filter on object being interactable
Prior to this commit, the Fade Inactive Geometry overlay would inspect
the active object and compare each other object's mode and hide them if
they did not share the same mode.

This was incorrect in the following case:
* If multiple objects were all in similar modes, as can be the case
  with "Lock Object Modes" off, or with multi-edit mode, then objects
  would remain unfaded if they shared the same mode as the active
  object.

To fix this, we explicitly check for both the active and the "other"
object being in edit mode and avoid fading in this case.

Ref: #87704
Pull Request: https://projects.blender.org/blender/blender/pulls/132255
2025-01-23 12:10:45 +01:00
Omar Emara
60468d86e9 Cleanup: Missing static qualifier for local function 2025-01-23 11:59:05 +02:00
Brecht Van Lommel
be67a07cae Fix #133411: Texture baking changes object visibility
The recent addition of DEG_disable_visibility_optimization in #133358
almost fixed this, but it was not fully working. By ensuring objects
are evaluated we avoid modifying original objects.

If for some reason (like a Python handler) the object is still missing,
report an error in the bake operator.

Pull Request: https://projects.blender.org/blender/blender/pulls/133439
2025-01-23 10:35:41 +01:00
Brecht Van Lommel
dea067fb4d Fix: Particle brush effect can't be inverted with shift key
Regression from 6df437b.

Pull Request: https://projects.blender.org/blender/blender/pulls/133468
2025-01-23 10:16:47 +01:00
Brecht Van Lommel
6a67c90f64 Fix #133458: Particle add brush doesn't work
This was another case similar to #132918. Tweak asserts to properly catch
using min/max on (implicitly cast) pointers.

Pull Request: https://projects.blender.org/blender/blender/pulls/133468
2025-01-23 10:16:45 +01:00
Omar Emara
1f4e9d84d4 Compositor: Support OIDN on Arm
This patch extends the check for OIDN support to include Arm on Windows
and Linux. This is identical to and copied from Cycles.

Pull Request: https://projects.blender.org/blender/blender/pulls/133467
2025-01-23 10:01:07 +01:00
Campbell Barton
5f73d422ff Docs: correct code-comment for TextVars::cursor_offset 2025-01-23 15:53:52 +11:00
Campbell Barton
3f31edd4c0 Extensions: exclude development files from installation 2025-01-23 15:41:47 +11:00
Sean Kim
47bc05f7ae Tests: Add bke::pbvh::Tree::from_mesh unit test
This commit adds a unit test for the `bke::pbvh::Tree::from_mesh` method
covering the basic mesh usecase. Further work to add the multires
and BMesh versions will come in subsequent commits.

Pull Request: https://projects.blender.org/blender/blender/pulls/133074
2025-01-23 00:59:48 +01:00
Jesse Yurkovich
86ab7b7cb7 Fix: USD: Out of bounds access while building armature deform groups
If a USD file has joint indices outside the range of the joints list,
it's possible for our code to assert or crash depending on build
configuration.

One particular file had 289000 indices, nearly all of which were outside
the list which contained just 1 joint value. Instead of continuing when
this is detected, trace an error and immediately return as it's probably
unsafe to continue. This also resulted in many thousands of warning
traces before.

Pull Request: https://projects.blender.org/blender/blender/pulls/133419
2025-01-23 00:33:45 +01:00
Hans Goudey
5921ca8a9f Cleanup: Pass IndexMask by const reference 2025-01-22 17:38:14 -05:00
Hans Goudey
b2bbb0a8fb Cleanup: Remove unused includes in functions module
Pull Request: https://projects.blender.org/blender/blender/pulls/133455
2025-01-22 23:29:33 +01:00
Hans Goudey
0a2d5d5801 Fix #133267: Sculpt "Persistent Base" doesn't work for mesh and multires
These geometry types don't work properly with attributes currently,
so the persistent base isn't really "persistent" and doesn't last after
exiting sculpt mode, but it's still useful for it to work within a
sculpt session. Enable that by adding temporary array storage in
`SculptSession`. During the sculpt refactor project I mistakenly
assumed that this didn't work well enough that anyone would use it.

Pull Request: https://projects.blender.org/blender/blender/pulls/133410
2025-01-22 22:33:13 +01:00
Harley Acheson
62a0350f6d Fix #91223: Draw Non-Object Active Items in Text Hi
In the Outliner, draw the text of active collections, scenes, and view
layers in "text highlight" color, by default a brighter white than the
regular items. This helps differentiate the active ones a bit better
and also allows them to be themed separately.

Pull Request: https://projects.blender.org/blender/blender/pulls/133390
2025-01-22 20:24:54 +01:00
Hans Goudey
e07cd2b982 Cleanup: Remove unused and transitive includes in draw module
Especially through DRW_render.hh, there were a lot of unnecessary
includes almost everywhere in the module. This typically makes
dependencies less explicit and slows down compile times, so switch
to including what files actual use.

Pull Request: https://projects.blender.org/blender/blender/pulls/133450
2025-01-22 19:37:38 +01:00
Julian Eisel
efadb938f0 Fix #132422: Crash when opening UV editor from shader editor
Fixes: #132422, #133288.

`ED_area_init()` is called when the editor in an area changes, this also changes
the available regions. That means, region polling needs to be executed. The
crash was happening because that wasn't the case, and the asset shelf region was
initialized before the polling was executed, which allocates region data in the
`on_poll_success()` callback.

Also had to pass context to `ED_area_init()`, which is an annoyance, but should
be fine. Similar functions like `ED_area_exit()` take it too.

Pull Request: https://projects.blender.org/blender/blender/pulls/133388
2025-01-22 19:24:38 +01:00
Harley Acheson
0b38b3b2b1 UI: Status Bar Display for GPENCIL_OT_annotate
Simplify the status bar display for "Annotation Draw"

Pull Request: https://projects.blender.org/blender/blender/pulls/133402
2025-01-22 19:19:42 +01:00
Hans Goudey
d54a7bcb11 Cleanup: Use reinterpret_cast instead of two static casts 2025-01-22 12:50:01 -05:00
Bastien Montagne
8435c03061 Fix missing header in materialX code.
Fairly weird, debug builds were fine, but release ones with clang 19
and mold failed at linking step, complaining about misisng
`bNode::output_sockets()` symbol.

Guess debug config somehow pulls this symbol from somewhere else?
2025-01-22 18:43:27 +01:00
Iliya Katueshenock
ef8808d990 Cleanup: Compositor: Ghost data of a node storage
Since 4cf7fc3b3a (where a storage handling being added) a render layer node never has persist storage data.
And even more, some code of node update do use storage field as temporal variables for a callback so no any data can live forever in this place.
No one copy/initialize/free callback of the node also does not deal with node storage.
And compositor code also don't know about node storage since use different data from a node (id and custom1 fields).

Pull Request: https://projects.blender.org/blender/blender/pulls/132717
2025-01-22 18:19:39 +01:00
Miguel Pozo
20bd132703 Fix: Overlay-Next: Jagged wireframes when Overlay AA is disabled
Fixes the issue described in
https://projects.blender.org/blender/blender/issues/132895#issuecomment-1390739.

Pull Request: https://projects.blender.org/blender/blender/pulls/133446
2025-01-22 17:18:37 +01:00
Hans Goudey
a704d47a04 Fix #133429: Bevel modifier crash with empty mesh
Attribute domain interpolation would fail in this case. Instead of
checking for that, just add an empty check at the modifier entry point.
2025-01-22 10:32:09 -05:00
Brecht Van Lommel
e31077ca4c Fix #132148: Assert using rendered animation playback
Don't close file handle twice.
2025-01-22 15:52:09 +01:00
YimingWu
053d817a75 Fix (unreported): Assert when right clicking on image editor tools
When right clicking on any of the image editor tool buttons,
`WM_keymap_guess_from_context` would be called but lack of `space_type`
will cause `WM_keymap_find_all` to return `nullptr`. Assigning it to
`SPACE_IMAGE` fixes the issue.
2025-01-22 22:28:26 +08:00
Philipp Oeser
c0e881cebf Sculpt: avoid adding ".sculpt_mask" attributes in certain cases
Mask layers were added (unnecessarily) in these cases:
- calling `Mask Slice` without having a mask even (now return
`OPERATOR_CANCELLED` early)
- calling `Mask Extract` without having a mask even (now return
`OPERATOR_CANCELLED` early)
- `Extract Face Set` was also adding a mask layer (only because both
extracts used `geometry_extract_apply`), moved mask specific stuff into
`paint_mask_extract_exec` (see above also)

Came up in !123888

Pull Request: https://projects.blender.org/blender/blender/pulls/133435
2025-01-22 15:25:25 +01:00
Omar Emara
549c724f78 Revert "Cleanup: Remove check for SSE4.1 in denoise node"
This reverts commit 19e9092cb6. The
minimum requirement is for builds that Blender officially provides. We
still need to maintain code for none SSE builds.
2025-01-22 16:15:21 +02:00
Omar Emara
19e9092cb6 Cleanup: Remove check for SSE4.1 in denoise node
Blender now has a minimum requirement of 4.2, so no need to check for
SSE4.2 support in the denoise node.
2025-01-22 15:11:22 +02:00
Hans Goudey
7177dca600 Fix: Incorrect interface/tooltip translation check
These panel header labels should be translated when the interface
is translated but they checked for tooltip translation instead.

Pull Request: https://projects.blender.org/blender/blender/pulls/133412
2025-01-22 14:05:59 +01:00
YimingWu
8620f0286a Fix #133414: Sequencer: Ensure valid UTF-8 sequence when pasting text
`TextVars::text` is only 512 bytes and does not include string ending
byte, and `sequencer_text_edit_paste_exec` uses a very simple truncation
that didn't guarantee valid UTF-8 sequence at the end. This is now fixed
by using `BLI_str_utf8_invalid_strip` after truncating the string.

Pull Request: https://projects.blender.org/blender/blender/pulls/133416
2025-01-22 13:00:01 +01:00
Nika Kutsniashvili
9d5a4756ca UI: Use gizmo theme colors for knife tool overlay
Knife Tool overlays were using NURBS theme colors,
make it use gizmo colors instead.

More details and screenshots in the PR.

Fixes #126867

Pull Request: https://projects.blender.org/blender/blender/pulls/133395
2025-01-22 12:57:46 +01:00
Philipp Oeser
517aa5bfe2 Fix #113760: Knife Tool: wrong red point after undo
After confirming a cut, the tool goes into `MODE_IDLE`.
In `knifetool_undo`, the `KnifePosData` `prev` (drawn as the "red point"
in question in `knifetool_draw`) was only set to the `KnifeUndoFrame`
pos when we are in `MODE_DRAGGING` though -- this is now changed to also
be done for `MODE_IDLE`.

NOTE: it might be questionable to even draw this bigger red dot once a
cut is confirmed (will attach another small diff to the PR that does
this)

Pull Request: https://projects.blender.org/blender/blender/pulls/133430
2025-01-22 12:14:51 +01:00
Brecht Van Lommel
7a0a173d39 Fix: Missed case of OCIO luminance coefficients in EEVEE
Following up on #133368. Thanks Omar for spotting this.

Pull Request: https://projects.blender.org/blender/blender/pulls/133400
2025-01-22 11:19:02 +01:00
Brecht Van Lommel
c749f6c376 Cleanup: Remove unnecessary usage of Boost in the build system
* Some libraries like Alembic and OpenColorIO for a long time removed
  header dependencies on Boost.
* No need to have BOOST_LIBRARIES anymore, only BOOST_PYTHON_LIBRARIES
  is a direct dependency through USD headers.
* OpenVDB is no longer a static library, no need to link its dependencies.

Pull Request: https://projects.blender.org/blender/blender/pulls/133424
2025-01-22 10:02:22 +01:00
Campbell Barton
e8ebbce9c5 Cleanup: update naming for dualcon: rename loop corner_verts
These weren't the equivalent of MLoop's even with the old naming
this was misleading, especially `DualConInput::mloop`.
2025-01-22 19:59:03 +11:00
Campbell Barton
6c05859b12 UI: mitigate problem where remesh could accidentally hang/crash
Having a small voxel size meant typing in zero would clamp the
voxel size to a small number which was often small enough to hang
calculating large voxels which would eventually fail to allocate
memory & crash.

Instead, allow a zero value but bypass calculation.

See #130526.
2025-01-22 19:46:16 +11:00
Campbell Barton
acf270b216 Unbreak build WITH_INTERNATIONAL=OFF 2025-01-22 19:40:21 +11:00
Philipp Oeser
2a52ca42bd Fix #131836: Texture paint: "Texture Mask" stencil is not drawing
Reason for this is that all the brushes in essentials assets have a zero
default `mask_stencil_pos` / `mask_stencil_dimension`.
At that time, they have been created resetting a brush to defaults and
using that as a starting point.
At that time though, these settings didnt have a default (which
b2dd308dca fixed, so that method should not result in those settings
being zero).

The brushes in essentials assets still do though, now correct these in
versioning code.

Pull Request: https://projects.blender.org/blender/blender/pulls/133374
2025-01-22 09:16:25 +01:00
Philipp Oeser
00968fe6db Fix: Grease pencil inconsistent inverting of influence vertex groups
Behavior was not consistent across modifiers

- Opacity
-- strokes were using inverted weights only when
MOD_GREASE_PENCIL_OPACITY_USE_WEIGHT_AS_FACTOR was OFF, fills however
when MOD_GREASE_PENCIL_OPACITY_USE_WEIGHT_AS_FACTOR was ON
- Tint
-- strokes and fills were using inverted weights only when
MOD_GREASE_PENCIL_TINT_USE_WEIGHT_AS_FACTOR was ON
- others (Envelope, Lattice, Noise, Offset ) were ignoring inverting the
influence vertex group alltogether (but that is reported in #133055 and
will be handled separately, see below)
- others (Hook, ... ) were always inverting it, which is correct

This pull requeset only corrects this for Opacity and Tint (in the way
that now weights are always inverted, no matter if "Use Weight As
Factor" is used).
This also paves the way to a more general fix for #133055 (which intends
to move the weight inversion to the very general
greasepencil::get_influence_vertex_weights)

Pull Request: https://projects.blender.org/blender/blender/pulls/133310
2025-01-22 09:15:53 +01:00
Brecht Van Lommel
139f0d8c32 Refactor: Move translation handling fully into blentranslation
No need to have the extra abstraction, simpler to have it together
in the same module.

Pull Request: https://projects.blender.org/blender/blender/pulls/133347
2025-01-22 09:05:32 +01:00
Brecht Van Lommel
860bfd786e Refactor: Don't modify std::locale::global for translation
Without boost::locale, there seems no particular reason to modify the
global locale, we can just translate strings ourselves.

Other locale facets like numeric and time are also left unchanged
from the default, which is the "C" locale. This appears to match
previous Blender behavior with boost::locale. That protects against
bugs where formatting floats for I/O unexpectedly depends on the
system language.

Pull Request: https://projects.blender.org/blender/blender/pulls/133347
2025-01-22 09:05:29 +01:00
Brecht Van Lommel
820f261371 Refactor: Replace Boost Locale for translation
Use code adapted from boost::locale to implement locale name parsing
and .mo file reading ourselves.

Together with #132142 this removes the last direct Blender dependency
on Boost.

Pull Request: https://projects.blender.org/blender/blender/pulls/133347
2025-01-22 09:00:32 +01:00
T0MIS0N
9cdbb72c1a Fix #132643: Deleting Color Ramp's penultimate stop doesn't update the Color Ramp
This bug occurs when the user deletes the rightmost stop on a
color ramp with 2 stops. After doing this, the color ramp appears
to stop updating its results.

This bug is due to a shader optimization for color ramps. For ramps
with 2 stops or less, the first and second stops are hardcoded as
inputs to get the results of the color ramp. When deleting the
rightmost stop, the stop's data isn't actually changed. The ramp
just updates its total stop number. Because of this, the result of
the color ramp won't change.

This is fixed by only allowing this optimization when a ramp has
exactly 2 stops. This solution works well since it keeps color ramp
code neat and concise. It also makes more logical sense to only allow
this optimization to work with 2 stops since it uses 2 hardcoded values
from the color ramp. It's also unlikely this will lead to adverse
performance problems since it doesn't make sense to use a color ramp
with 1 color stop. In that case, the user should just use an RGB node.

Another possible solution for this problem would be to update the data
for the second stop in the color ramp to exactly match the first when
deleting the second stop. However, this is undesirable since the code
wouldn't make much sense to those who don't know about the color ramp
optimizations.

Pull Request: https://projects.blender.org/blender/blender/pulls/132951
2025-01-22 08:29:48 +01:00
YimingWu
e7efb704fa Fix #133367: Use BKE_unit_value_as_string_scaled for ruler gizmo
`BKE_unit_value_as_string` was modified in e949ff7334
to include a `BKE_unit_value_as_string_scaled` version, some places on
the interface needs to use the scaled version to show the string, this
includes ruler gizmo length text.

Pull Request: https://projects.blender.org/blender/blender/pulls/133373
2025-01-22 03:51:45 +01:00
John Kiril Swenson
e3c0224d16 Fix #133193: VSE: Wrong mouse cursor over scroll bars
Add a check to see if the mouse is in the scroller region in
`sequencer_main_cursor()`.

Pull Request: https://projects.blender.org/blender/blender/pulls/133353
2025-01-22 03:43:01 +01:00
Harley Acheson
efe75841d3 UI: Status Bar Display for POSELIB_OT_blend_pose_asset
Simplify and improve the status bar display by adding icons and
state highlighting while running "Blend Pose Asset".

Pull Request: https://projects.blender.org/blender/blender/pulls/133397
2025-01-22 03:30:40 +01:00