Commit Graph

152115 Commits

Author SHA1 Message Date
Hans Goudey
622e3d4792 Fix: Potential issue with multires bake tangent handling
Mistake in b19696c0b8

Don't reference the data from the `Array` which will just be the inline
buffer if `require_tangent` is false (for displacement baking).

I still observe a crash when multires baking, but that's deep in Cycles
code.
2025-07-17 10:08:43 -04:00
YimingWu
aa6761f65f Fix #142183: Grease Pencil: Check object type upon exporting selected frames
When only exporting "Selected Frames", we need to read frames from the
active grease pencil object. If the active object isn't a grease pencil
object, we need to return early and do not export.

Co-authored-by: Thomas Dinges <thomasdinges@noreply.localhost>
Pull Request: https://projects.blender.org/blender/blender/pulls/142188
2025-07-17 15:56:36 +02:00
YimingWu
37df7ea850 Fix #137429: GPU: Allow missing attribute in pygpu_shader_attrs_info_get
In `pygpu_shader_attrs_info_get`, it tries to check information for all
vertex attributes that are added via `VERTEX_IN`, however some drivers
will optimize compiled shaders so some vertex attributes that are not
used will be removed. This fix makes sure that the input length that
is used in `GPU_shader_get_attribute_len` does not exceed actual max
binding number.

Pull Request: https://projects.blender.org/blender/blender/pulls/137584
2025-07-17 15:54:12 +02:00
Piotr Makal
6697dc2561 Fix: Crash when Bevel operation is performed on border edges
Fix #142045 crash on performing bevel operation on border edges.
When user selected both border edges and neigboring edges
(parallel to those border egdes) for the bevel operation,
the former were omitted during construction of BevVert objects
but their initial UV connectivity were recorded during call
to determine_uv_vert_connectivity function - specifically BMLoop
pointers were stored in BevelParams::uv_vert_maps member.
This later caused issues after rebuilding existing polygons
(bevel_rebuild_existing_polygons) since previously recorded
BMLoop pointers became invalid for border edges but still were
stored in uv_vert_maps (uv_vert_map_pop function was not called
for them since those loops were not related to BevVert objects).
This caused crash when accessing UV positions, when providing
invalid loop pointer to BM_ELEM_CD_GET_FLOAT_P function in bevel_merge_uvs.
2025-07-17 09:20:34 -04:00
Philipp Oeser
2fd36b0ab7 Fix #142103: Animation decorator not working on Light Temperature value
When having a checkbox and a value both in one row together with an
animation decorator it is questionable whether the decorator should act
on animating the checkbox or the corresponding value.

We had similar cases before (e.g. 7c04ef210e)

In this case as well, one would think it is more desirable to animate
the actual Temperature **value** (instead of the checkbox), so this is
what this PR does.

Pull Request: https://projects.blender.org/blender/blender/pulls/142192
2025-07-17 15:03:50 +02:00
Christoph Lendenfeld
d64ace7799 Fix #142106: FCurve noise modifier versioning error
This issue occurred because versioning was applied twice.

The history:
* First I created 05aac73b45 which fixed the issue on main (4.5 at the time), version `405, 14`
* Then I created a backport for 4.4.3 f1e829a459 which also added versioning, version `404, 32`

That means all files created with 4.4.3 (`404, 32`) already had versioning
applied. However then opening it in 4.5 applied the versioning again since that only checked
if the version was at least `405, 14`

The fix is to exclude files that have already been saved with `404, 32`

Pull Request: https://projects.blender.org/blender/blender/pulls/142208
2025-07-17 14:22:16 +02:00
Philipp Oeser
8f605baa2e Fix #142062: Armature EditBone RNA paths incomplete
`PoseBone` and `Bone` already have their `struct_path_func` defined, but
that was missing from `EditBone`.
Since `EditBone` is usually what is visible from the UI (and only later
gets flushed to `Bone` via `ED_armature_from_edit`), it makes sense to
have complete RNA paths for `EditBone` as well.

Enables the usual context menu `Copy Data Path`, `Copy As New Driver`,
... automatically.

Pull Request: https://projects.blender.org/blender/blender/pulls/142065
2025-07-17 14:02:22 +02:00
Jacques Lucke
f2ee95843c Nodes: improve socket tooltips
The main goal of the patch is to make the socket tooltips more useful. This is
achieved in two ways:
* Use better text formatting in the tooltip to make it easier to parse and to
  better separate the current actual value from more general information about
  the socket.
