Commit graph

145566 commits

Author SHA1 Message Date
Nika Kutsniashvili
693f8f37d0 Fix #133326: Material preview for Grease Pencil
Material preview panel for grease pencil was accidentally removed in e10b0b3449 because it had EEVEE engine listed as `COMPAT_ENGINES`, which also seemed accidental. After adding panel back I noticed that .blend file for generating previews was also faulty. It was updated 2 years ago when GPv3 was experimental feature, and file wasn't up to date to current state.

This PR also adds new .blend file for generating material previews that is mostly the same as one in Blender 4.2, except:
- I organized it, removed unnecessary stuff.
- For Flat preview it was using flat checkerboard background, for other modes 3D room, which seemed unnecessary and not useful for Grease Pencil, so now every mode uses flat background.
- "Cloth", "Liquid", and "Shaderball" modes in 4.2 didn't render at all and resulted in all white screen. Now they render default Circle, which is not correct, but at least better than nothing. In future we can add custom drawings to those modes for previewing materials on more complex objects.

Pull Request: https://projects.blender.org/blender/blender/pulls/133372
2025-01-21 16:34:48 +01:00
Nathan Vegdahl
97d981a167 Fix #133241: don't crash on Frame All in motion tracker dopesheet
When there was an empty (no keyframes) track in the motion tracker's
dopesheet, Blender would crash when running the Frame All operator.
The issue was that the code computing the frame range was trying to
access non-existant data on the empty track, leading to a null pointer
dereference.

This fixes the issue by guarding that code with a nullptr check.

Pull Request: https://projects.blender.org/blender/blender/pulls/133371
2025-01-21 15:29:10 +01:00
Nathan Vegdahl
b2a06888c7 Anim: add Action+Slot selector for Masks
This adds an Animation panel to the Mask tab of the n-panel of the
Movie Clip and Image editors. Masks can be animated (for example, the
opacity of a Mask Layer), but there was no way to manage the Action
and Slot that held those F-Curves.

To keep things DRY, this PR also moves the code for drawing Action+Slot
selectors from the `PropertiesAnimationMixin` class to a utility
function, which is now called from both that class and the Mask UI code.

Pull Request: https://projects.blender.org/blender/blender/pulls/133153
2025-01-21 15:12:59 +01:00
Damien Picard
18f145d1ac UI: Rename masking property to better reflect its usage
The MaskLayer.invert property has "Restrict View" as its label. I
suspect this was an error during the commit that introduced the
feature. This commit simply renames it to "Invert".

Reported by Gabriel Gazzán.

Pull Request: https://projects.blender.org/blender/blender/pulls/132521
2025-01-21 15:02:58 +01:00
Jeroen Bakker
ff804882bd Refactor: Vulkan: Store large data in separate vectors
VKRenderGraphNode is 892 bytes and most of the bytes are used for
specific nodes. By storing large structs in separate vectors we can
reduce the needed memory and improve cache pre-fetching.

With this change the VKRenderGraphNode is reduced to 64 bytes.

On a (50 frames shader_balls.blend) the end user performance is improved by
2%.

| **Platform**     | **Before** | **After** |
| ---------------- | ---------- | --------- |
| AMD W7700        | 1409 ms    | 1383 ms   |
| NVIDIA RTX 6000  | 1443 ms    | 1428 ms   |

Pull Request: https://projects.blender.org/blender/blender/pulls/133317
2025-01-21 14:49:23 +01:00
YimingWu
2114620c28 Fix: Revised logic for EEVEE/Grease Pencil material slot display
The original code path could evaluate `ob.type` when `ob` was `None`.
Now fixed so this should not happen.

Continuation of:
https://projects.blender.org/blender/blender/pulls/132846
2025-01-21 21:04:31 +08:00
Aras Pranckevicius
4275d85158 Fix #133214: image vectorscope has incorrect horizontal scale
Both Image and Sequencer vectorscopes used YUV U,V coordinates
as-is, but their possible ranges are different: +-0.436 and
+-0.615 respectively.

It looks like more other software (ffmpeg, shotcut, etc.)
re-scales the vectorscope UV to fill up a square, i.e. streches
out the horizontal values, so do the same.

This fixes the "skin tone indicator" line, which at 123 degrees
(90 + 33 degrees to match positive I axis of YIQ color space) was
placed assuming the UV values fill up a square. So it was at the
wrong angle before.

