Commit Graph

120055 Commits

Author SHA1 Message Date
Jacques Lucke
b1b831919a Cleanup: BLI: move CPPType asserts to implementation
This simplifies the header that's included in many places.
2025-04-17 17:51:33 +02:00
Pratik Borhade
603ea8ca89 Fix: Outliner: Grease Pencil layer visibility icons are grayed out
Current code is setting UI_BUT_INACTIVE when the parent group is
visible, rather than when invisible. This PR reverses that mistake.

Pull Request: https://projects.blender.org/blender/blender/pulls/137641
2025-04-17 17:42:42 +02:00
Hans Goudey
f19f260ca8 Nodes: Align inputs and outputs on some function nodes
Adjust 9 rotation and matrix nodes.
In some cases this helps to clarify the node's purpose.

Pull Request: https://projects.blender.org/blender/blender/pulls/137672
2025-04-17 17:17:19 +02:00
Omar Emara
24379b8243 Compositor: Turn Denoise node options into inputs
This patch turns the options of the Denoise node into inputs.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/137669
2025-04-17 16:39:11 +02:00
Hans Goudey
134ba08bdf Geometry Nodes: Align inputs and outputs on three nodes
- Scale Elements
- Scale Instances
- Set Grease Pencil Color

These were missed in 7e4d50f1db
2025-04-17 10:11:03 -04:00
Jeroen Bakker
54f469ffa8 Cleanup: Vulkan: Remove unused flags
Removing unused flags when creating descriptor pools.
2025-04-17 15:34:52 +02:00
Hans Goudey
0852c7b5ee Fix #137600: Curve to points node anonymous attribute outputs broken
Mistake in fe52284be9.
The attribute filter created by the geoemtry nodes evaluation system
doesn't work in this case because the the conversion from curves to
points is internal to the node, just an implementation detail.

Pull Request: https://projects.blender.org/blender/blender/pulls/137614
2025-04-17 14:35:24 +02:00
Jeroen Bakker
13d6ba1f62 Vulkan: Reduce memory overhead rendergraph
For performance reasons render graphs can keep memory allocated so it
could be reused. This PR optimizes the memory usage inside the
rendergraph to keep it within normal usage.

I didn't detect any performance regression with this change but reduces
the memory when performing final image rendering of heavy scenes.

Partial fix for #137382. the amount of memory still increases with 4mb
per render. It fixes the main difference when using large scenes.

Pull Request: https://projects.blender.org/blender/blender/pulls/137660
2025-04-17 13:45:47 +02:00
Cartesian Caramel
3d1b6f53f3 Geometry Nodes: new Instance Bounds Node
This adds a new Instance Bounds nodes which provides an easy and
efficient way to get the bounding box of each instance.

Nested instances or not taken into account to compute the bounding
box. That would result in a major performance degredation because
one would have to basically realize all instances to do that.

Also see #135933 for some examples.

Pull Request: https://projects.blender.org/blender/blender/pulls/135933
2025-04-17 13:34:26 +02:00
Omar Emara
96761b8df2 Compositor: Turn Despeckle node options into inputs
This patch turns the options of the Despeckle node into inputs.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/137656
2025-04-17 13:21:36 +02:00
Omar Emara
520afd8998 Fix #137654: Cryptomatte only works with first layer
The Cryptomatte node only works with the first view layer in a setup
where a view later is called ViewLayer and another called ViewLayer.001.
This is because the code used a prefix check to match the view layer to
the Cryptomatte type name, and since ViewLayer is a prefix of the other
ViewLayer.001, the check always matches the first ViewLayer.

To fix this, we just remove that guard condition and rely on later
checks.

Pull Request: https://projects.blender.org/blender/blender/pulls/137659
2025-04-17 13:15:34 +02:00
Jacques Lucke
f442c86197 Depsgraph: improve type safety when getting evaluated or original ID
The goal here is to avoid having to cast to and from `ID` when getting the
evaluated or original ID using the depsgraph API, which is often verbose and not
type safe. To solve this, there are now `DEG_get_original` and
`DEG_get_evaluated` methods which are templated on the type and use a new
`is_ID_v` static type check to make sure it's only used with valid types.

