Commit Graph

149409 Commits

Author SHA1 Message Date
YimingWu
2d1904d957 Fix #138439: Eraser/stabilizer brush cursor drawing correction
Correct small Eraser/stabilizer brush cursor drawing issues introduced
by typos in 7d97ba4c5f.

Pull Request: https://projects.blender.org/blender/blender/pulls/138443
2025-05-06 09:32:02 +02:00
Jacques Lucke
6ba9d4b21f Nodes: take the viewer node label into account in context path
Previously, only the node name was taken into account. However, this
is not practical, because the user usually renames the label instead of the
name and it makes sense to show the user-defined name in the context path.
2025-05-06 08:55:53 +02:00
Jacques Lucke
4469f850fe Fix: Nodes: missing viewer path name update
Previously, when the viewer node or node group name changes,
the change was not updated directly in the spreadsheet. It was
only updated later when the viewer path changed entirely.
2025-05-06 08:55:53 +02:00
Jacques Lucke
a7cce5abde Fix: Nodes: bring back node group name in viewer path
This worked in e.g. Blender 4.0 but was broken at some point accidentally.
Now, the context path in the spreadsheet contains the names of node
groups again.
2025-05-06 08:55:52 +02:00
Guillermo Venegas
4845ae8bf2 Refactor: UI: Replace uiLayoutPanel with class method uiLayout::panel
This converts the public `uiLayoutPanel` function to an object oriented
API (`uiLayout::panel`), matching the python API.
This reduces the difference between the C++ API with the python version,
its also helps while converting code from python to C++ code (or vice-versa),
making it almost seamless.

Pull Request: https://projects.blender.org/blender/blender/pulls/138461
2025-05-06 07:58:02 +02:00
Campbell Barton
7ab348bf06 Fix: low UV opacity hides UV selection in edge-select mode
In vertex & face modes the selection remained visible when the UV
opacity was zero (or near zero).

In those cases applying the opacity to the edge selection makes sense,
however in edge-select mode this caused UV's to become invisible.
2025-05-06 04:22:00 +00:00
Campbell Barton
4f18c5e389 Cleanup: naming for MeshUVs members
- Use "select_{vert/edge/face}_" convention for UV's
  matching edit-mesh naming.
- Rename `show_face_` to `show_face_overlay_` for 3D & UV views.
- Rename `show_face_dots_` to `select_face_dots_` since they're
  they display selection and aren't used in object mode.
2025-05-06 04:00:37 +00:00
Campbell Barton
490ab44e47 Cleanup: split private member for showing faces into two values
The same value was used to show selected UV faces & object mode face
overlays. This made logic a little more difficult to follow as the
same value was set & used differently based on the context.
2025-05-06 13:49:38 +10:00
Campbell Barton
429399fc1a Cleanup: use underscore suffix for private member in MeshUVs 2025-05-06 13:49:03 +10:00
Richard Antalik
6dcd732555 Fix #138321: Movieclip strip does not blend with background
Movieclip can output buffer with smaller resolution than scene
resolution, but this was not handled in `strip_raw_image_size_get()`.

Small downside of this change is, that if movieclip source file can not
be read, its width and height is initialized to `IMG_SIZE_FALLBACK`.
So this may be confusing to users, but this would be quite rare
scenario.

Pull Request: https://projects.blender.org/blender/blender/pulls/138352
2025-05-06 05:25:51 +02:00
Richard Antalik
4a11be2656 VSE: Add option to translate pivot point
This feature allows you to change postion of origin/pivot for images
without changing their position.

It is implemented as property of transform operator. It is activated
by pressing `Ctrl + .` shortcut.
Move Origin item was also added to transform menu.

Origin can be snapped to 3x3 grid on strip image. This represents
most usual anchor points.

Ref: #134251
Pull Request: https://projects.blender.org/blender/blender/pulls/134206
2025-05-06 05:16:56 +02:00
Campbell Barton
509b39f90e UV: support sticky modes when edge sync-select is enabled
Previously sync-select in edge-select mode behaved in much the same
way as vertex selection, since a selected edge could cause a vertex
on an a disconnected UV island to be selected.

Now single vertices are no longer considered selected when the
Sticky-Mode is set to "Location" (the default).

Notes on changes when sync-select is enabled:

- The main change from a user perspective is edge & face select modes
  show the selected edges.

- This resolves a problem in edge & face selection modes where it wasn't
  possible to differentiate between a selected edge and two selected
  vertices on either side of an unselected edge.
2025-05-06 02:59:40 +00:00
Jacques Lucke
1363319844 Geometry Nodes: add Import VDB node
This adds an Import VDB node. It loads all the grids from a .vdb file and hence
outputs a Volume geometry instead of an individual grid.

