Commit Graph

147519 Commits

Author SHA1 Message Date
Germano Cavalcante
6aeda6edaa Merge remote-tracking branch 'origin/blender-v4.4-release' 2025-03-08 10:19:49 -03:00
Germano Cavalcante
bd9dce74c0 Fix #135564: 'Cycle edges' on the Knife tool not working
Due to recent code changes, `knife_calculate_snap_ref_edges` relied on
the (not yet computed) `kcd->curr.mval` to compute the raycast ray.

The solution is to pass the computed ray right before.

Also `knife_snap_update_from_mval` is now called on the modal to update
the edge as soon as the button is pressed.

Pull Request: https://projects.blender.org/blender/blender/pulls/135649
2025-03-08 14:16:34 +01:00
Alaska
ffcfd648c3 Tests: Add render tests for polygonal aperture DOF
This commit adds tests for a camera with Depth of field with a
polygonal aperture.

Ref: blender/blender-test-data!64
2025-03-08 11:05:34 +01:00
Alaska
65f3a80036 Tests: Adjust shadow_link_transparency so it shows a recent Cycles regression
After a recent refactor (1), there was a failure case that showed up in
the shadow_link_transparency file (2), but didn't cover enough pixels
to trigger a failure.

This commit adjusts the file so enough pixels are different to trigger
a failure.

(1) blender/blender@e813e46327
(2) blender/blender#135572

Ref: blender/blender-test-data!68
2025-03-08 08:21:41 +01:00
Brecht Van Lommel
8076fa10e0 Fix: Cycles BVH2 issue causing Metal crashes, after recent cleanup
Ref 48398b223b
2025-03-07 19:20:25 +01:00
Hans Goudey
a5d1aecbc3 Merge branch 'blender-v4.4-release' 2025-03-07 12:50:29 -05:00
Hans Goudey
3f87120ccf Fix #135633: Freeze/crash using a specific Geometry Node group as modifier
`interface_input_index` was called for an output socket. Also filter out inputs
that aren't exposed in the modifier, similar to a few lines above.

Pull Request: https://projects.blender.org/blender/blender/pulls/135641
2025-03-07 18:46:53 +01:00
Hans Goudey
99fa22a01f Fix #135175: Bounds overlay doesn't include all evaluated geometry
In the report, the bounds didn't include the curves generated from the
original legacy curve object. Generally we need to access the evaluated
geometry bounds here when the object is a geometry object.

This depends on 06f6d77979 for consistent behavior with
curve radii. That's why the fix is limited to main rather than 4.4.

Pull Request: https://projects.blender.org/blender/blender/pulls/135639
2025-03-07 18:23:40 +01:00
Hans Goudey
0461e4b8e4 Cleanup: Improve documentation for Object bounds functions 2025-03-07 12:20:39 -05:00
Campbell Barton
967fb3ae4c Fix: Grease Pencil: Crash running operators that require a 3D viewport
Correct the poll functions for reproject & texture gradient.

Pull Request: https://projects.blender.org/blender/blender/pulls/135618
2025-03-07 18:13:20 +01:00
Hans Goudey
8e4b34cad0 Cleanup: Remove unnecessary "else" after "continue" 2025-03-07 12:06:50 -05:00
Philipp Oeser
711772de88 Merge branch 'blender-v4.4-release' 2025-03-07 17:59:33 +01:00
Hans Goudey
59b6212fed Geometry Nodes: Avoid logging entire long strings
To avoid overhead from logging, don't log more than 100 characters.

Pull Request: https://projects.blender.org/blender/blender/pulls/135592
2025-03-07 17:54:26 +01:00
Philipp Oeser
a568890515 Fix #135601: prop_tabs_enum No Longer Displays Text of Enum
Caused by 21aef81714

Now, pass along `uiname` as `std::optional<StringRef>` early on (and use
`std::nullopt`).

Without this, the `(!uiname || !uiname->is_empty())` condition in
`ui_item_enum_expand_elem_exec` wont be true, resulting in the empty
label.

Pull Request: https://projects.blender.org/blender/blender/pulls/135621
2025-03-07 17:53:54 +01:00
Philipp Oeser
62fcd012cf Fix #135582: Crash box selecting in sequence editor without a sequence
Caused by f98b01e492

The issue of uninitialized `Editing` (in new scenes) has come up before,
see e.g. https://projects.blender.org/blender/blender/issues/
118633#issuecomment-1134447

So it is not uncommon to guard against `Editing` being null, same is now
done here

Pull Request: https://projects.blender.org/blender/blender/pulls/135623
2025-03-07 17:53:43 +01:00
Philipp Oeser
8beb695b7f Fix #135625: Grease Pencil: Unavailable Masks operators not grayed out
To resolve, add proper poll functions checking the needed amount of
masks.