This allows removing quite some verbosity on all the call sites. I also removed
`DEG_get_original_object`, because that does not have to be a special case
anymore.

Pull Request: https://projects.blender.org/blender/blender/pulls/137629
2025-04-17 13:09:20 +02:00
Falk David
0a3015a771 Fix #137451: Crash after setting the curve types to bezier
The issue was that there were no handle positions but
`retrieve_visible_bezier_handle_points` still returned a mask
of bezier points.

The fix ensures that ther drawing has handle positions and returns
an empty mask otherwise.
This means that the code that draws the handles now correctly ignores
them when there are no handle positions available.

Pull Request: https://projects.blender.org/blender/blender/pulls/137655
2025-04-17 11:50:03 +02:00
Falk David
012425a0ee Cleanup: Grease Pencil: Anti-Aliasing sample code
Some smaller cleanups in the AA sample code.
2025-04-17 11:47:13 +02:00
Habib Gahbiche
40c8ce084b UI: Improve default position of shader nodes in startup file
This is a follow up to #136926.

Default values are changed for the existing materials of the default
cube and the default World.
2025-04-17 10:46:41 +02:00
Omar Emara
293e2ed833 Compositor: Turn Kuwahara node options into inputs
This patch turns the options of the Kuwahara node into inputs.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/137609
2025-04-17 10:23:24 +02:00
Campbell Barton
cc83a7dbef Cleanup: assign variables in edit-mesh picking
Avoid having to use `vc.em->bm` for each BMesh reference.
2025-04-17 16:16:28 +10:00
Campbell Barton
966f936541 Cleanup: re-order functions in ED_uvedit.hh 2025-04-17 15:04:05 +10:00
Harley Acheson
914d2e8164 UI: Reverse Pen Y Tilt Expected Direction
It is more convenient for math reasons, for Blender to treat a pen tilt
toward the user as a positive angle. This PR just reverses all the
comments about the expected values. And also reverses the values from
WinTab, Windows Ink, and Wayland to match.

Pull Request: https://projects.blender.org/blender/blender/pulls/137636
2025-04-17 04:26:58 +02:00
Jason C. Wenger
4e37bd8c65 Fix #70977: Dissolve can create duplicate faces
Prevent dissolve leaving duplicate faces when dissolving edges.

Also use the builtin reuse of duplicate faces provided by BM_face_join()
instead of doing it manually.

Ref: !137634
2025-04-17 12:14:49 +10:00
Campbell Barton
64f5dee6d7 Cleanup: spelling in comments (make check_spelling_*) 2025-04-17 12:06:12 +10:00
Richard Antalik
57c5228b86 Fix: VSE cache invalidates all strips
Caused by checking if strip frame index falls into a range instead of
timeline frame. This was introduced in 6a39d79967 and was incorrect
solution to the issue.

Cache key had `timeline_frame` field, which was removed, because it is
not updated when strip moves. The value is now calculated from frame
index.

The issue was not very noticable especially when working with larger
strips, but the behavior was incorrect and confused me when working on
cache related features.

Pull Request: https://projects.blender.org/blender/blender/pulls/137583
2025-04-17 02:36:49 +02:00
Richard Antalik
5b9b4661ec Fix #137541: Search in Properties Editor throwing errors
In bf18e8f814, `buttons_context_compute()` was moved "upstream" in code
path, as a de-duplication effort. But this wasn't correct, because
function `property_search_for_context()` was executed in a loop where
the tabs were iterated over.

This commit moves `property_search_for_context()` back where it was
before.