The vectorscope horizontal scaling and skin tone indicator line now
matches other open source (ffmpeg, shotcut) and commercial (davinci
resolve, final cut pro) software packages.

Images in the PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/133316
2025-01-21 13:55:15 +01:00
Campbell Barton
84c9e6e655 Cleanup: use single quotes for enums 2025-01-21 23:50:17 +11:00
Lukas Tönne
bca8fc76f9 Fix #130323: Make Grease Pencil interpolate tool retain point distribution
The interpolate tool was using a linear re-sampling of the curves, which changes
non-uniform point distributions can causes unexpected shifts in points along the
curve, even very close to an input stroke (mix factor ~0 or ~1).

This patch adds an alternative interpolation function with explicit segment
indices and fractions, which can then be computed by the interpolation tool.
The point segment factors are chosen such that each point of the input strokes
has an exact matching point in the interpolation. When the factor is close to
0 or 1 the shape of the curve thus matches the respective input exactly.

This approach is more similar to what GPv2 did, except instead of sub-dividing
each segment it simply generates a _local_ uniform sample to fit more points
into the same segment. These extra points are colinear at the extremes of the
mix factor range, so the curve matches the input curves visually.

Pull Request: https://projects.blender.org/blender/blender/pulls/130594
2025-01-21 13:36:37 +01:00
Campbell Barton
abd933d6b0 Cleanup: prefer parenthesis over line continuations in Python scripts 2025-01-21 23:30:55 +11:00
Campbell Barton
70f44c6204 Cleanup: use operator_enum to avoid inlining values 2025-01-21 23:24:31 +11:00
Campbell Barton
0d0f8fa8f4 Cleanup: remove unused function in pose_library
Ref !133145
2025-01-21 23:06:29 +11:00
Lukas Tönne
cde64dbdd5 Fix #129145: Grease Pencil: Stroke depth detection and interpolation for drawing and primitives
GPv2 used the depth buffer at the end of a stroke drawing operation to project points and interpolated between detected values. This does not work in GPv3 because the strokes are added directly to drawings. Depth projection has to happen continuously, updating points between the last depth value and the next when a new hit is recorded.

Resolves #125258.

Pull Request: https://projects.blender.org/blender/blender/pulls/131842
2025-01-21 13:04:48 +01:00
Jacques Lucke
80441190c6 Nodes: automatically gray out input values that don't affect the output
This patch automatically grays out input values which can't affect the output
currently. It works with inputs of group nodes, geometry nodes modifiers and
node tools.

To achieve this, it analyses the node tree and partially evaluates it to figure
out which group inputs are currently not linked to an output or are disabled by e.g.
some switch node.

Original proposal: https://devtalk.blender.org/t/dynamic-socket-visibility/31874
Related info in blog post:
https://code.blender.org/2023/11/geometry-nodes-workshop-november-2023/#dynamic-socket-visibility

Follow up task for designing a UI that allows hiding sockets: #132706

Limitations:
* The inferencing does not update correctly when a socket starts being
  animated/driven. I haven't found a good way to invalidate the cache in a good
  way reliably yet. It's only a very short term problem though. It fixes itself
  after the next modification of the node tree and is only noticeable when
  animating some specific sockets such as the switch node condition.
* Whether a socket is grayed out is not exposed in the Python API yet. That will
  be done separately.
* Only a partial evaluation is done to determine if an input affects an output.
  There should be no cases where a socket is found to be unused when it can actually
  affect the output. However, there can be cases where a socket is inferenced to be used
  even if it is not due to some complex condition. Depending on the exact circumstances,
  this can either be improved or the condition in the node tree should be simplified.

Pull Request: https://projects.blender.org/blender/blender/pulls/132219
2025-01-21 12:53:24 +01:00
Falk David
971ac4e896 Fix: Missing subversion bump after recent commit
The commit b9f253564e
accidentally didn't update the subversion
after merging with main.
2025-01-21 12:41:44 +01:00
Nika Kutsniashvili
5e5c68fa62 UI: Expand brush/tool falloff curve presets in popovers
Expand falloff curve presets for brush/tools, to match other falloff
types such as proportional editing.

Pull Request: https://projects.blender.org/blender/blender/pulls/130905
2025-01-21 12:41:05 +01:00
Omar Emara
51057c0f16 Fix #133356: Legacy Separate and Combine nodes crash
The legacy separate and combine color nodes crash in CPU mode. That's
just because they are not implemented. So this patch implements them.