The grids are cached through the existing volume grid file cache, so they are
automatically deduplicated when volume grids are loaded from files in other
ways.

Pull Request: https://projects.blender.org/blender/blender/pulls/138380
2025-05-06 04:13:11 +02:00
Jacques Lucke
0553f96bec Fix: Nodes: missing node tree centering
When a new node tree becomes active based on the context, the node editor was
not centered on the new tree. This can easily lead to the situation where there
is no node visible, and the user first has to search for the nodes.

The reason for this is unexpectedly special:
* `snode_set_context` calls `ED_node_tree_start` which adds the `NC_SCENE |
  ND_NODES` notifier.
* Typically, this would update the `View2D` of the region in
  `node_area_listener`.
* However, `snode_set_context` is called from
  `wm_event_do_refresh_wm_and_depsgraph` which happens after(!) the listeners
  run. Therefore, the node editor is redrawn before the listener is handled.
* During redraw, the stored view center is overridden. When it is later used in
  the listener, the value is lost already.

This patch solves this by updating the view center eagerly when opening changing
what node tree is visible, instead of trying to it lazily where the required
information might be lost already.

Pull Request: https://projects.blender.org/blender/blender/pulls/138389
2025-05-06 04:12:03 +02:00
Campbell Barton
01d9b7b095 Cleanup: improve naming, simplify logic for UV face-dot check
Avoid setting non-sync-select values then overwriting with sync-select
as it makes the logic less straightforward.
2025-05-06 01:55:15 +00:00
Campbell Barton
7827286620 Fix: UV face-dots not showing in face select mode
Regression in [0] which missed a rename.

[0]: 3f11d16501
2025-05-06 11:47:30 +10:00
Sean Kim
fd8728c596 Cleanup: Reorganize eUnifiedPaintSettingsFlags
Pull Request: https://projects.blender.org/blender/blender/pulls/138468
2025-05-06 03:42:14 +02:00
Sean Kim
9747e9072d Cleanup: Move dyntopo brush check macro to method
Pull Request: https://projects.blender.org/blender/blender/pulls/138470
2025-05-06 03:36:39 +02:00
Campbell Barton
fd6ac498b0 Cleanup: spelling in comments, strings (make check_spelling_*)
Also replace some triple-quoted non-doc-string strings with commented
blocks in examples.
2025-05-06 00:18:39 +00:00
Sean Kim
b47332c40d Fix: brush.asset_edit_metadata truncates author and description
Both fields have the RNA value defined with a max size of `MAX_NAME`,
despite the underlying DNA value being a dynamic length string.

To fix this, remove the length restriction for the operator.

Pull Request: https://projects.blender.org/blender/blender/pulls/138377
2025-05-05 21:19:31 +02:00
Miguel Pozo
7aeadd397d Workbench: Lazy subpasses initialization
Avoid initializing supbasses (and requesting their shaders) unless
they're actually needed.
Reduces the number of compiled Workbench shaders at startup
from 27 to 9.
Improves startup times.

Pull Request: https://projects.blender.org/blender/blender/pulls/138456
2025-05-05 20:24:16 +02:00
Aras Pranckevicius
aad7b2390b FBX: Speedup new importer
1. Do most of the work in creating meshes in parallel (i.e. everything that
   can happen on the non-Main mesh object)
2. Faster creation of transform F-Curves using the same machinery as
   !137004 (mostly speeds up animated characters import)
3. Make ufbx do FBX file parsing itself in parallel

Generally makes import 2x-5x faster, more detailed timings in the PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/138367
2025-05-05 19:55:55 +02:00
Jesse Yurkovich
0a3e4b0fd4 Fix #138365: Define and use 'use_filter_orderby_invert' for UIList example
The property in question was undefined since the first commit[1]

[1] b7e2cd5948

Pull Request: https://projects.blender.org/blender/blender/pulls/138373
2025-05-05 19:40:59 +02:00
Jacques Lucke
1b61e419a6 Geometry Nodes: support caching imported files
Currently, the import nodes always reimport on each evaluation. This patch adds
support for caching the loaded geometries. This is integrated with
`BLI_memory_cache.hh` and thus also takes the cache size limit into account. If
an imported file is modified on disk, the cache is invalidated. However,
Geometry Nodes will not automatically reevaluate when a file changes, so the
user would have to trigger the evaluation in some other way.

This is an alternative solution to #124369. The main benefits are that the cache
invalidation happens automatically and that the cache system is more general and
does not have to know about e.g. the different file types.

Caching speeds up node setups that heavily rely on import nodes significantly.

