Commit Graph

28186 Commits

Author SHA1 Message Date
Campbell Barton
b77d77af40 Refactor: add utility object & pchan setters, respecting protected flags
Add "set" functions for location, scale & rotation that leave
protected channels untouched.

Ref !136104
2025-03-18 20:36:57 +11:00
Clément Foucault
e08c64d68e Cleanup: DRW: Remove DrawData
These have been replaced by better alternatives overtime.

Pull Request: https://projects.blender.org/blender/blender/pulls/136073
2025-03-17 15:16:07 +01:00
Hans Goudey
759923fdd7 Geometry Nodes: Use socket type for store named grid
This used custom data types before, which was misleading and didn't
scale well because the set of attribute types is different than the set
of grid types we can store. Now just use the grid data type, like how
the store named attribute node uses the attribute type.

This covers backward compatibility, but not forward compatibility.

Pull Request: https://projects.blender.org/blender/blender/pulls/135814
2025-03-14 18:36:16 +01:00
Jacques Lucke
51904839ac Fix #135948: Geometry Nodes: support evaluating undefined custom group nodes
The main reason that didn't work before because undefined custom node groups
have the undefined `bNodeType` (and thus are ignored in various places) but are
actually still groups that can be evaluated. The fix is just to handle custom
node groups a bit more explicitly.

In the future, we may want to have a separate "undefined custom group"
`bNodetype`, but that might a be a bit bigger project.

Pull Request: https://projects.blender.org/blender/blender/pulls/135974
2025-03-14 18:31:29 +01:00
Julian Eisel
d14c677da3 Versioning: Bump subversion after previous commit
Followup to 4499fad40e.

Although no really necessary (the added versioning would be fine to
always run), still bump the subversion to avoid confusion about the
unversioned block.
2025-03-14 16:50:14 +01:00
Habib Gahbiche
d8d09cdadb Geometry Nodes: shortcuts for viewer nodes
Implement shortcuts for viewer nodes. Viewer nodes are now activated using the operator `bpy.ops.node.activate_viewer()` instead of activating the viewer by setting the node to active.

This also unifies the behavior with viewer shortcuts in the compositor (see attachment in the original PR).

Pull Request: https://projects.blender.org/blender/blender/pulls/134555
2025-03-14 11:26:57 +01:00
Clément Foucault
626118984e Compositor: Use last_update for ID update
This replaces the deprecated DrawData mechanism by the
usage of the update timestamp `last_update`.

The compositor keeps the `last_update` value of the cached ID
and compares it with the value on the ID at the time of evaluation.

Rel #134690

Pull Request: https://projects.blender.org/blender/blender/pulls/134878
2025-03-14 10:25:32 +01:00
Jacques Lucke
c23cf12560 Cleanup: Nodes: simplify getting socket type from static type 2025-03-14 10:16:56 +01:00
Philipp Oeser
220e7481fb Merge branch 'blender-v4.4-release' 2025-03-14 09:18:49 +01:00
Philipp Oeser
98ab9c26c1 Fix #135857: "Affect only origins" fail for non-poly grease pencil curve
If we tag positions to be changed we get a proper update (was probably
working for poly curves because the evaluated positions just reference
the original positions array when all curves are poly curves).

Pull Request: https://projects.blender.org/blender/blender/pulls/135874
2025-03-14 09:18:01 +01:00
Bastien Montagne
36826f0237 BKE ID management: Add an overload of BKE_libblock_find_session_uid without idtype.
Allows to search for a session_uid in a whole Main, when the target ID
type is not known.
2025-03-13 19:03:12 +01:00
Sybren A. Stüvel
ac4f22cec4 Merge remote-tracking branch 'origin/blender-v4.4-release' 2025-03-13 12:53:59 +01:00
Sybren A. Stüvel
30ba81f805 Fix #135894: Assigned Action can mute NLA strip when reusing the same Action
Fix an issue when the NLA is used in conjunction with a directly-
assigned Action.

When the directly-assigned Action is also used in an NLA strip, that
strip would not be evaluated any more. This was even the case when
different slots were used, which entirely muted the strip when there
was no slot directly assigned. Now the "this has been handled already"
logic considers the action and the slot.

Pull Request: https://projects.blender.org/blender/blender/pulls/135911
2025-03-13 12:50:47 +01:00
Campbell Barton
78c3f6a1ee Cleanup: adjust order of terms for BMesh UV map function calls
Order more generic terms first for better ordering, more useful
completion.
2025-03-13 15:23:46 +11:00
Campbell Barton
6ef7dae8ef Cleanup: spelling in comments (make check_spelling_*) 2025-03-13 13:41:17 +11:00
Thomas Dinges
9f66476430 Release: Blender 4.4 goes to RC 2025-03-12 12:30:03 +01:00
Jesse Yurkovich
f3b1c9b2cd Merge branch 'blender-v4.4-release' 2025-03-11 23:29:04 -07:00
Andrej730
b2fe81a17f Fix: small typo in Alembic Mesh Sequence Cache glob check
Mistake in ea54cbe

