Commit Graph

150077 Commits

Author SHA1 Message Date
Jeroen Bakker
542e7bb8e7 Compositor: Add GPU debug groups
This PR adds debug groups to improve using GPU tools like debuggers
and profilers. It will try to use the node type as debug group name when
available.

Pull Request: https://projects.blender.org/blender/blender/pulls/138768
2025-05-12 15:45:45 +02:00
YimingWu
f091195480 Fix: Grease Pencil: Prevent infinite drawing when doing separate pass
Previously if a scene has Grease Pencil objects that are drawn in-front
and objects that are not, Grease Pencil drawing sorting call would
concat those two drawing lists into one. Since "separate pass" rendering
will call Grease Pencil drawing again, this list was concatenated twice,
resulting in a looped list which goes on indefinitely when iterated.
Now Grease Pencil will only sort once per drawing instance.

Thanks to @antonioya and @mmendio for testing and reporting!

Pull Request: https://projects.blender.org/blender/blender/pulls/138528
2025-05-12 15:41:15 +02:00
Jeroen Bakker
624b52efdd Vulkan: Add debug info for pipeline caches 2025-05-12 15:00:51 +02:00
Hans Goudey
51ed527ab9 Fix #138718: Node tools crash on mesh with vertex groups
Caused by 0b891a68b1.
That commit didn't handle vertex groups correctly. They're provided by
the attribute API as "virtual" attributes that aren't backed by
individual custom data layers like "real" generic attributes, so they
don't have sharing info. Hopefully in the future this situation will be
improved, but in the meantime it's best to just just handle them more
explicitly.

Pull Request: https://projects.blender.org/blender/blender/pulls/138719
2025-05-12 14:56:51 +02:00
Jacques Lucke
f7c890e32f Cleanup: Nodes: remove stored static sdna type
Since 9fd7a093c9 this id can be derived automatically from the corresponding C++ type.

Pull Request: https://projects.blender.org/blender/blender/pulls/138760
2025-05-12 13:55:09 +02:00
Lukas Tönne
11ceddb9df New Grid Info node for reading grid transforms and background value
These are generic properties of grids (not stored in voxels) which are
useful to know in geometry nodes. The transform in particular defines
the voxel size. Background value is used outside of active voxels.

Pull Request: https://projects.blender.org/blender/blender/pulls/138592
2025-05-12 13:46:40 +02:00
Jeroen Bakker
800e2cdde1 Refactor: Vulkan: Use hash function
Specialization constants hash used get_default_hash. This replaces it
with a regular hash function.

Pull Request: https://projects.blender.org/blender/blender/pulls/138766
2025-05-12 13:33:50 +02:00
Omar Emara
17db65dfd0 Compositor: Remove Gamma from Blur and Defocus nodes
This patch removes the Gamma option from the Defocus and Blur nodes. The
reasoning is as follows.

- The option was originally added when the compositor wasn't working on
  a strictly linear workflow. So this is rarely needed now.
- It is easy to insert a Gamma node around Blur nodes to perform any
  gamma correction if really needed.
- Since we are moving options to inputs, it doesn't seem worth it to
  provide this option as an input in the process.

Pull Request: https://projects.blender.org/blender/blender/pulls/138673
2025-05-12 13:18:46 +02:00
Omar Emara
c33c93f886 Compositor: Use node discovery for node registration
This patch uses the add_node_discovery node registration mechanism
already used by Geometry and Function nodes. This is done to reduce the
number of places needed to add a new node.

Pull Request: https://projects.blender.org/blender/blender/pulls/138755
2025-05-12 12:50:38 +02:00
Philipp Oeser
df98fbe91b Fix #138613: Template Paths not resolved when using ALT+Click in Output
To resolve, add path template handling to `BUTTONS_OT_file_browse` /
`BUTTONS_OT_directory_browse`.

Pull Request: https://projects.blender.org/blender/blender/pulls/138674
2025-05-12 12:47:49 +02:00
Jacques Lucke
bdfa4b556b Git: use lfs for csv files
This is useful when adding regression tests for the Import CSV node.

Pull Request: https://projects.blender.org/blender/blender/pulls/138726
2025-05-12 11:34:32 +02:00
Philipp Oeser
e7b630e6ef Fix #138669: Face dots visible outside Clipped Region
Was missing call to `view_clipping_distances`