Pull Request: https://projects.blender.org/blender/blender/pulls/138425
2025-05-05 19:25:05 +02:00
YimingWu
3cd15d70b2 Fix #138398: Physics: Re-init rbw->shared->runtime loading old files
`RigidBodyWorld_Shared::runtime` is always expected to be valid. This
fix does this versioning for old files.

Pull Request: https://projects.blender.org/blender/blender/pulls/138418
2025-05-05 19:18:32 +02:00
Hans Goudey
c108d7bfd4 Cleanup: Missing include for integer type in BLI_generic_key.hh 2025-05-05 12:41:36 -04:00
Jacques Lucke
e09ccc9b35 Core: add templated version of BKE_id_new_nomain to reduce explicit casting
This adds a version of `BKE_id_new_nomain` that takes the ID type parameter as
template argument. This allows the function the return the newly created ID with
the correct type, removing the need to use `static_cast` on the call-site.

To make this work, I added a static `id_type` member to every ID struct. This
can also be used to create a similar API for other id management functions in
future patches.

```cpp
// Old
Mesh *mesh = static_cast<Mesh *>(BKE_id_new_nomain(ID_ME, "Mesh"));

// New
Mesh *mesh = BKE_id_new_nomain<Mesh>("Mesh");
```

Pull Request: https://projects.blender.org/blender/blender/pulls/138383
2025-05-05 18:41:03 +02:00
Clément Foucault
dd52130f92 Fix: Vulkan: Broken shader compilation
Was missing a newline after the shader stage define.
2025-05-05 18:38:37 +02:00
Weizhen Huang
64dc9cc98c Fix: Cycles: Inconsistency in transparent bounces for NEE and forward path
Note: this is a partial fix, that makes NEE and forward path consistent
only when `max_transparent_bounce > 0`. It is much more involved to make
forward path tracing support a max transparent bounce of 0, but since we
don't expect people to set up a very low number of transparent bounces,
it is less important to support that specific case.

Pull Request: https://projects.blender.org/blender/blender/pulls/138098
2025-05-05 18:38:02 +02:00
Weizhen Huang
3021d34b8c Cleanup: remove unused volume_shadow_homogeneous() function
Pull Request: https://projects.blender.org/blender/blender/pulls/138342
2025-05-05 18:37:19 +02:00
Weizhen Huang
1f01a1aee9 Cleanup: remove unnecessary defined(__KERNEL_METAL__)
The top level guard is already `#ifndef __KERNEL_METAL__`, additional
guard is not only unnecessary but also confusing.
2025-05-05 18:35:24 +02:00
Weizhen Huang
1e394f7973 Cleanup: Cycles: Fix typo 2025-05-05 18:35:24 +02:00
Weizhen Huang
69c194ee5a Cleanup: Cycles: safer division in volume sample channel 2025-05-05 18:35:24 +02:00
Weizhen Huang
4e36a31871 Cleanup: Cycles: split volume_sample_channel() into two functions 2025-05-05 18:35:24 +02:00
Weizhen Huang
157979167b Fix: correct path for overlay test 2025-05-05 18:34:28 +02:00
Jacques Lucke
20a6956079 Nodes: support searching for dynamic node labels
Previously, the ctrl+F search was only searching for either node names or explicitly
labeled nodes. Now it takes dynamic labels like node group nodes into account
making it much more useful.

Pull Request: https://projects.blender.org/blender/blender/pulls/138427
2025-05-05 18:09:22 +02:00
Sergey Sharybin
9477fa4eb0 Migrate existing files to Git LFS
The files that were binary and were committed prior to the
Git LFS configuration in the main repository.

override restrictions

Pull Request: https://projects.blender.org/blender/blender/pulls/138452
2025-05-05 17:18:42 +02:00
Sergey Sharybin
617d79be76 Fix: maker test was checking for the old test files location
There is no need to do this anymore, as the files are expected to
always be there.
2025-05-05 16:52:55 +02:00
Sergey Sharybin
dc8c64f451 Cleanup: Unneeded empty line
Left over from debugging.
2025-05-05 16:24:46 +02:00
Sergey Sharybin
c39266f728 Adjust .gitattributes
Make release/bin/blender-launcher and release/bin/blender-softwaregl not
covered by the filters.

Also tweak the filter for .so libraries, making it so doc/doxygen/doxygen.source.h
is not considered to be covered.
2025-05-05 16:24:24 +02:00
Brecht Van Lommel
dfccf9510d Build: Auto add Git LFS fallback remote in "make update"
For the official GitHub mirror and other repositories that do not include LFS
files, this adds an `lfs-fallback` remote. It will be used automatically if a
file can't be found on the regular remote.

Ref #137215