* Add some more information like implicit field inputs when the node is not used
  currently or more details about a color.

This patch basically rewrites the entire tooltip generation, because it's quite
different from before (where we just created a single string for the entire
tooltip).

I'm using monospace for the actual current socket value and type, while the
normal font is used for general information about the socket like it's name,
description, allowed geometry types etc.

Pull Request: https://projects.blender.org/blender/blender/pulls/140540
2025-07-17 12:48:17 +02:00
Lukas Tönne
7495d5222b Fix: Grease Pencil interpolation on cyclic curves shifts end point
Fix for unreported issue with Grease Pencil interpolation tool: on cyclic curves
the last point is interpolated between the end points of the curve, especially
noticeable with sequence interpolation.

This required handling a corner case in the curve sample mapping function.
This function is complex and hard to verify with the operator alone, leading to
frequent issues and discovery of yet more corner cases. For this reason i
refactored the sampling function and added new unit tests.
This should help avoid regressions and make it clear how the function is
expected to behave in various corner cases.

The `sample_curve_padded` function has been moved into the geometry module,
since the `sculpt_paint` module does not have tests yet and is intended mostly
for higher-level operator code. The function has been split to separate out the
"reverse" sampling mode, which reduces complexity. Reverse sampling is done by
first reversing the input curve points, doing regular sampling, and then
reversing the resulting samples.

The function can now sample to larger or smaller sample arrays:
- Larger output arrays have a point aligned with each source point as before,
  with the rest of the points evenly distributed over the source curve.
  This ensures that the output curve matches the source as closely as possible,
  especially for poly curves.
- Smaller output arrays are uniformly sampled along the length of the source
  curve.

Pull Request: https://projects.blender.org/blender/blender/pulls/141946
2025-07-17 12:05:23 +02:00
Christoph Lendenfeld
e80ceb52df Fix #139509: Slot assignment is lost when loading file saved in tweak mode
The issue was that the `AnimData.tmp_slot_handle` had no RNA property associated with it
and so it couldn't be saved in the lib override.

The fix is to add the property. To ensure the correct code is called, most of the previous code
was replaced with a call to `blender::animrig::assign_tmpaction`

Pull Request: https://projects.blender.org/blender/blender/pulls/141395
2025-07-17 11:35:18 +02:00
Sebastian Parborg
c19218e423 Fix #141943: Correctly detect manifold libs when not in strict mode 2025-07-17 11:33:43 +02:00
Falk David
1a46806546 Fix: Grease Pencil: Missing call to finish() writing layer attributes
The `GSpanAttributeWriter` was missing a call to `finish()` to ensure
the changes are tagged and saved.
2025-07-17 11:31:10 +02:00
Christoph Lendenfeld
0191848671 Fix #141909: Creating a pose assets captures unkeyed custom properties
This was an oversight caused by 358a0479e8

Before this, only keyed custom properties were capture into the pose asset.
This behavior is now restored.

Pull Request: https://projects.blender.org/blender/blender/pulls/141937
2025-07-17 11:05:31 +02:00
Lukas Tönne
23d02ec57b Fix armature deform: Avoid accessing parameter data after moving 2025-07-17 09:42:39 +02:00
Jacques Lucke
55e2fd2929 Cleanup: unify naming for named constructors
Previously, we used an inconsistent naming scheme for such "named constructors".
Now it always uses `from_*`.

Pull Request: https://projects.blender.org/blender/blender/pulls/142175
2025-07-17 09:09:16 +02:00
Jacques Lucke
cbb76f21a1 Geometry Nodes: forbid some special characters in bundle item names
The goal is to be able to form bundle value paths like `Group/Sub/Geometry` in
the future. Additionally we might want to be able to use these paths in some
kind of expression for selecting a set of bundle paths. This requires us to
constrain what characters are allowed to be used in bundle paths. This patch
forbids using various special characters. Since we don't know exactly which
characters we'll need exactly in the future, I added more characters to the
forbidden-list than likely necessary. It's easier to make them available later
on than to try to forbid them later.

The forbidden chars are the following currently:
`/*&|"^~!,{}()+$#@[];:?<>.-%\=`.
Those are automatically replaced by an underscore if used.

Pull Request: https://projects.blender.org/blender/blender/pulls/142168
2025-07-17 08:00:15 +02:00
Campbell Barton
eee549f882 Docs: add readme for extensions
This intends to give an overview of the extensions implementation.