Pull Request: https://projects.blender.org/blender/blender/pulls/138672
2025-05-12 11:19:19 +02:00
Jacques Lucke
9fd7a093c9 DNA: support getting sdna id for static DNA type
This adds a new `DNA_sdna_type_ids.hh` header:
```cpp
namespace blender::dna {

/**
 * Each DNA struct has an integer identifier which is unique within a specific
 * Blender build, but not necessarily across different builds. The identifier
 * can be used to index into `SDNA.structs`.
 */
template<typename T> int sdna_struct_id_get();

/**
 * The maximum identifier that will be returned by #sdna_struct_id_get in this
 * Blender build.
 */
int sdna_struct_id_get_max();

}  // namespace blender::dna
```

The `sdna_struct_id_get` function is used as replacement of
`SDNA_TYPE_FROM_STRUCT` in all places except the DNA defaults system. The
defaults system is C code and therefore can't use the template. There is ongoing
work to replace the defaults system as well though: #134531.

Using this templated function has some benefits over the old approach:
* No need to rely on macros.
* Can use type inferencing in functions like `BLO_write_struct` which avoids
  redundancy on the call site. E.g. `BLO_write_struct(writer, ActionStrip,
  strip);` can become `BLO_write_struct(writer, strip);` which could even become
  `writer.write_struct(strip);`. None of that is implemented as part of this
  patch though.
* No need to include the generated `dna_type_offsets.h` file which contains a
  huge enum.

Implementation wise, this is done using explicit template instantiations in a
new file generated by `makesdna.cc`: `dna_struct_ids.cc`. The generated file
looks like so:
```cpp
namespace blender::dna {

template<typename T> int sdna_struct_id_get();

int sdna_struct_id_get_max();
int sdna_struct_id_get_max() { return 951; }

}
struct IDPropertyUIData;
template<> int blender:🧬:sdna_struct_id_get<IDPropertyUIData>() { return 1; }
struct IDPropertyUIDataEnumItem;
template<> int blender:🧬:sdna_struct_id_get<IDPropertyUIDataEnumItem>() { return 2; }
```

I tried using static variables instead of separate functions, but I didn't
manage to link it properly. Not quite sure yet if that's an actual limitation or
if I was just missing something.

Pull Request: https://projects.blender.org/blender/blender/pulls/138706
2025-05-12 11:16:26 +02:00
Aras Pranckevicius
a96ecd2834 Fix #137768: new FBX importer does not import some animations correctly
- FBX "root bone" should become the Armature object itself, and not
  an extra bone (follow same logic as Python importer did).
- "World to armature matrix" was not correct for armatures that are
  parented under some other objects with transforms.