Pull Request: https://projects.blender.org/blender/blender/pulls/135287
2025-03-12 07:28:23 +01:00
John Kiril Swenson
7356e72e1b VSE: Snap to Frame Range, Snap by Default
This patch adds the ability to snap to the frame range bounds in the VSE
timeline, on by default. End frame snap location is offset by 1 to
ensure the snap point aligns with the visible end frame boundary
(otherwise e.g. right handle of strip would be one frame short).

Timeline and preview snapping is also turned on by default using the
same versioning block.

Pull Request: https://projects.blender.org/blender/blender/pulls/135753
2025-03-12 03:36:32 +01:00
Falk David
a92b68939a Geometry Nodes: Add "Scale" input to "Curve to Mesh" node
This replaces the implicit use of the `radius` attribute on the input
curves with an input field `Scale` that gets evaluated on the point
domain of the input curves to scale the profile.

It wasn't super intuitive that the `radius` would actually act as
a scale of the profile. E.g. if the radius of the input curve was
`1 meter` the resulting profile was unscaled (scaled by 1), but
wouldn't necessarily have a size of `1 meter` (only if the profile
also had a size of 1m)! If imperial units were used, `3.28084 ft`
would correspond to a scale of 1.

This change makes this behavior a lot more clear and potentially
removes the need for the assumption that the default curve radius
is `1.0f` (Ideally, the default curve radius should be `0.01f`).

While we did consider making the `Scale` input use the `radius`
field implicitly by default, we decided against it, because it again
"hides" the dependency on the radius and the fact that the radius
is used as a scale. Letting the user make this decision seems better.

Pull Request: https://projects.blender.org/blender/blender/pulls/134187
2025-03-11 19:06:47 +01:00
Hans Goudey
d2af128245 Cleanup: Use StringRef for volume grid name access
Previously `.data()` was used incorrectly in some cases.

Pull Request: https://projects.blender.org/blender/blender/pulls/135808
2025-03-11 18:52:23 +01:00
Sebastian Parborg
09ba1aabbd Refactor: Make the event queue only use runtime data.
Also make it more clear that some of the functions are internal
functions.

Pull Request: https://projects.blender.org/blender/blender/pulls/135181
2025-03-11 14:39:19 +01:00
Sebastian Parborg
73b7edbe09 Refactor: Move the notifier event queue to use runtime data.
Also make it a bit more obvious when some functions are for internal use
and not.
2025-03-11 14:39:18 +01:00
Jeroen Bakker
32999913ef SubDiv: Enable GPU subdivision on Metal
This PR enabled GPU based subdivision on Metal.
Most work is done in #135296.

- Metal max storage bindings for compute shaders were never set.

Some performance figures: Suzanne 6 subdivision levels

| Machine         | CPU Subdivision | GPU Subdivision |
| --------------- | --------------- | --------------- |
| M1 Studio Ultra | 7fps            | 12 fps          |
| M2 Air          | 3fps            | 11 fps          |

Pull Request: https://projects.blender.org/blender/blender/pulls/135628
2025-03-11 11:12:01 +01:00
Jeroen Bakker
c7f7c03f4c Subdiv: Enable GPU subdivision on Vulkan
This PR enabled GPU subdivision on Vulkan backend. Measured
performance is slower compared to CPU on my system. But it is
expected that other bottlenecks should be solved in order to
fully benefit from this feature.

We enable it so we keep track of the performance bottlenecks.

Pull Request: https://projects.blender.org/blender/blender/pulls/135777
2025-03-11 11:08:59 +01:00
John Kiril Swenson
58c29625b2 Fix: UI: Action/info/console scrollbar padding/hiding state
Properly pad the action scrollbar by calling
`ED_time_scrub_clamp_scroller_mask` which was overlooked. Also hide it
when the entire view is visible. Adds versioning code to hide console
and info scrollbars as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/135142
2025-03-11 02:10:49 +01:00
Sean Kim
96d9619935 Cleanup: Add NonCopyable to Paint BVH Node class
When working with the Paint BVH, we mostly want to operate on the
existing set of nodes stored in the Tree, even when parititioning and
creating new nodes. Adding `NonCopyable` to the base `Node` class
prevents a subtle class of errors early where a copy is made instead of
acquiring a reference.