Co-authored-by: Sybren A. Stüvel <sybren@blender.org>

Ref !134785
2025-07-17 03:20:16 +00:00
Campbell Barton
989af38c93 Docs: add some code-comments regarding the default exclusions 2025-07-17 13:11:43 +10:00
Nika Kutsniashvili
169dbdd60f Extensions: exclude backup blend files when building an extension
Ref !142091
2025-07-17 13:11:29 +10:00
Campbell Barton
e8e188cb7d Cleanup: various non-functional changes for C++ 2025-07-17 12:32:30 +10:00
Campbell Barton
fc07a4d45e Cleanup: quiet ignored qualifier & unused warnings 2025-07-17 12:30:39 +10:00
Campbell Barton
c034c928fe Cleanup: correct spelling, typos & remove outdated comment 2025-07-17 12:30:37 +10:00
Campbell Barton
4d227dd593 GHOST: show assertion failures even when WITH_ASERT_ABORT=OFF
This makes GHOST_ASSERT behave like BLI_assert, where any non release
build shows an error even when assert doesn't abort.
2025-07-17 11:43:43 +10:00
Mattias Fredriksson
219d327b80 Fix: Memleak importing NURBS through OBJ node importer
Fixes a memleak and a double initiation introduced in #123967. Patch missed to
free the temp  Curve object and called `curve_init_data` from `BKE_curve_init`
which is already called in `BKE_id_new_nomain` from IDTypeInfo::init_data.

Pull Request: https://projects.blender.org/blender/blender/pulls/141924
2025-07-17 02:26:17 +02:00
Hans Goudey
b19696c0b8 Mesh: Simplify tangents calculation
- Tangent calculation functions no longer use the CustomData struct as
  an input and output.
- The "orco" and UV map calculations are exposed as separate API
  functions to avoid a confusing internal choice between the two
- Redundancy in the API is removed, function names are clarified
- Code is moved to C++ namespace
- The "orco" case is clarified in the mesh draw tangent VBO extraction
- CD_TANGENT layers are not stored in CustomData anymore, so some of
  that infrastructure is removed.
- Broken logic for caching tangents in CustomData is removed. That
  hasn't worked for many years, if it every worked. We could investigate
  adding caching again later if that's helpful.

Overall the change is motivated by the need to move away from CustomData
for #122398. But the changes should be a general improvement that makes
the code easier to understand either way.

Testing for this PR included using the default render UV in materials,
referencing specific UV tangents by name, using the spherical position-
based tangents in a material, and baking textures (multires and normal
baking).

Pull Request: https://projects.blender.org/blender/blender/pulls/141799
2025-07-17 02:24:09 +02:00
Hans Goudey
e3c5070dfe Cleanup: Remove unused data transfer code
Shape key interpolation was never implemented. Nowadays it's
probably better to implement similar features in different ways
rather than extending this system. Also some layer mapping
generation was unused. The motivation for this is easing some
cleanups to make this modifier less directly reliant on CustomData.

Pull Request: https://projects.blender.org/blender/blender/pulls/142131
2025-07-16 22:53:21 +02:00
Hans Goudey
d669f28e05 Fix: Overlapping data transfer enum values
This code is really weird, I'm not sure if this caused user-visible
errors but these values shouldn't overlap.

Pull Request: https://projects.blender.org/blender/blender/pulls/142130
2025-07-16 22:53:11 +02:00
Hans Goudey
65131f22f8 Cleanup: Use Span arguments for some mesh remapping functions
Pull Request: https://projects.blender.org/blender/blender/pulls/142123
2025-07-16 21:59:25 +02:00
Ray Molenkamp
d56ff67896 Win: Add some context to access violations
The Windows exception record is well documented [1] but it's not
the easiest information to remember. Every time i see a crash log
i still have to manually pull up the docs to check if the first
argument being 0 means read or write.

This PR adds this trivial information to our crash log, so I don't
have to look it up any more.

[1] https://learn.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-exception_record

Pull Request: https://projects.blender.org/blender/blender/pulls/142109
2025-07-16 20:57:37 +02:00
Hans Goudey
63a3499674 Cleanup: Use StringRef, std::string for node panel toggles
Just a slight simplification of this code to make a null
check unnecessary and avoid using char arrays.