- Parenting imported meshes under an Armature was not taking into
  account that the mesh bind transform might not be the same as the
  current mesh node transform (i.e. was not setting "matrix parent
  inverse" to compensate like the Python importer did).
- The repro file in #137768 also exposed an issue that importing custom
  vertex normals was not working correctly in the new importer, when
  mesh is partially invalid (validation alters the mesh, custom normals
  have to be set afterwards).

Pull Request: https://projects.blender.org/blender/blender/pulls/138736
2025-05-12 10:56:07 +02:00
Christoph Lendenfeld
6a31554394 Anim: add extra poll checks to bone eyedropper
It was unclear when the bone eyedropper could be used
since it stayed active even though it would be impossible to pick something.

The limitation is that an armature has to be in pose or edit mode to pick from.
Since that is the case we can check in the poll function if the active
object is an armature and if that armature is either in pose or edit mode.

Follow up to: #138182

Pull Request: https://projects.blender.org/blender/blender/pulls/138498
2025-05-12 10:49:14 +02:00
Jeroen Bakker
e934792169 Fix #138032: Vulkan: Loading minimized windows on Windows/NVIDIA
Minimized windows have the resolution of 0,0. The surface supports
swapchains with this resolution, however it doesn't work and leads
to crashes and UBs.

This PR fixes this to use a minimum resolution of 1,1.

Pull Request: https://projects.blender.org/blender/blender/pulls/138750
2025-05-12 10:30:13 +02:00
Jacques Lucke
ddbd880fa9 Fix: Nodes: missing update after activating different group output 2025-05-12 04:37:52 +02:00
Ian Yoo
e0dc538854 Tests: Add non-rotation regression test for glare_simple_star filter
The current regression tests for the Glare Node cover most but not all
of the code. In this case, the simple_star test only tested for 45
degree rotation offset of the glare highlight.
This will add a simple_star_no_rotation.blend regression test and its
corresponding output_render png to cover the no offset case.

The function, line, and region coverage have improved by about ~9-10%

Pull Request: https://projects.blender.org/blender/blender/pulls/138587
2025-05-11 15:34:24 +02:00
Philipp Oeser
9077a26ba2 Fix #138265: Ctrl+shift+left click to Preview socket inconsistency
There are two implementations:

- "Link to Viewer Node"
-- when clicking on a socket directly, link from that socket [done by
first selecting and then taking that selection state into account]
-- otherwise cycles through available sockets
- "Connect to Output" [python operator, made core from Node Wrangler]
-- does not take socket selection into account
-- only cycles through available sockets

So goal is to replicate behavior of "Link to Viewer Node" in "Connect to
Output" in terms of "which socket to link from"

This is done by
- exposing a sockets select state to python
- tweaking the call to bpy.ops.node.select so it does socket selection
as well
- take that selection into account

Pull Request: https://projects.blender.org/blender/blender/pulls/138323
2025-05-11 09:52:16 +02:00
Campbell Barton
e51b4d5aa7 Cleanup: quiet GCC warnings mixing enum/non-enum types 2025-05-11 17:12:23 +10:00
Campbell Barton
5e75a9c1e8 Cleanup: spelling in comments 2025-05-11 17:00:47 +10:00
Jacques Lucke
127719fc87 Refactor: Nodes: decentralize detecting internal links
Previously, nodes which had their own special internal-links-behavior were
hardcoded in node tree update code. Now that is decentralized so that more nodes
can use this functionality without leaking special cases into general code.

Pull Request: https://projects.blender.org/blender/blender/pulls/138712
2025-05-11 05:23:43 +02:00
Jacques Lucke
19bfe03e54 Geometry Nodes: don't show error when using relative path in Import Nodes
Relative paths are supported, but the string input was showing an error.
This patch removes the error by tagging the string input as supporting relative files.
This feature was introduced recently in ab20edf469.

Pull Request: https://projects.blender.org/blender/blender/pulls/138707
2025-05-11 05:22:06 +02:00
Jacques Lucke
691a2be7f0 Nodes: improve frame label position
This changes two things:
* Take zone bounding box into account when computing frame dimensions.
* Move the label up a bit as it was too low before.

Pull Request: https://projects.blender.org/blender/blender/pulls/138705
2025-05-11 05:20:25 +02:00
Pratik Borhade
542f62f2c9 Fix: Outliner: Show NLA track count
Found this while reviewing !126839.
Right now icon is drawn for every nla track when collapsed. Similar to
other tree-elements, display total count of nla tracks.

Pull Request: https://projects.blender.org/blender/blender/pulls/138655
2025-05-11 03:37:19 +02:00
Harley Acheson
b2c4d71f1d Fix: Allow Duplication of Minimized Outliner
For as long back as I have tested (2.91) using "Duplicate Area into New
Window" for Outliner when minimized (showing only header) will result
in an invalid area - at least on Windows. The area may have have a
black background, invalid screen area verts, and has the header on the
bottom. This is because it is created in a window that is our minimum
size but initialized smaller, at the height of the area (0-2 pixels).
This PR just adds a small minimum to our blender window creation.

Pull Request: https://projects.blender.org/blender/blender/pulls/138696
2025-05-10 17:38:27 +02:00
Jacques Lucke
42431dcdd0 Cleanup: Nodes: remove unused group_update_func
Pull Request: https://projects.blender.org/blender/blender/pulls/138702
2025-05-10 08:37:17 +02:00
Jesse Yurkovich
2b4eb5ccfd Fix: USD: Don't attempt to export the special sharp_face attribute
While it hasn't seemed to affect anything currently, it's unnecessarily
wasteful in the resulting file and risky to be importing back in.

Pull Request: https://projects.blender.org/blender/blender/pulls/138699
2025-05-10 08:08:16 +02:00
Jacques Lucke
18365a88bd Geometry Nodes: initial Import node regression tests
This adds some basic tests for the Import OBJ/STL/PLY nodes.

Pull Request: https://projects.blender.org/blender/blender/pulls/138700
2025-05-10 07:24:33 +02:00
Jacques Lucke
4de3172058 Nodes: support search weight in menu for searchable enum 2025-05-10 06:28:59 +02:00
Jacques Lucke
be489aa71a Cleanup: use C++ type for TransCustomDataNode 2025-05-10 05:03:59 +02:00
Jacques Lucke
bf696320f6 UI: support detecting good width for searchbox
Sometimes, the default size of the search box is not wide enough for the items
it shows. Currently, we sometimes hardcode an extra width factor and rely on
automatic name shortening with `...`. Both options are not ideal because they
are either often too wide or are hard to read with shortened names.

This patch implements an alternative solution. It adds a new function that
computes a good width for the search box based on its content. A certain minimum
and maximum width are still enforced.

Right now, this feature is only used in the Ctrl+F search in node editors, but I
guess it makes sense in most search boxes.

This also fixes #138641. While it's nice to have ways to use shorter search
terms, the search box should generally be able to deal with long items too.

Pull Request: https://projects.blender.org/blender/blender/pulls/138653
2025-05-10 04:48:30 +02:00
Hans Goudey
d68cd0c1fe Refactor: Use attribute API to convert between mesh and point cloud
Besides not using CustomData directly which allows future changes,
this should result in proper conversion of vertex groups to generic
point cloud attributes.
2025-05-09 22:47:26 -04:00
Jacques Lucke
1e23f9235c Nodes: highlight frame that nodes will be attached to
Previously, it was somewhat difficult to know if a dragged node will be attached
to a frame or not. This patch highlights the frame that dragged nodes will be
attached to which removes the guesswork. This is similar to how we highlight the
link that a dragged node will be inserted onto.

Pull Request: https://projects.blender.org/blender/blender/pulls/138648
2025-05-10 04:44:23 +02:00
Hans Goudey
4c1ae9454a Point Cloud: Simplify creating data-block without attributes
Remove the addition of the position attribute from the default
"init data" callback where we don't know the desired number
of points. Add it in the other functions that add the data-block
(except the version that purposefully doesn't add attributes).

Pull Request: https://projects.blender.org/blender/blender/pulls/138697
2025-05-10 04:37:43 +02:00
Jacques Lucke
99a2589217 Nodes: use alternating frame colors
Previously, nested frames were very hard to see and therefore to work with. This
patch solves this by alternating between two different frame colors depending on
the nesting depth.

Custom colors can still be used like before. There is still a single theme
option. The alternating color is derived from that.

Pull Request: https://projects.blender.org/blender/blender/pulls/138649
2025-05-10 04:37:21 +02:00
Guillermo Venegas
858abf43c3 Refactor: UI: Replace uiItemFullR with class method uiLayout::prop
This converts the public `uiItemFullR` function to an object oriented
API (an overload of `uiLayout::prop`), 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.

Part of: #117604

Pull Request: https://projects.blender.org/blender/blender/pulls/138683
2025-05-10 03:39:31 +02:00
Harley Acheson
c9e7136161 UI: Turn Off Ability to Drag Properties NavBar Away
The Properties NavBar region can be resized by dragging an edge, but
this only allows either normal width or hidden. The edge is along the
line of category tabs and it is extremely easy to hide the region
rather than select a tab. This PR remove the ability to drag the edge,
but adds a "Hide" option to the region's context menu. It also leaves
the triangular disclosure widget visible while hidden so that it can
be shown again.

Pull Request: https://projects.blender.org/blender/blender/pulls/138628
2025-05-10 02:53:56 +02:00
Harley Acheson
836247a146 UI: Allow Disabling Ortho Axes Lines
While in 3D View Perspective Mode you are able to disable the Floor
and/or the XYZ axis lines. But in Orthographic views turning off the
axes lines has no effect, but turning off the grid also turns off the
lines. This PR just makes these work independently, as you'd expect
from the options in Viewport Overlays.

Pull Request: https://projects.blender.org/blender/blender/pulls/138694
2025-05-10 02:34:23 +02:00
Hans Goudey
578df47c8d Refactor: Avoid using CustomData directly for PointCloud RNA
Part of #122398.

Pull Request: https://projects.blender.org/blender/blender/pulls/138686
2025-05-10 02:24:42 +02:00
Hans Goudey
8ac48880e7 Point Cloud: Move "Random" default primitive creation to operator
Previously all new point clouds created in the main database would
have the random 400 points. Now that's only the point cloud created
from the add menu.

Similar to f98d74c80d.

Pull Request: https://projects.blender.org/blender/blender/pulls/138685
2025-05-10 02:24:18 +02:00
Sergey Sharybin
cd70b9d730 Fix #138637: EXR Sequencer preview is broken
The issue was caused by the shader always applying exposure even if
it is 1. When the input image had negative values this lead to nan
values to the input of the shader which converts to the display
space.

Solved by only doing to-scene-linear transform in the shader which
does this.

Caused by 18110744a2

Pull Request: https://projects.blender.org/blender/blender/pulls/138666
2025-05-09 23:20:35 +02:00
Harley Acheson
2d72475d62 Fix #138661: Ensure Correct SubType After Stacked Fullscreen
Going from fullscreen to temporary fullscreen (usually file browser),
and back, is AREA_FLAG_STACKED_FULLSCREEN. In this case we need to
ensure that we restore the last-used area subtype and not just the zero
base type.

Pull Request: https://projects.blender.org/blender/blender/pulls/138682
2025-05-09 20:51:38 +02:00
Brecht Van Lommel
5697918905 Cleanup: Compiler warning 2025-05-09 19:10:14 +02:00
Habib Gahbiche
58ebe99d9d Fix: Compositor: Incorrect viewer is activated
In some cases, multiple viewers can be active and the active viewer is
not the desired one. This is only a problem for the compositor

The fix has two parts:
1. Tag the node tree as changed after the output changes. This solves
 the issue of two viewers being active at the same time
2. Deactivate all other viewers before activating the desired viewer
node (similar to how `NODE_OT_activate_viewer()` works). This ensures
that the only active viewer is the one that the user just set.

Pull Request: https://projects.blender.org/blender/blender/pulls/138671
2025-05-09 18:07:05 +02:00
Hans Goudey
bb8719030d Geometry: Initial replacement of CustomData with AttributeStorage
As described in #122398, implement read and write support for a new
attribute storage system. Currently this is only implemented to support
forward compatibility; the format used at runtime isn't changed at all.
That can be done one step at a time during the 4.5 and 5.0 development
cycles. A new experimental option for testing tells Blender to always
save with the new format.

The main benefit of the new structure is that it matches the attribute
system design, it allows for future attribute storage optimization, and
each attribute is an allocated struct, which will give pointer stability
for the Python API.

The next step is to connect the attribute API and the RNA API to
AttributeStorage for the simplest geometry type, point clouds.

Pull Request: https://projects.blender.org/blender/blender/pulls/133874
2025-05-09 17:27:07 +02:00
Francesco Siddi
6b471b8b75 Add funding manifest reference
This file is used to point to Blender's funding manifest hosted on
blender.org. This establishes provenance and verifies that that the
publisher of the manifest is authorised to solicit funding on behalf
of the URLs (entity, projects) described in the manifest.

This file is needed to participate in https://floss.fund/
(and potentially other funding initiatives).

Most of the fundraising info is hosted on blender.org/, but the format
requires a reference to the actual codebase. I think this is the least
intrusive way to achieve that.

In particular, the file is referenced by https://www.blender.org/funding.json

More info on the json file itself is available https://fundingjson.org/

Pull Request: https://projects.blender.org/blender/blender/pulls/138676
2025-05-09 17:12:12 +02:00
Sergey Sharybin
9d4b236d13 Fix: Class memory access on the color management tear-down
Pull Request: https://projects.blender.org/blender/blender/pulls/138670
2025-05-09 16:22:57 +02:00
Hans Goudey
1c21de6f77 Cleanup: Formatting 2025-05-09 10:14:44 -04:00
Jacques Lucke
d9b91c73e3 Core: use template for BKE_id_new
This is the same change as e09ccc9b35 but for `BKE_id_new`.

Pull Request: https://projects.blender.org/blender/blender/pulls/138667
2025-05-09 16:13:25 +02:00