Pull Request: https://projects.blender.org/blender/blender/pulls/133363
2025-01-21 12:24:49 +01:00
Weizhen Huang
e6645bf06b Fix #131240: Cycles: Negative integration range in Huang Hair
It is possible that the valid range computed from `theta` and the range
visible to the current pixel do not overlap. In this case the hair
section has no contribution.

Pull Request: https://projects.blender.org/blender/blender/pulls/133337
2025-01-21 11:48:45 +01:00
Pablo Vazquez
e2e992a425 UI: Add icons to Batch Rename data type menu
Add icons to better identify data types in the Batch Rename type menu.

Makes it easy for users to recognize icons they are already familiar
with, especially when following tutorials in English while using a
translated UI.

Also fixes 'Light' being singular, while others were plural.

Pull Request: https://projects.blender.org/blender/blender/pulls/130300
2025-01-21 11:31:24 +01:00
Falk David
b9f253564e VSE: Python API: Deprecate sequence properties and replace with new ones
This PR adds new RNA properties that deprecate and replace any `sequence` property.
The old prooperties are still there and fully functional, but the description is changed
to indicate that these will be removed in the future and that the new properties should
be used instead.

| Deprecated property | Replacement property |
| --------------------------------- | ----------------------------------- |
| `context.active_sequence_strip` | `context.active_strip` |
| `context.selected_editable_sequences` | `context.selected_editable_strips` |
| `context.selected_sequences` | `context.selected_strips` |
| `context.sequences` | `context.strips` |
| `SequenceEditor.sequences` | `SequenceEditor.strips` |
| `SequenceEditor.sequences_all` |  `SequenceEditor.strips_all` |
| `MetaStrip.sequences` | `MetaStrip.strips` |

Previously, rna paths for animation data on strips started with `sequence_editor.sequences`.
This PRadds versioning for the rna paths to make sure to use
the new naming scheme. This does mean that in previous versions of blender,
the animations don't show but the data is not lost (even if the file is saved in the older version).

Also do some cleanup of existing python scripts inside the source to use the
new properties.

Part of #132963.

Pull Request: https://projects.blender.org/blender/blender/pulls/133156
2025-01-21 11:30:20 +01:00
Pratik Borhade
b976f71e1c Fix #133334: Grease Pencil: Move to layer fails with multiframe
If source drawings are on different frames, operator is squashing them in
first frame on dst layer. Now fixed with corrected condition. If value
does not exist at given frame_number/key inside frames() map, add a new
frame on dst layer.

Pull Request: https://projects.blender.org/blender/blender/pulls/133361
2025-01-21 11:28:11 +01:00
Bastien Montagne
992d44131d Second attempt at fixing warning 2025-01-21 10:27:06 +01:00
Bastien Montagne
9fe2ab3f34 Fix warning 2025-01-21 10:04:50 +01:00
Clément Foucault
3d980b459d Fix #133084: Overlay: Negative Z-Axis overlay not displayed
Simpler fix than 4be177a12d
2025-01-21 10:00:51 +01:00
Clément Foucault
4a0ba6b457 Revert "Fix #133084: Overlay-Next: Viewport Z-Axis"
This reverts commit 4be177a12d.

A much simpler fix is possible.
2025-01-21 10:00:51 +01:00
Bastien Montagne
0036206b6d API doc: add examples of error messages when constructor is not called. 2025-01-21 09:56:42 +01:00
Bastien Montagne
d251f8af30 Tests: Add 'with ASAN' knowledge to Linux release checks.
Builds with sanitizer will get addition asan/ubsan libraries linked in,
these need to be allowed in the static binaries check.