Pull Request: https://projects.blender.org/blender/blender/pulls/135629
2025-03-07 17:53:30 +01: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
Sergey Sharybin
32d49541c0 Fix #135572: Cycles shadow linking through transparency is broken on GPU
Make the ray self primitives store and restore reliable for cases when
the intersect_shadow kernel is called multiple times:

- Light object and primitive are stored in dedicated fields in the
  state. This adds 2 integers per state.

- The self object and primitive are used from the previous intersection
  when the intersect_shadow is called multiple times.

There is more detailed explanation added in the code.

The issue was introduced by the light refactor to be objects in #134846.

Pull Request: https://projects.blender.org/blender/blender/pulls/135573
2025-03-07 17:16:04 +01:00
Hans Goudey
3f596a651c Geometry Nodes: Add names to String to Curves instance geometries
The name of each instance geometry is the character. This makes debugging
in the spreadsheet much easier, and the objects from "Visual Geometry to Objects"
are actually usable too.

Pull Request: https://projects.blender.org/blender/blender/pulls/135599
2025-03-07 17:01:18 +01:00
Falk David
39ceab03be Merge branch 'blender-v4.4-release' 2025-03-07 16:23:53 +01:00
Falk David
a904d3a1b2 Fix #135539: Grease Pencil: Depth placement not working in rendered mode
The issue was happening because the `is_render_depth_available`
state flag was false leading to the depths being cleared.

When we use `is_depth_only_drawing`, we expect
that the depth is valid because the Grease Pencil
engine will write them.

Pull Request: https://projects.blender.org/blender/blender/pulls/135619
2025-03-07 16:17:15 +01:00
Bastien Montagne
015790964d Cleanup: WM: Replace 'void' MEM_[cm]allocN with templated, type-safe MEM_[cm]allocN<T>.
The main issue of 'type-less' standard C allocations is that there is no check on
allocated type possible.

This is a serious source of annoyance (and crashes) when making some
low-level structs non-trivial, as tracking down all usages of these
structs in higher-level other structs and their allocation is... really
painful.

MEM_[cm]allocN<T> templates on the other hand do check that the
given type is trivial, at build time (static assert), which makes such issue...
trivial to catch.

NOTE: New code should strive to use MEM_new (i.e. allocation and
construction) as much as possible, even for trivial PoD types.

Pull Request: https://projects.blender.org/blender/blender/pulls/135626
2025-03-07 15:52:34 +01:00
Germano Cavalcante
7688677e29 Refactor: DRW: Replace 'DRW_draw_depth_object' with 'DRW_draw_depth_loop'
`DRW_draw_depth_object` seems completely out of spec (using DRW batches
to draw onto non-DRW framebuffer + no DST setup).

Pull Request: https://projects.blender.org/blender/blender/pulls/135598
2025-03-07 13:47:09 +01:00
Nathan Vegdahl
b634fd04ed Fix #133010: Rigify operators for copying rig-type parameters fail
The underlying issue was that the code was trying to directly assign a Python
dictionary to an add-on defined Group Property accessed via `[]` syntax, like
this:

```
to_bone['rigify_parameters'] = param_dict
```

That only works if 'rigify_parameters' does *not* already exist according to the
`[]` lookup, so this was failing whenever it already did.

This PR fixes that by simply deleting the property first when it already exists.

Co-authored-by: Ayoub ibn Muhammad <cl3m3c7@riseup.net>
Co-authored-by: Sybren A. Stüvel <sybren@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/135233
2025-03-07 12:53:56 +01:00
YimingWu
308e81fd8a Fix #135438: Prevent vertex group name collision when renaming bones.
When renaming bones, vertex groups that has the same name as the old
name of the bone will be renamed to the new name, but this may cause
name collision in the vertex group list. When this happens, we should
not change the vertex group's name. Now a warning message will show.

Pull Request: https://projects.blender.org/blender/blender/pulls/135492
2025-03-07 12:52:09 +01:00
Bastien Montagne
09221e4db2 Cleanup: Creator: Replace 'void' MEM_[cm]allocN with templated, type-safe MEM_[cm]allocN<T>.
The main issue of 'type-less' standard C allocations is that there is no check on
allocated type possible.

This is a serious source of annoyance (and crashes) when making some
low-level structs non-trivial, as tracking down all usages of these
structs in higher-level other structs and their allocation is... really
painful.

`MEM_[cm]allocN<T>` templates on the other hand do check that the
given type is trivial, at build time (static assert), which makes such issue...
trivial to catch.

NOTE: New code should strive to use `MEM_new` (i.e. allocation and
construction) as much as possible, even for trivial PoD types.