Pull Request: https://projects.blender.org/blender/blender/pulls/137576
2025-04-17 02:36:18 +02:00
Harley Acheson
101d8782f7 UI: Increase Contrast of Scroll Bar Thumb for Light Themes
Since 115d809358 the scroll bars are darker on light theme. But this
makes the circular "handles", in Timeline for example, to not be
visible. This is because we start with the item color and then make
it darker when over a threshold. But we never make them lighter when
they are dark. This PR makes these darker or lighter depending on the
base color.

Pull Request: https://projects.blender.org/blender/blender/pulls/137618
2025-04-17 01:29:06 +02:00
Hans Goudey
b52554b475 Cleanup: Simplify ID management in edit mesh undo
Currently this code uses the `Mesh` struct as a value embedded in the
undo step struct. This causes the need for various hacky workarounds and
abstraction leaks. It's simpler to just allocate it in the regular way
The Shape Key ID can also be freed with the regular ID free function,
avoiding the need to expose the internal free function.

Pull Request: https://projects.blender.org/blender/blender/pulls/137613
2025-04-17 01:09:23 +02:00
Clément Foucault
e9127fd57a Cleanup: Metal: DeDuplicate sources in Cmakefile 2025-04-17 01:04:33 +02:00
Clément Foucault
9d2c09ee2a Fix: Metal: Broken tests because of partial renaming 2025-04-17 01:03:46 +02:00
Sean Kim
c17d6d1893 Cleanup: Move most brush code to nested brushes namespace
Pull Request: https://projects.blender.org/blender/blender/pulls/137567
2025-04-16 23:57:01 +02:00
Jacques Lucke
a0444a5a2d Geometry Nodes: support viewers in closures
This adds support for having viewer nodes in closures. The code attempt to
detect where the closure is evaluated and shows the data from there.

If the closure is evaluated in multiple Evaluate Closure nodes, currently it
just picks the first one it finds. Support for more user control in this case
may be added a bit later. If the Evaluate Closure node is in e.g. the repeat or
foreach zone, it will automatically use the inspection index of that zone to
determine what evaluation to look at specifically.

Overall, not too much had to change conceptually to support viewers in closures.
Just some code like converting between viewer paths and compute contexts had to
be generalized a little bit.

Pull Request: https://projects.blender.org/blender/blender/pulls/137625
2025-04-16 23:35:59 +02:00
Clément Foucault
f2cfa822da Fix: DRW: Broken or non-deterministic tests
The test_draw_submit_only was broken because of the
empty pass optimization #135875. Making the passes
non-empty fixes the test.

`eevee_surfel_list` has non-deterministic result. This
should be investigated in the future.
2025-04-16 21:48:47 +02:00
Clément Foucault
0b2a178efc Fix: DRW: Uninitialized mutex in tests
Tests were calling the submission mutex without
init. Adding functions to expose only setting
up the submission mutex instead of the full
DRW context (which is uneeded here).
2025-04-16 21:38:19 +02:00
Clément Foucault
92496bbfaf Fix: DRW: Nullptr dereference in tests
This happens because there is no global context set
when running the draw tests. Removing the global
access fixes the issue.
2025-04-16 21:36:13 +02:00
Clément Foucault
70570e8571 Fix: GPU: Broken compilation on Mac 2025-04-16 21:34:18 +02:00
Clément Foucault
5bd572d4fd Cleanup: Overlay: Remove _next in overlay filename
These are not needed anymore since the legacy codebase
is gone.
2025-04-16 20:51:24 +02:00
Clément Foucault
2cc0dad451 Cleanup: Overlay: Remove overlay_private.hh and share uv line style enum 2025-04-16 20:46:14 +02:00
Clément Foucault
0f71bb6c71 GPU: Rename shader_shared.h files to .hh
This makes more sense now that everything is C++.
2025-04-16 20:26:48 +02:00
Clément Foucault
a6fa1b5969 DRW: Rename common_*_lib.glsl to follow module prefix 2025-04-16 20:19:09 +02:00
Clément Foucault
f2025f28e7 DRW: Move fullscreen vertex shader to gpu common
This makes no sense to have in the draw namespace.