Pull Request: https://projects.blender.org/blender/blender/pulls/135547
2025-03-10 17:55:53 +01:00
Jacques Lucke
c643c062a3 Merge branch 'blender-v4.4-release' 2025-03-10 16:21:47 +01:00
David Murmann
05ec635e6b Fix #135277: mark scene parameters as dirty on camera switch
Geometry nodes using the active camera did not get updated
when the camera is switched by a timeline marker.

Pull Request: https://projects.blender.org/blender/blender/pulls/135546
2025-03-10 16:21:12 +01:00
Sybren A. Stüvel
657f9e45f7 Merge remote-tracking branch 'origin/blender-v4.4-release' 2025-03-10 14:52:14 +01:00
Sybren A. Stüvel
955e02c90d Fix: Duplicating a Scene does not remove animation from slotted actions
When duplicating a scene in any way other than Full Copy, the VSE data
is (apparently) not copied along. To prevent dangling F-Curves, any
animation of sequencer strips is removed. This is now done correctly for
slotted Actions, instead of looping over the legacy `action->curves`
field.

Also the F-Curve RNA path that's being tested for is updated. Instead of
deleting all F-Curves with `sequences` in the name, the code now
correctly looks for `sequence_editor.strips_all`.

Pull Request: https://projects.blender.org/blender/blender/pulls/135576
2025-03-10 14:49:12 +01:00
Jeroen Bakker
40696ca452 SubDiv: Migrate GPU subdivision to use GPU module
Blender already had its own copy of OpenSubDiv containing some local fixes
and code-style. This code still used gl-calls. This PR updates the calls
to use GPU module. This allows us to use OpenSubDiv to be usable on other
backends as well.

This PR was tested on OpenGL, Vulkan and Metal. Metal can be enabled,
but Vulkan requires some API changes to work with loose geometry.

![metal.png](/attachments/bb042c3a-1a87-4140-9958-a80da10d417b)

# Considerations

**ShaderCreateInfo**

intern/opensubdiv now requires access to GPU module. This to create buffers
in the correct context and trigger correct dispatches. ShaderCreateInfo is used
to construct the shader for cross compilation to Metal/Vulkan. However opensubdiv
shader caching structures are still used.

**Vertex buffers vs storage buffers**

Implementation tries to keep as close to the original OSD implementation. If
they used storage buffers for data, we will use GPUStorageBuf. If it uses vertex
buffers, we will use gpu::VertBuf.

**Evaluator const**

The evaluator cannot be const anymore as the GPU module API only allows
updating SSBOs when constructing. API could be improved to support updating
SSBOs.

Current implementation has a change to use reads out of bounds when constructing
SSBOs. An API change is in the planning to remove this issue. This will be fixed in
an upcoming PR. We wanted to land this PR as the visibility of the issue is not
common and multiple other changes rely on this PR to land.

Pull Request: https://projects.blender.org/blender/blender/pulls/135296
2025-03-10 07:31:59 +01:00
YimingWu
b7634119c6 Merge branch 'blender-v4.4-release' 2025-03-10 11:35:52 +08:00
YimingWu
e781bd7e11 Fix #135439: Grease Pencil: Prevent deleting groups with animated visibility
Previously in 6f80d722c6 there was a fix for
not removing layers from evaluated data when their visibility is animated,
however it overlooked that the same thing could happen to layer groups.
This fix basically duplicated the same check for layer groups.

Pull Request: https://projects.blender.org/blender/blender/pulls/135450
2025-03-10 04:29:15 +01:00
Hans Goudey
0461e4b8e4 Cleanup: Improve documentation for Object bounds functions 2025-03-07 12:20:39 -05:00
Hans Goudey
8e4b34cad0 Cleanup: Remove unnecessary "else" after "continue" 2025-03-07 12:06:50 -05:00
Hans Goudey
06f6d77979 Curves: Fix bounding box ignores radius, add option to geometry node
Unlike the legacy type, the radius isn't included in the bounds for the new
curves type. This hasn't been obvious because the drawing is quite broken
and doesn't use the radius properly.

This commit adds a separate cache for the bounds with the radius, which
is now used by default. The old cache is kept around for backward
compatibility in the bounding box geometry node, where a new
"Use Radius" option accesses the old behavior.

Pull Request: https://projects.blender.org/blender/blender/pulls/135584
2025-03-07 17:38:29 +01:00
Bastien Montagne
00de07f752 I/O: Smoothgroups: Add option to also consider 'sharp vertices'.
According to reports and testing in blender/blender-addons#104434, DCCs
tend to behave badly when rebuilding normals from 'bitflags'
smoothgroups, if different smoothgroups using the same bitflag value share
(are connected by) some common vertices, even if there are no common
edges between them.

This commit adds a new option to the RNA API generating smooth groups,
to also consider smooth groups only sharing vertices as neighbors.

It also makes related required change to implementation, and some
refactor of the API, splitting public functions between 'normal' and
'bitflags' versions.