Co-authored-by: Sergey Sharybin <sergey@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/137615
2025-05-05 15:33:53 +02:00
Clément Foucault
f844ed7869 GPU: Shader Preprocess: Processing time optimizations
Guarding expensive regex computation by much
cheaper checks to reduce compilation time.

Compiling `time ninja -j 1 bf_draw_shaders`

On MacOS M1 Max (debug build with glsl_preprocess optimization turned on):
Before 13.01 sec
After  9.08 sec

Pull Request: https://projects.blender.org/blender/blender/pulls/138336
2025-05-05 15:14:16 +02:00
Sergey Sharybin
bbfc97ad6f Move tests/data and assets to the main repository
This change moves the tests data files and publish folder of assets
repository to the main blender.git repository as LFS files.

The goal of this change is to eliminate toil of modifying tests,
cherry-picking changes to LFS branches, adding tests as part of a
PR which brings new features or fixes.

More detailed explanation and conversation can be found in the
design task.

Ref #137215

Pull Request: https://projects.blender.org/blender/blender/pulls/137219
2025-05-05 15:10:22 +02:00
Omar Emara
1f51172692 Compositor: Turn Alpha Over options to inputs
This patch turns the options of the Alpha Over node into inputs.

In the process, Convert Premultiplied option was renamed to Straight
Alpha.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/138441
2025-05-05 14:16:27 +02:00
YimingWu
787f7272ae Fix #138439: Annotation: Correct immVertex when drawing stabilizer
the float/int version of `immVertex` can not be mixed in one
`immBegin/End` block. This fix corrects the usage and prevent invalid
int values from passing into the batch.

Pull Request: https://projects.blender.org/blender/blender/pulls/138442
2025-05-05 13:45:36 +02:00
Clément Foucault
7aef8c2917 GPU: Shader Preprocess: Add utility to search for references
This utility will only match `&` character inside a
reference declaration. This is needed for speeding up the
regex matches.
2025-05-05 13:42:42 +02:00
Clément Foucault
74e6d2c575 GPU: Shader: Add support for basic loop unrolling through preprocessor
This adds basic unrolling support for 2 syntax:
- `[[gpu::unroll]]` which does full loop unrolling
- `[[gpu::unroll(x)]]` which unrolls `x` iteration

Nesting is supported.

This change is motivated by the added cost in compilation
and execution time that some loops have even if they have
compile time defined iteration counts.

The syntax is inspired by `GL_EXT_control_flow_attributes`.
However, we might want to have our own prefix to show it is
a blender specific feature and that it differs from the standard.
I propose `[[gpu::unroll]]`.

In the future, we could extend this to support more directives that
can be expanded to backend specific extension / syntax. This would
avoid readability issue an error prone copy paste of large amount
of preprocessor directives.

Currently, given that GL's GLSL flavor doesn't support
any of these attributes, the preprocessor does some copy-pasting
that does the unrolling at the source level. Note that the added
`#line` allow for correct error logging.

For the `[[gpu::unroll]]` syntax, the `for` declaration
needs to follow a specific syntax to deduce the number
of loop iteration.
This variant removes the continue condition between iteration,
so all iterations are evaluated. This could be modified
using a special keyword.

For the `[[gpu::unroll(n)]]` syntax, the usercode needs
to make sure that `n` is large enough to cover all iterations
as the loop is completely removed.
We could add shader `assert` to make sure that there is
never a remaining iteration.
This behavior is usually different from what you see in other
implementation as we do not keep a loop at all. Usually, compilers
still keep the loop if it is not unrolled fully. But given we don't
have IR, this is the best we can do.

`break` and `continue` statement are forbidden at the unrolled loop
scope level. Nested loop and switch can contain these keywords.
This is accounted for by checks in the pre-processor.

Only `for` loops are supported for now. There are no real
incentive to add support for `while` given how rare it is
in the shader codebase.

Rel #137446

Pull Request: https://projects.blender.org/blender/blender/pulls/137444
2025-05-05 13:37:51 +02:00
Jacques Lucke
c271c3b291 Fix: ID code not should not be passed as part of name
Found in #138383.
2025-05-05 11:47:42 +02:00
Bastien Montagne
d653499991 I18N: Updated UI translations from git/weblate repository (a2fbba96fa53376). 2025-05-05 11:37:52 +02:00
YimingWu
e441095edb Fix #137918: LineArt: Prevent invalidating the wrong cache
When baking multiple line art modifiers at once, line art can pick the
wrong cache data and free it before all modifiers have finished baking.
This fix corrected that logic so that when baking all line art, it will
always use/create/free the correct cache data.

Pull Request: https://projects.blender.org/blender/blender/pulls/138114
2025-05-05 11:03:58 +02:00