Commit Graph

120055 Commits

Author SHA1 Message Date
Omar Emara
b8db212d95 Compositor: Use OCIO luminance for color to float conversion
This patch uses OCIO luminance for implicit conversion from color to
float in the compositor. This is done to match other node systems, and
because luminance is a much better default than the average formula used
before.

Versioning was added to retain average conversion for old files.

Pull Request: https://projects.blender.org/blender/blender/pulls/133206
2025-01-24 09:40:43 +01:00
Pratik Borhade
23ff989dc0 Fix: Grease Pencil: Move use_selection property to new row in redo panel
bca8fc76f9 exposed `use_selection` in redo panel of interpolate
sequence, this resolved #133324. But it has been added to same row
Move this property to new row, so it looks nicer.

Pull Request: https://projects.blender.org/blender/blender/pulls/133520
2025-01-24 08:11:50 +01:00
Pratik Borhade
ad3459fb23 Fix #133519: Regression: Cannot select tools in curves sculpt mode
947330e529 accidently removed enum list of SculptCurves tools.

Pull Request: https://projects.blender.org/blender/blender/pulls/133523
2025-01-24 08:09:20 +01:00
Campbell Barton
8495a6b049 Modifier: add (disabled) assertions to validate modifier input/output
There are times it's not clear when an error is introduced,
this helps narrow it down.
2025-01-24 14:04:02 +11:00
Brecht Van Lommel
222d6b54cf Fix #112689: Copy image to clipboard doesn't use color management
Pull Request: https://projects.blender.org/blender/blender/pulls/133505
2025-01-23 21:41:16 +01:00
Clément Foucault
f8c1154e7f Fix: DRW: Broken compilation because of missing header 2025-01-23 21:30:07 +01:00
Clément Foucault
160d9508fe Fix: Overlay: Broken GPU compilation tests
The clip variation was added to a common create info
which should not be compiled.
2025-01-23 21:30:07 +01:00
Brecht Van Lommel
9b445da803 Fix #81768: Hang after saving render result not as a copy
This would change the image type in image_save_post, which would make the
logic in BKE_image_acquire/release_renderresult mismatched.

Also consistently call BKE_image_release_renderresult when the render result
is null, rather than only doing it half the time.

Pull Request: https://projects.blender.org/blender/blender/pulls/133503
2025-01-23 21:19:40 +01:00
Jacques Lucke
d79e95f19a Fix: viewer node inputs are grayed out
Don't gray out inputs on nodes that don't have any inputs.
In such cases the inputs can't affect the output but they are
still meaningful.
2025-01-23 19:59:30 +01:00
Jacques Lucke
c1e6cb3a0e Fix: input sockets of output nodes are grayed out
Just like the root group output node, those should be treated
as outputs of the node tree and are thus always used.
2025-01-23 19:34:52 +01:00
Brecht Van Lommel
7584ccc28d Fix #125711: Crash saving stereo EXR image from command line
* Ensure valid bit depth is set along with file type
* Guard against invalid inputs in stereo imbuf creation
* Remove some unused code

Thanks Yiming Wu for finding the cause.

Pull Request: https://projects.blender.org/blender/blender/pulls/133499
2025-01-23 19:15:17 +01:00
Clément Foucault
cfd5d9e3ad Fix #132895: Overlay: Dashed/flickering wireframe overlay on solid shading
This add back the NDC offset that was present in the legacy overlay.

But instead of adding a new view for it, we add `ndc_offset_factor`
to `State` to simplify wire offseting

Instead of modifying the projection matrix, we compute the unit
offset and pass it to the shader which choose the appropriate
factor to apply to the vertex position.

The value is put inside `State` so that it can be referenced
easily by multiple overlays.
Later on (once we move the global UBO inside Overlay) we can
move this to a UBO.

This only implements it for wireframe and edit mesh vert and
edges.

Note: that there seems to be some code duplication with the
edit mesh vertex code. That's to be tackled in another commit.

Pull Request: https://projects.blender.org/blender/blender/pulls/133433
2025-01-23 18:08:20 +01:00
Clément Foucault
1ac4651778 Cleanup: DRW: Remove legacy common_view_lib.glsl
No functional changes. Only moving and renaming stuff.