This should make changes proposed in blender/blender-addons#105516
much simpler, and allow for a matching behavior in smoothgroups
generated by the OBJ exporter as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/135248
2025-03-07 11:24:37 +01:00
Brecht Van Lommel
f6eb81e62a Cleanup: Fix (harmless) null pointer increment in particle code 2025-03-06 22:34:22 +01:00
Jacques Lucke
cc8979650b Screen: support garbage collection of layout panel states
Identifying layout-panels using strings and storing their open-state in their
parent panel is generally very convenient. However, right now there is no
mechanism to free the open-close state of panels that are not in use anymore.
It's generally not possible to know if a panel is not used anymore (e.g. it may
also belong to a temporarily disabled add-on). So every mechanism here will be
based on heuristics. A simple but typically very good heuristic is to just
remove the least-recently-used panel states when there are too many. So that's
what is implemented here.

This introduces a logical clock that increases whenever a panel state is used
and stores the last usage time on the panel state. This allows us to remove the
least-recently-used states later on. Specifically, that is done when the .blend
file is loaded the next time. It's not done at another time, because it quite
difficult to be sure that freeing panel states wouldn't cause dangling pointers
in such cases. I think doing it on-load should be good enough for all practical
use-cases.

Note, I don't know if the lack of such garbage collection has ever caused a
problem anywhere. However, it seems better to have some solution now than trying
to solve it after the problem has occurred and made someone's file unusable.

Pull Request: https://projects.blender.org/blender/blender/pulls/135569
2025-03-06 17:41:49 +01:00
Hans Goudey
466d5e2a4c Cleanup: Use StringRef for point cloud attribute names
Also these don't need to be exposed elsewhere. The same name
is used everywhere anyway. And avoid some namespace repetition
in one function.
2025-03-06 09:55:02 -05:00
Richard Antalik
68abed543b Refactor: Remove module prefix form symbols in sequnecer namespaces
Remove
SEQ_ prefix for blender::seq namespace and
ED_sequencer for blender::ed::vse namespace

Pull Request: https://projects.blender.org/blender/blender/pulls/135560
2025-03-06 13:04:39 +01:00
Richard Antalik
a08246a1a2 Refactor: Move VSE code to namespaces
This PR creates 2 namespaces for VSE code:
- `blender::seq` for sequencer core code
- `blender::ed::vse` for editor code

These names are chosen to not be in conflict with each other.
No namespace was used for RNA.

Finally, file `BKE_sequencer_offscreen.h` was moved from BKE to sequencer.

Pull Request: https://projects.blender.org/blender/blender/pulls/135500
2025-03-06 06:22:14 +01:00
Hans Goudey
d88d6331fd Cleanup: Modernize mesh variable naming in some cases
Simplify naming of vertex and corner indices, and replace "loop".
2025-03-05 23:16:09 -05:00
Campbell Barton
d951428422 Cleanup: spelling in comments
Address warnings from check_spelling.py
2025-03-06 10:49:51 +11:00
Campbell Barton
5b856ba447 Merge branch 'blender-v4.4-release' 2025-03-06 10:35:59 +11:00
Campbell Barton
b85fc32cae Cleanup: spelling & repeated words in comments
Address warnings from check_spelling.py
2025-03-06 10:33:21 +11:00
Bastien Montagne
514ed4113f Core: Test/demo usage of new MEM_mallocN<T> template functions.
Pull Request: https://projects.blender.org/blender/blender/pulls/135531
2025-03-05 19:35:51 +01:00
Bastien Montagne
dd168a35c5 Refactor: Replace MEM_cnew with a type-aware template version of MEM_callocN.
The general idea is to keep the 'old', C-style MEM_callocN signature, and slowly
replace most of its usages with the new, C++-style type-safer template version.

* `MEM_cnew<T>` allocation version is renamed to `MEM_callocN<T>`.
* `MEM_cnew_array<T>` allocation version is renamed to `MEM_calloc_arrayN<T>`.
* `MEM_cnew<T>` duplicate version is renamed to `MEM_dupallocN<T>`.

Similar templates type-safe version of `MEM_mallocN` will be added soon
as well.

Following discussions in !134452.

NOTE: For now static type checking in `MEM_callocN` and related are slightly
different for Windows MSVC. This compiler seems to consider structs using the
`DNA_DEFINE_CXX_METHODS` macro as non-trivial (likely because their default
copy constructors are deleted). So using checks on trivially
constructible/destructible instead on this compiler/system.

Pull Request: https://projects.blender.org/blender/blender/pulls/134771
2025-03-05 16:35:09 +01:00
Sybren A. Stüvel
d620f7605c Merge remote-tracking branch 'origin/blender-v4.4-release'
ch.cc
2025-03-05 13:28:16 +01:00