Also take the opportunity for making the coordinates
a float2 and rename them to something more descriptive.
2025-04-16 20:09:28 +02:00
Hans Goudey
07333adc72 Cleanup: Make CustomData function private 2025-04-16 13:56:02 -04:00
Hans Goudey
63957cf541 Cleanup: Move CustomData_blend_write_prepare to proper section 2025-04-16 13:56:02 -04:00
Clément Foucault
6048a7a765 GPU: Preprocessor: Allow function argument to be references
Pull Request: https://projects.blender.org/blender/blender/pulls/137612
2025-04-16 19:42:27 +02:00
Clément Foucault
50dc6c0060 GPU: Preprocessor: Make source type extension convert to enum type
This allow to clearly define what type of preprocessing to
apply to which file type.
2025-04-16 19:41:51 +02:00
Clément Foucault
ac7e361f3d GPU: Expose preprocessor through API
This is needed to preprocess some source inside the
`intern` directory.
2025-04-16 18:50:10 +02:00
Habib Gahbiche
2d2de60655 UI: Compositor: use viewport icon to indicate active viewer
Viewer nodes in compositor now show the eye icon when they are active,
so after https://projects.blender.org/blender/blender/pulls/134949
both geometry nodes viewers and compositor viewers look the same.

The only remaining difference is that in geometry nodes, clicking on
the eye icon deactivates the viewer and the node tree output
is shown instead. This is not possible in the compositor currently,
because at least one viewer must be active in the node tree.

Pull Request: https://projects.blender.org/blender/blender/pulls/134417
2025-04-16 17:56:03 +02:00
Hans Goudey
ce8bfd6f8f Cleanup: Add comment with reasoning for edit mode object update tag 2025-04-16 11:53:02 -04:00
Pratik Borhade
7dea50e30d Fix #137466: Unable to assign shortcuts to 'weight' operators in Weightpaint Mode
Operators like smooth weights, or transfer weights are exposed in
weight mode. Their definition has `OBJECT_OT_*` prefix, this appends
shortcuts key on those operators to "object mode" keymap. Use
`WM_keymap_guess_from_context` instead. This will allow new shortcut
keys to relevant keymap when object operator is exposed in 3d view.

Pull Request: https://projects.blender.org/blender/blender/pulls/137519
2025-04-16 17:50:02 +02:00
Habib Gahbiche
535d9c63e1 UI: Improve default position of shader nodes
After creating a new shading material, the new node tree might become invisible and the user has to scroll down to see the nodes.

The idea of this PR is to create nodes with x-positions centered around zero, such that they are always visible no matter the screen size or workspace setup. Ideally, the nodes' position should depend on the region's zoom and pan. However, the node creation code currently does not depend on `SpaceNode`, so such solution would complicate the code a bit. Also, this heuristic seem to work well enough for most cases.

Note: this only affects newly created materials. The material of the default cube and the default world material still have invisible nodes sometimes. This is because they are saved in the startup file, which will be addressed in a different patch.

Pull Request: https://projects.blender.org/blender/blender/pulls/136926
2025-04-16 16:25:20 +02:00
Habib Gahbiche
e8a66c0108 UI: Geometry Nodes: Use viewport icon for viewer node
For consistency with other parts of Blender, the geometry visibility in the viewport is controlled by the viewport icon. The compositor will still have the eye icon for previews, but viewer nodes will get the viewport icon, also for consistency reasons.

Pull Request: https://projects.blender.org/blender/blender/pulls/134949
2025-04-16 15:59:58 +02:00
Omar Emara
7f02fd3192 Compositor: Turn Pixelate node options into inputs
This patch turns the options of the Pixelate node into inputs.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/137603
2025-04-16 15:34:50 +02:00
Aras Pranckevicius
fd52a005ec Fix compile warning 2025-04-16 15:57:09 +03:00