Pull Request: https://projects.blender.org/blender/blender/pulls/133319
2025-01-21 09:40:50 +01:00
Campbell Barton
db6cbcef5b Fix crash when texture bake cannot access evaluated mesh data
Baking could fail to access an objects evaluated mesh data (see #107426),
while the error remains, prefer an error instead of crashing.

Since the depsgraph runs Python callbacks I don't think we can
provide a guarantee the mesh data will available, so even if #107426
is fixed, it's reasonable to have a check here.
2025-01-21 17:56:01 +11:00
YimingWu
932fa1b8bf Fix #132113: Grease Pencil: Sort cache before draw_scene early return
`GPENCIL_draw_scene` uses `pd->tobjects.first == nullptr` to determine
whether to early return (draw nothing). When there's only "In Front"
grease pencil objects in scene, `tobjects.first` can be `nullptr` but
`tobjects_infront.first` is valid, in which case no grease pencil would
be drawn. Becase `gpencil_object_cache_sort` will link those two command
lists both to `tobjects` and allow `infront` ones to draw after others,
thus move it before the early return to allow drawing to proceed
normally.

Pull Request: https://projects.blender.org/blender/blender/pulls/132155
2025-01-21 06:54:21 +01:00
Campbell Barton
d1e3db71a6 Cleanup: use "_num" suffix instead of "tot_" prefix
Also group array with its length argument.
2025-01-21 16:51:41 +11:00
Campbell Barton
18783c5699 Cleanup: correct RST syntax, spelling & adjust quotes 2025-01-21 16:51:40 +11:00
Clément Foucault
5614d2543b Cleanup: Overlay: Simplify object_is_paint_mode condition
Follow up to #132159
2025-01-21 05:50:03 +01:00
Alaska
b9ebd96539 Fix #133229: Remove camera size optimization from SSS shader in Cycles
In Cycles, the subsurface scattering shader will switch to a
diffuse shader under a few different conditions to improve performance
and reduce noise.

This commit removes the "switch back to diffuse if the scattering
radius is less than a quarter of a pixel" optimization because in some
scenes, this can result in noticable lines as the shader transitions
between subsurface scattering and diffuse.

Pull Request: https://projects.blender.org/blender/blender/pulls/133245
2025-01-21 04:31:43 +01:00
RedMser
bd3bc46b42 UI: Use icons in UV Stitch Status Bar
Use icons and state highlighting to simplify the status bar display in
“UV Stitch” (UV_OT_stitch).

Pull Request: https://projects.blender.org/blender/blender/pulls/133269
2025-01-21 04:21:58 +01:00
Pratik Borhade
4450799673 Fix #125833: tooltip disappear on minor mouse movement
Slight displacement in mouse position triggers timer reset (pass=1).
With such condition, new redraw call to tooltip sets non zero timer
value (`r_pass_delay`) and `is_label=true` inside `ui_but_tooltip_init`.
This label boolean further skips drawing of description (for example, see:
`ui_tooltip_data_from_tool`).
To resolve this situation, inside timer_reset function keep `pass=0`
when tooltip region exists (i.e label is already visible on tooltip)

Pull Request: https://projects.blender.org/blender/blender/pulls/133258
2025-01-21 03:56:52 +01:00
Jonas Holzman
901119cf88 macOS: Main Window Title Improvements
Changes to the formatting of the OS window title for MacOS platform to
better follow their guidelines. Some refactoring, but there should be
no changes seen on other platforms.

Pull Request: https://projects.blender.org/blender/blender/pulls/132410
2025-01-21 03:17:50 +01:00
Jesse Yurkovich
3b08d8da22 Fix: Memory leak while clearing recent missing files
While the RecentFile struct itself was removed from the list of recent
files, the `filepath` field was not freed. Use the already existing
`wm_history_file_free` function to perform the cleanup.

Pull Request: https://projects.blender.org/blender/blender/pulls/133354
2025-01-21 02:11:02 +01:00
Pratik Borhade
8dde2f6689 Fix #114901: Shortcut assigned to pack island not showing in menu
`wm_keymap_item_find_props()` finds the keyitem for respective operator.
This function expects opcontext to be `WM_OP_EXEC/INVOKE_REGION_WIN`.
Set operator_context to `INVOKE_REGION_WIN` in UI drawing code for pack
island button, this will allow drawing shortcut key infront of the label.

Pull Request: https://projects.blender.org/blender/blender/pulls/133298
2025-01-21 01:57:56 +01:00
Hans Goudey
b36eb69038 Geometry Nodes: Output proper face corner normals
Previously, when evaluated on the face corner domain, the normal input
node just returned the face normals, as if the mesh was completely flat
shaded. This ignores face and edge smoothness, and custom face corner
normals. In the past couple years the expected behavior of accessing
normals has become much clearer and this behavior is clearly a mistake
in retrospect.

This commit exposes the same face corner normals used everywhere else
in Blender when the node is evaluated on the corner domain. The old
behavior is accessible with a node property in the sidebar. There is
versioning so old files have the property set and get the same results.

This is split from !132583.

Pull Request: https://projects.blender.org/blender/blender/pulls/133340
2025-01-20 23:57:32 +01:00
Jacques Lucke
46ece39c1a Fix #133189: crash when hiding inline socket
Now the output socket checks if the corresponding inline socket that it should
be aligned with is visible.

This is an alternative to #133271 which had the problem that it resulted in
`flat_item::Socket` instances for which the input and output is `nullptr`.

Pull Request: https://projects.blender.org/blender/blender/pulls/133325
2025-01-20 22:53:10 +01:00
Weizhen Huang
350bd60b11 Fix: Cycles: Metal compilation when include is guarded behind WITH_CYCLES_DEBUG
Happens after f79cae2c59. Seems that Metal pre-processing could not
figure out that the inclusion is guarded behind `#ifdef`, so the
included file is expanded here and never again afterwards.
The pre-processing should be fixed, but for now just always include the file.

Pull Request: https://projects.blender.org/blender/blender/pulls/133336
2025-01-20 19:15:46 +01:00
Hans Goudey
8cb4d6aaab Cleanup: Unused variable with asserts off 2025-01-20 12:37:25 -05:00
Bastien Montagne
e8e6705081 Add note about calling Blender-defined constructor in multi-inheritance cases
`super()` is using the MRO to find the first `__init__()` function, if the blender-defined type is not the first inherited type, it may never be called that way.

See #133183
2025-01-20 18:35:18 +01:00
Bastien Montagne
2d7068a0d3 Add file_path_map function to bpy.data.
Similar to `bpy.data.user_map`, it returns a mapping of IDs to all the
filepaths they use.

Fairly basic still, may need to be refined with more options to
control which filepaths are included etc.

Mainly intended to make handling of a production blendfile dependencies
more easy.

Also adds some basic testing of the new feature.

Pull Request: https://projects.blender.org/blender/blender/pulls/127252
2025-01-20 17:39:25 +01:00
Pratik Borhade
012afaf318 Fix: Remove unused parameter from skip_strokes_with_locked_material
Mistake in 076663177f

Pull Request: https://projects.blender.org/blender/blender/pulls/133331
2025-01-20 17:29:32 +01:00
Julian Eisel
92a1ba2511 Fix: Assets: Custom library with empty path breaks catalog loading
With an asset library configured in the Preferences that had an empty
path, the catalog tree of the "Current File" asset library would be
empty. That is because the path-less library would incorrectly be
considered as containing the current file's path (`BLI_path_contains()`
returned true for the empty path).
2025-01-20 17:19:39 +01:00
Nikita Sirgienko
84bc5741cc Build: Upgrade OIDN to 2.3.2
This upgrades OIDN to the 2.3.2 release
and bring minor improvements.