Pull Request: https://projects.blender.org/blender/blender/pulls/131558
2025-01-23 18:06:22 +01:00
Clément Foucault
4938ac7fa5 Fix: Overlay: Alt+B clipping not working in some edit modes
There was several issue making it broken:
- Missing UBO binding
- Missing shader variation
- Missing shader implementation for edit edges clipping
2025-01-23 17:48:46 +01:00
Clément Foucault
bf77aae7b5 Fix: Selection: Edit mesh selection does not honnor alt+B clipping
The clipping plane state was missing from the passes.
2025-01-23 17:48:46 +01:00
Clément Foucault
dcfd87f01c Fix: Overlay: Missing Alt-B clipping frustum overlay
Detected thanks to a GL error.
2025-01-23 17:48:46 +01:00
Jacques Lucke
436eace765 Core: add functions to print DNA structs with all their members
This adds a new `DNA_print.hh` header which contains functions to print DNA
structs with all their data members in a human readable form. This is intended
for debugging purposes.

The basic usage is very straight forward: `DNA_print_struct(TypeName, data);`.
For example: `DNA_print_struct(bNode, node);`.

There is also `DNA_print_structs_at_address` which is primarily useful when
debugging what is written to a .blend file.

This was originally developed for #133063, but is already quite useful on its
own.

Pull Request: https://projects.blender.org/blender/blender/pulls/133432
2025-01-23 17:37:26 +01:00
Jacques Lucke
619d9e4e01 Fix #98559: support applying Geometry Nodes through multires modifier
Before, it was only possible to apply modifiers through a multires modifier if
they were deform-only. The Geometry Nodes modifier is of course not deform-only.
However, often one can build a node setup, that only deforms and does nothing
else.

To make it possible to apply the Geometry Nodes modifier in such cases the
following things had to be done:
* Update `BKE_modifier_deform_verts` to work with modifiers that implement
  `modify_geometry_set` instead of `deform_verts`.
* Add error handling for the case when `modify_geometry_set` does more than just
  deformation.
* Allow the Geometry Nodes modifier to be applied through a multi-res modifier.

Two new utility types (`ArrayState` and `MeshTopologyState`) have been
introduced to allow for efficient and accurate checking whether the topology has
been modified. In common cases, they can detect that the topology has not been
changed in constant time, but they fall back to linear time checking if it's not
immediately obvious that the topology has not been changed.

This works with the example files from #98559 and #97603.

Pull Request: https://projects.blender.org/blender/blender/pulls/131904
2025-01-23 17:34:30 +01:00
Miguel Pozo
97b4f99aed Fix #133483: Auto Depth broken when X-Ray enabled
Disable x-ray for depth only drawings.

Pull Request: https://projects.blender.org/blender/blender/pulls/133496
2025-01-23 17:11:54 +01:00
Ankit Meel
b858319dd3 macOS/QuickLook: support rich thumbnail in Finder
Support thumbnail that shows the file contents instead
of the default blend file icon for all files in Finder.
Some files may still have the usual blender icon as thumbnail
depending on their contents.

blender-thumbnailer process is kept alive by the system
in the background and is invoked by QuickLook when needed.

The checkbox to disable the extension is present in
the Settings app.

It will NOT be an interactive "Preview" that allows richer
interactions like Panning viewport, or rotating 3D objects.
2025-01-23 17:00:19 +01:00
Jacques Lucke
a449625fc4 Curves: make material index attribute builtin on curves geometry
This makes the `material_index` attribute built-in on `CurvesGeometry` which
means that it's built-in on `Curves` and `GreasePencil`. While only Grease
Pencil can use it so far during rendering, we already depend on them on curves
when converting between curves and Grease Pencil.

Making the attribute built-in implies that it is locked to one domain and type
(`Curve` domain and `int32` type in this case).

This makes curves more consistent with meshes.

Pull Request: https://projects.blender.org/blender/blender/pulls/133488
2025-01-23 16:24:22 +01:00
Miguel Pozo
8d392d41c2 Fix: GPU: GPU_indexbuf_bind_as_ssbo
Make the behavior consistent across all backends.
Clean up the GL function.

Follow-up from #132712.

Pull Request: https://projects.blender.org/blender/blender/pulls/133383
2025-01-23 15:40:45 +01:00
Miguel Pozo
49404a042e Fix: Nodes: Only look for compute contexts in geo-node trees
`find_socket_log_contexts` tries to look for `ComputeContext`s
regardless of the tree type.
This doesn't currently cause any problem in main because no other node
editor has zones, but it causes crashes in the NPR branch, and will
crash in main when other tree types add zones support.

(See https://projects.blender.org/pragma37/npr-tracker/issues/13)

Pull Request: https://projects.blender.org/blender/blender/pulls/133447
2025-01-23 15:34:12 +01:00
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