Commit graph

145593 commits

Author SHA1 Message Date
Brecht Van Lommel
bec8581916 Refactor: Remove Boost from Quadriflow
Extract Boykov-Kolmogorov max flow algorithm from boost::graph. As part
of work towards removing Boost as a Blender dependency.

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

Pull Request: https://projects.blender.org/blender/blender/pulls/132142
2025-01-22 09:05:38 +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
Campbell Barton
dfb01181cd extern: update quadriflow patch to account for local changes 2025-01-22 16:27:34 +11:00
Alaska
58b7543ede Fix #132322: Artifacts in Cycles volume rendering with Light tree on some devices
In a previous commit (1), adjustments to light tree traversal were made
to try and skip distant lights when deciding which light to sample
while within a world volume.

The skip wasn't implemented properly, and as a result distant lights
were still included in the light tree traversal in that sitaution.
And due to the way the skip was implemented, there were some
unintialized variables used in the processing of the distant lights
importance which caused artifacts on some platforms.

This commit fixes this issue by reverting the skip of distant lights
in that situation.

(1) blender/blender@6fbc958e89

Pull Request: https://projects.blender.org/blender/blender/pulls/132344
2025-01-22 05:50:32 +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
Campbell Barton
ecdeeca5b3 Cleanup: re-order baking highpoly break-on-error
Avoid breaking with a partially initialized `highpoly` as this
could cause complications when freeing members in the future.
Also use variables for brevity.
2025-01-22 12:45:03 +11:00
Campbell Barton
0f0bc1a940 Fix #107426: error when texture bake cannot access evaluated mesh data
Changes in [0] broke baking to objects with animated render visibility,
causing render visibility override not to work.

Resolve by disabling visibility optimizations.

Ref !133358

[0]: 0dcee6a386
2025-01-22 12:43:23 +11:00
Campbell Barton
9b5a65d1ec Cleanup: suppress unused function warning 2025-01-22 12:43:08 +11:00
Hans Goudey
8c381a3b37 Cleanup: Slightly improve comments in OffsetIndices header
Avoid some repetition and clarify/simplify some language.
2025-01-21 19:09:01 -05:00
Sean Kim
6b0fa709fa Fix #133128: Multires cavity automasking creates artifacts
Prior to the brush refactor in 4.3, the cavity automasking feature
had an implicit dependency on stable position values. In many cases,
such as during brush evaulation, this was upheld by the usage of the
proxy system, which meant that even if a vertex's neighbor was changed
during a stroke in paralell, these changes would not be accessed until
after a stroke finished.

With the new method of brush evaulation removing the proxy system, this
introduced subtle artifacts on BVH node boundaries, as vertices were
guaranteed to change and cause differences as there was no temporary
storage to use the "old" position data. This effect was most noticable
in 4.3 and beyond in multires sculpting, though similar artifacts can be
seen when using the mesh filter in all prior versions.

To fix these issues, instead of calculating the internal cavity factor
during a stroke or during deformations, we calculate it ahead of time
based on the affected nodes of a stroke. This has the benefit of now
behaving consistently for a given mesh and given brush or filter
application.

From a performance perspective, this change should have no noticeable
impact, as each BVH node, and by extension each vertex, only has its
corresponding cavity factor calculated once, when the stroke would
affect the node.

Related: #102745

Pull Request: https://projects.blender.org/blender/blender/pulls/133224
2025-01-21 23:19:51 +01:00
Iliya Katushenock
1eed464d48 Cleanup: Remove unused includes in geometry nodes
Pull Request: https://projects.blender.org/blender/blender/pulls/118095
2025-01-21 22:46:40 +01:00
Harley Acheson
8aafcc7f64 UI: Status Bar Message for CLIP_OT_add_marker_at_click
Add icons to display of the status bar text for “Add Marker at Click”.

Pull Request: https://projects.blender.org/blender/blender/pulls/133394
2025-01-21 21:53:47 +01:00
Julien Duroure
748c91ce27 glTF exporter: add fallback interpolation option
Before, any sampled properties that are not keyed was exported with LINEAR interpolation
Now, user can choose the interpolation for these not keyed values (LINEAR or CONSTANT/STEP)

Example of not keyed properties: Deformation bones when animators animated other bones
2025-01-21 21:46:25 +01:00
Nathan Vegdahl
a9d72b1a14 Anim: add Action+Slot selector for Movie Clips
This adds an Animation panel to the Footage tab of the n-panel of the Movie Clip
editor. Movie Clips have various properties that can be animated, but there was
previously no way to manage the Action and Slot that held those F-Curves.

Pull Request: https://projects.blender.org/blender/blender/pulls/133380
2025-01-21 18:44:57 +01:00
Jacques Lucke
fb7eef9271 BLI: add IndexMask::from_ranges constructor function
This can be useful when going from a selection of curves to the corresponding
selection of points.

The simple implementation given here should work quite well in the majority of
cases. There is still optimization potential for some cases involving masks with
many gaps. The implementation is also single threaded for now. Using
multi-threading is possible, but should ideally be done in some way to still
lets us exploit the fact that the index ranges are already in sorted order.

Pull Request: https://projects.blender.org/blender/blender/pulls/133323
2025-01-21 18:18:12 +01:00
Brecht Van Lommel
890455affe Refactor: Rename function to clarify it's for sRGB only
Pull Request: https://projects.blender.org/blender/blender/pulls/133368
2025-01-21 18:05:56 +01:00
Brecht Van Lommel
5e02b4e6f1 EEVEE: Use OpenColorIO for luminance
Color to grayscale conversions should take into account the colorspace,
and these are considered to be in scene linear colorspace.

Note the RBG to BW node implementation is used for implicit conversions,
so that is covered as well.

No change with the default configuration.

Pull Request: https://projects.blender.org/blender/blender/pulls/133368
2025-01-21 18:05:56 +01:00
Brecht Van Lommel
e0479e2fb4 Geometry Nodes: Use OpenColorIO for luminance
Color to grayscale conversions should take into account the colorspace,
and these are considered to be in scene linear colorspace.

No change with the default configuration.

Pull Request: https://projects.blender.org/blender/blender/pulls/133368
2025-01-21 18:05:56 +01:00
Brecht Van Lommel
04298a0c48 Tests: Use tabs in benchmark charts
For easier overview, and to make this heavy page a bit easier to browse.

Pull Request: https://projects.blender.org/blender/blender/pulls/133385
2025-01-21 18:01:42 +01:00
Miguel Pozo
79201d0aee Cleanup: Overlay-Next: Move edit_mesh_faces_ps_ back with the other edit mesh passes
Partially reverts 5f24c61225.
This part was not required.
2025-01-21 17:44:49 +01:00
Miguel Pozo
71c889d283 Fix: Selection-Next: Material asset drag&drop slot selection
The user code expects a single hit result when SELECT_PICK_NEAREST
is used.

Note there's still an issue causing the picking to be slightly offset.

Pull Request: https://projects.blender.org/blender/blender/pulls/133382
2025-01-21 17:34:12 +01:00
Jacques Lucke
74fff8623f Nodes: support input socket usage inferencing for Mix and Mix Shader node
This builds on top of 80441190c6 to gray output
unused inputs of the Mix and Mix Shader node. These nodes have unused inputs if
their mix factor is 0 or 1 (+ some special cases for non-uniform vector mixing
and blend modes).

Pull Request: https://projects.blender.org/blender/blender/pulls/133369
2025-01-21 17:22:12 +01:00
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