Ref #128577

Pull Request: https://projects.blender.org/blender/blender/pulls/133321
2025-01-20 16:51:04 +01:00
Weizhen Huang
f79cae2c59 Fix: Cycles: Compilation issue with WITH_CYCLES_DEBUG enabled
Pull Request: https://projects.blender.org/blender/blender/pulls/133303
2025-01-20 16:11:38 +01:00
Nathan Vegdahl
3ed2c2346d Fix #129540: allow stashing same Action with different Slots
Before slotted actions, it was only useful to stash an action once on a
data-block: that was all that was needed to keep the action's channels
associated with the data-block, and stashing it multiple times was redundant.
Therefore Blender would simply refuse to stash an action if it was already
stashed.

However, now with slotted actions the user may legitimately want to stash an
action more than one time: if the action has multiple slots, the user may want
to keep the channels of multiple slots all associated with a data-block.  Doing
that requires stashing each action+slot combination separately.

This PR addresses this use case by now allowing each action+slot *combo* to be
stashed once. Stashing a given action+slot combo more than once per data-block
is still prevented, however, since that is still redundant.

Pull Request: https://projects.blender.org/blender/blender/pulls/133307
2025-01-20 16:11:08 +01:00
Pratik Borhade
076663177f Fix #132943: Grease Pencil: Don't erase strokes with locked material
For points with locked material, add them to `src_to_dst_points`
as in they are outside the eraser ring to avoid deleting these points.
A new function is introduced to deal with it.
For stroke eraser mode, pass true in Indexmask `strokes_to_keep`.

Pull Request: https://projects.blender.org/blender/blender/pulls/133137
2025-01-20 15:42:11 +01:00