Pull Request: https://projects.blender.org/blender/blender/pulls/135620
2025-03-07 11:52:12 +01:00
Habib Gahbiche
6542c86ff5 Nodes: implement operator node.activate_viewer()
The goal is to have a clear separation between active nodes and active viewers in a node tree. Both the compositor and geometry nodes viewers are supported. This will also allow us to implement shortcuts for viewers for geometry nodes.

A viewer node can be activated using
```
viewer_node = bpy.context.scene.node_tree.nodes["Viewer"]
with bpy.context.temp_override(node=viewer_node):
    bpy.ops.node.activate_viewer()
```

Pull Request: https://projects.blender.org/blender/blender/pulls/134456
2025-03-07 11:48:45 +01:00
Sybren A. Stüvel
5597e01aa6 Merge remote-tracking branch 'origin/blender-v4.4-release' 2025-03-07 11:25:30 +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
YimingWu
8ebeafa6b9 Fix #135586: Grease Pencil: Crash in length modifier extending curves
Previously in 43fde8c39c the point span
for calling `extend_curves_straight` was set to a fixed `{1}` with only
1 element, this causes index access to go out of range, which is the
cause of crash #135586. However there are some other issues within the
code path, mainly:

- The meaning of `start/end_points` are unclear
- Behaviour of extending a 2-point stroke is undefined

This PR clarifies these by adding some comments and change a bit of the
logic in the code so it's more understandable.

Pull Request: https://projects.blender.org/blender/blender/pulls/135608
2025-03-07 11:24:21 +01:00
YimingWu
ec33541b99 Fix #135611: Grease Pencil: Correct poll function for layer_group_color_tag
Operator `GREASE_PENCIL_OT_layer_group_color_tag` did not check the
existence of active layer group before executing. Now corrected with a
`poll()` callback.

Pull Request: https://projects.blender.org/blender/blender/pulls/135612
2025-03-07 11:21:01 +01:00
Clément Foucault
4179960ede Overlay: Add DepthOnly GPU debug capture scope
Allow to capture the depth loop.
2025-03-07 11:18:33 +01:00
Bastien Montagne
1e00054195 Cleanup: Replace 'void' MEM_[cm]allocN with templated, type-safe MEM_[cm]allocN<T>.
The main issue of 'type-less' standard C allocations is that there is no check on
allocated type possible.

This is a serious source of annoyance (and crashes) when making some
low-level structs non-trivial, as tracking down all usages of these
structs in higher-level other structs and their allocation is... really
painful.

`MEM_[cm]allocN<T>` templates on the other hand do check that the
given type is trivial, at build time (static assert), which makes such issue...
trivial to catch.

NOTE: New code should strive to use `MEM_new` (i.e. allocation and
construction) as much as possible, even for trivial PoD types.

Pull Request: https://projects.blender.org/blender/blender/pulls/134452
2025-03-07 10:44:49 +01:00
Sybren A. Stüvel
b71fed904b Cleanup: Remove F-Curve handling from undo in Curve edit mode
This commit removes the F-Curve handling from the legacy Curve edit mode
undo code.

The legacy Curve edit mode uses the per-mode undo system. This tried to
deal with changes in the animation data as well, but did so in a very
limited way. Only F-Curves were copied & restored, which means the
Action Groups were effectively deleted as soon as you undo something.
Furthermore, the code wasn't updated for slotted Actions yet, so
effectively it was a no-op, because it only saw the always-empty legacy
`Action::curves` field.

Fixing this properly would mean discarding this undo code, and moving to
the global undo system, as the animation editors allow changing the
animation of anything in the scene, not just the Curve data-block that
is being edited. Since the legacy curve ID type is, well, legacy, I
don't think it's worth going this route.

This is a non-functional change, as `action->curves` is always empty,
and so nothing was backed up or restored anyway.

Pull Request: https://projects.blender.org/blender/blender/pulls/135585
2025-03-07 10:40:16 +01:00
Pratik Borhade
adba9bda59 Cleanup: Grease Pencil: Remove legacy undo code
Remove GP legacy undo code. Annotation doesn't require it, memfile/global
undo is used by annotation system.
Continuation of d961f8f9ec.

Pull Request: https://projects.blender.org/blender/blender/pulls/135501
2025-03-07 10:33:26 +01:00
Pratik Borhade
4e141d11c5 Cleanup: Grease Pencil: Remove legacy animation drawing code
`ANIMTYPE_GPDATABLOCK` is not used anymore animation editor for channel
drawing. `ANIMTYPE_GPLAYER` is still needed for annotation channels in
dopesheet.