Pull Request: https://projects.blender.org/blender/blender/pulls/141939
2025-07-16 20:22:55 +02:00
Brecht Van Lommel
9cbc44d6fd Fix #142060: Cycles simple adaptive subdivision UVs wrong for non-quads
Also fixes #141983.

Pull Request: https://projects.blender.org/blender/blender/pulls/142111
2025-07-16 19:18:52 +02:00
Bastien Montagne
899df7e3f0 Fix compilation after recent changes: missing include. 2025-07-16 18:53:10 +02:00
Hans Goudey
b20ecee555 Mesh: Move freestyle tags to generic attributes
This commit moves the freestyle edge and face mark tags to become
generic attributes, similar to other changes over the past years. The
attributes are called "freestyle_edge" and "freestyle_face", and they're
now propagated like regular boolean attributes.

Compatibility wise, forward and backward blend file compatibility are
maintained (for forward compatibility this is implemented a bit
differently than in the past because of the ongoing `AttributeStorage`
transition). In the Python API, `use_freestyle_mark` has been removed;
the attribute API should be used instead (just like bevel weights).
The BMesh (`freestyle`) accessors are removed too.

The conversions benefit from the fact that bit-wise, the old structs are
the same as `bool`, so we can convert to the old and new formats without
reallocating arrays.

Pull Request: https://projects.blender.org/blender/blender/pulls/141996
2025-07-16 18:26:26 +02:00
Jacques Lucke
feb4122f62 Geometry Nodes: add descriptions to various built-in geometry sockets
In some cases the description is more useful than in others. But overall it's
nice if users can expect there to be some description instead of nothing.

The goal is also to not show the supported geometry types as a separate line
in the tooltip as that can be misleading sometimes and is often redundant
with the socket name and description already. Now the description is expected
to contain the relevant data for the user. It can also be more detailed than
just mentioning which geometry types are supported.
2025-07-16 18:19:11 +02:00
Julian Eisel
c2497d16e3 Cleanup: Remove redundant parameter in new UI layout function
Mistake in 2658754324.

This was changed from a free standing to a member function during review. But
forgot to update the parameters accordingly. This can be confusing since you
can call the function on one layout, but pass it another one that it will
actually operate on.
2025-07-16 17:10:11 +02:00
Alaska
736559f320 Fix #139718: Always treat OSL cameras as inside a volume
Cycles automatically tries to decide if the camera ray should be a
surface or a volume + surface camera ray by checking to see if the
scene contains a volumetric material, and if it does, is it near
where the camera rays are expected to spawn. This step is done
during scene intialization.

With the OSL camera, it is impratical to predict where the
camera rays will spawn during scene intialization, which makes it
impratical to predict if the OSL camera ray will spawn near a
volumetric object. So this commit marks all OSL cameras as
"inside a volume", leading to the spawning of volume + surface camera
rays for OSL cameras while the scene contains a volumetric material.

This leads to increased render times ranging between 1% - 5% in scenes
that use a OSL camera, has a volumetric object in it, and the
volumetric object is far away from the camera. Every other scene should
see no performance impact.

Testing was done on a AMD Ryzen 9 5950X and a NVIDIA GeForce RTX 4090.

Pull Request: https://projects.blender.org/blender/blender/pulls/142036
2025-07-16 16:25:38 +02:00
Sebastian Parborg
89f966df4d PointCache: Explicitly warn when loading older incompatible compression settings
This should make it more obvious to the end user that they need to delete and rebake older caches.

Pull Request: https://projects.blender.org/blender/blender/pulls/142059
2025-07-16 15:55:24 +02:00
Campbell Barton
d15e7b17aa Fix #142009: Extensions/Addon Tags not showing (property not found)
Changes to the Python API [0] broke the extension tags popover
which relied on RNA properties also having ID property access.

Replace the ID property based tags with a collection.

[0]: 7276b2009a
2025-07-16 13:29:42 +00:00
Campbell Barton
bf7dd85818 Cleanup: remove redundant imports 2025-07-16 23:19:30 +10:00
Clément Foucault
ec9bef6425 Fix: GPU: Build issue caused by missing directories
When running `make` it can happen that the target directory
was not created before the invocation of `glsl_preprocess`.

This patch copies #141404 and creates the output directory
before creating the output files.
2025-07-16 14:51:33 +02:00
Namit Bhutani
8602f893ed Fix #141811: Crash with remesh operator
Fixes crash in the remesh operator by moving mesh spatial organization
to appropriate execution contexts and using proper memory handling in
spatial organization's face offset calculations.