Pull Request: https://projects.blender.org/blender/blender/pulls/135556
2025-03-07 10:32:33 +01:00
Campbell Barton
9b9bddb3fd Merge branch 'blender-v4.4-release' 2025-03-07 20:12:48 +11:00
Campbell Barton
5849d9aec3 Fix crash using transform with grease pencil without an "area" 2025-03-07 20:11:51 +11:00
Philipp Oeser
be7e74972c Merge branch 'blender-v4.4-release' 2025-03-07 09:52:20 +01:00
Philipp Oeser
084cb40e98 Fix #108722 : Measures not cleared when removing annotation layer
Removing the layer would leave the ruler gizmos on screen, only way to
update was changing to another tool and back. Now remove all
corresponding gizmo ruler items found (also in different windows/scenes)
when removing the ruler annotation layer.

Also add a proper notifier that grease pencil was edited (this way we
also get immediate update when a ruler annotation layer was added --
which was also missing).

Pull Request: https://projects.blender.org/blender/blender/pulls/135571
2025-03-07 09:52:01 +01:00
Alaska
35e214351b Tests: Add render tests for stereoscopic cameras
This commit adds tests for perspective and panoramic
stereoscopic cameras.

These two camera types were chosen as they have a option for
`Spherical Stereo` which takes an alternative code path in Cycles
rendering.

So these test files conver both a general stereoscopic test and these
specific code path tests.

Ref: blender/blender-test-data!66
2025-03-07 09:27:27 +01:00
Philipp Oeser
6fe188f9f2 Merge branch 'blender-v4.4-release' 2025-03-07 08:35:36 +01:00
Philipp Oeser
d18fe0c575 Fix #135523: Calculate Motion Paths ignores Selected Keys option
Since the switch to slotted actions, we cannot solely rely on the
Listbase of `curves` (this is for legacy actions only), but need to
consider Channelbag for new slotted actions. There is
`assigned_action_has_keyframes` that handles both of these
and would also early out if we have no keyframes to process,
so use it.

Pull Request: https://projects.blender.org/blender/blender/pulls/135566
2025-03-07 08:35:17 +01:00
Philipp Oeser
cf95ff1a6e Fix #129782: ActionSlot channels in Action Editor mode lack background
This was introduced in 1d2cea1e3e

It was not using any `draw_backdrop` callback though, which is now
added.

Main point of discussion is probably if we want to use `Dope Sheet
Channel` theming (which is only used for `Object` and `Scene` channels
atm., also referred to as "root" in code) or the `Dope Sheet Sub-
channel` theming (which is now used for all kinds things - object data,
but also actions..., also referred to as "dataexpand" in code)

Given the similarity to actions, one might lean towards "Sub", but otoh
that channel occupies a "root" channel in the action editor mode. If I
understand correctly, an `ActionSlot` is also mostly used to "separate"
different objects in the same action, so that then makes an ActionSlot
actually more similar to how the "root" channel is used for `Object` and
`Scene` in dopesheet mode.

This is why this PR makes an `ActionSlot` use the "root" theming.

NOTE: we also might want to revisit the naming in code (suggestion would
be TH_DOPESHEET_CHANNELOB > TH_DOPESHEET_CHANNELROOT,
TH_DOPESHEET_CHANNELSUBOB >TH_DOPESHEET_CHANNELSUBOB), but that is for
another time...

Pull Request: https://projects.blender.org/blender/blender/pulls/135506
2025-03-07 08:35:02 +01:00
Campbell Barton
bfa568b4ff Cleanup: replace filename with filepath for full paths 2025-03-07 15:56:24 +11:00
Campbell Barton
7d13c1d426 Merge branch 'blender-v4.4-release' 2025-03-07 15:50:15 +11:00
Campbell Barton
f6d730d6e6 Fix "Image from View" ignored filepath property
Assign the filepath from the operator to the generated image.
2025-03-07 15:49:39 +11:00
Campbell Barton
e9b4f13304 Merge branch 'blender-v4.4-release' 2025-03-07 15:18:14 +11:00
Campbell Barton
f7ba05991f Fix uninitialized return value from constraint operators
The utility function edit_constraint_invoke_properties could return
false without setting the return value, causing the operators invoke
function to return an uninitialized flag.
2025-03-07 15:16:51 +11:00
Alaska
c33b423509 Tests: Add render test for rolling shutter
This commit adds a test for the rolling shutter feature found
in Cycles.

The test contain a few different objects to test different areas:
- A rotating camera, with a changing focal length
- A moving object
- A rotating object
- And a rotating object with motion blur disabled

Ref: blender/blender-test-data!67

Pull Request: https://projects.blender.org/blender/blender/pulls/135562
2025-03-07 05:15:34 +01:00