Pull Request: https://projects.blender.org/blender/blender/pulls/141842
2025-07-16 14:27:18 +02:00
Jacques Lucke
9e1168bdfb Fix: add missing include 2025-07-16 13:13:44 +02:00
Julian Eisel
2658754324 UI: New internal API function to add a simple button
For blender/blender!141292, we need a simple icon and text button that
executes a callback on click. The size should be determined based on the
text and icon, as it's typically done with the `UI_interface_layout.hh`
API. Trying to do this with `uiDefIconTextBut()` is annoyingly
complicated, mostly because we'd have to duplicate size calculations.

Instead expand the `UI_interface_layout.hh` API to cover this.

* Allow passing a button type to `uiItemL_()` and rename it to
  `uiItem_simple()`. The code in this function is commonly useful, not
  just for label buttons. It's a convenient way to add a single button
  with normal size calculations. The function stays internal to
  `interface_layout.cc`.
* Add `uiItemBut()` as public API function to call this and assign an
  on-click callback.

No user visible changes expected.

Pull Request: https://projects.blender.org/blender/blender/pulls/141900
2025-07-16 13:10:22 +02:00
Jacques Lucke
fc05a70dcd UI: support fully custom layout tooltips
The goal is to be able to build fully custom tooltips for entire layouts (e.g.
for all `uiBut` for a socket). We already support tooltip callbacks for layouts
and fully custom tooltips for `uiBut`, however not fully custom tooltips for an
entire layout.

This will be used by #140540.

The main noteworthy thing here is that now `uiBut` is passed into the custom
tooltip function. This is necessary when the tooltip still has to be customized
for the exact hovered `uiBut`. For example, we generate a tooltip that applies
to an entire vector socket, but when hovering over e.g. the X input value, the
Python tooltip should show the path for that specific property.

This also fixes a bug in `ui_but_is_interactive_ex` which didn't consider custom
and quick tooltips before.

`uiLayoutSetTooltipCustomFunc` is pretty much the same as its non-custom
counterpart.

Pull Request: https://projects.blender.org/blender/blender/pulls/142044
2025-07-16 13:09:29 +02:00
Jacques Lucke
4f681c6141 Nodes: rename structure type to shape in node group inputs ui
This was discussed in the recent Geometry Nodes workshop. The term "shape"
is only used here because it literally affects how the socket will look like.
2025-07-16 13:01:37 +02:00
Pratik Borhade
154195eeb0 Fix #141911: Geo Nodes Input Panel crashing when name is deleted
Caused by 95259228d9
Crashed due to `sub_interface_panel.name` being nullptr.

Pull Request: https://projects.blender.org/blender/blender/pulls/141919
2025-07-16 10:35:10 +02:00
Campbell Barton
ec62b843da PyAPI: warn when PropertyGroup sub-classes don't define __slots__
Warn since this allows for confusing assignments, see #141948.
2025-07-16 17:44:06 +10:00
Campbell Barton
19ee3932c3 Fix #141948: No error on arbitrary assignments to PropertyGroup
Declare `__slots__` to prevent arbitrary assignment.
2025-07-16 17:44:06 +10:00
Omar Emara
a2cba25b14 Fix #141810: Cryptomatte crashes with image sequence
The Cryptomatte node crashes when the source is an image sequence with a
changing structure. That's because the code that identifies the EXR layer
where the Cryptomatte layers lives is not thread safe, as the render
result might change while looping over the layers. To fix this, we
acquire the render result while looping.

Pull Request: https://projects.blender.org/blender/blender/pulls/141898
2025-07-16 09:35:56 +02:00
Philipp Oeser
a3b59c82b5 Fix #141940: Copy to Selected not working on Editbone "lock" unlocking
Special case for when we do this on the "lock" property:
- locked Editbones are not in "selected_editable_bones"
- use "selected_bones" in that case

Both will go through `screen_ctx_selected_bones_` with the only
difference that the "_editable" version additionally checks
`EBONE_EDITABLE` (checks BONE_EDITMODE_LOCKED [which we want to avoid],
BONE_SELECTED [already done earlier])

Similar to 2a4f350940

Pull Request: https://projects.blender.org/blender/blender/pulls/141944
2025-07-16 09:10:52 +02:00