Commit Graph

152098 Commits

Author SHA1 Message Date
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
Jacques Lucke
f7f18cd0c7 Nodes: initial support for built-in menu sockets
So far, only node group were able to have menu input sockets. Built-in nodes did
not support them. Currently, all menus of built-in nodes are stored on the node
instead of on the sockets. This limits their flexibility because it's not
possible to expose these inputs.

This patch adds initial support for having menu inputs in built-in nodes. For
testing purposes, it also changes a couple built-in nodes to use an input socket
instead of a node property: Points to Volume, Transform Geometry, Triangulate,
Volume to Mesh and Match String.

### Compatibility

Forward and backward compatibility is maintained where possible (it's not
possible when the menu input is linked in 5.0). The overall compatibility
approach is the same as what was done for the compositor with two differences:
there are no wrapper RNA properties (not necessary for 5.0, those were removed
for the compositor already too), no need to version animation (animation on the
menu properties was already disabled).

This also makes menu sockets not animatable in general which is kind of brittle
(e.g. doesn't properly update when the menu definition changes). To animate a
menu it's better to animate an integer and to drive an index switch with it.

### Which nodes to update?

Many existing menu properties can become sockets, but it's currently not the
intention to convert all of them. In some cases, converting them might restrict
future improvements too much. This mainly affects Math nodes.

Other existing nodes should be updated but are a bit more tricky to update for
different reasons:
* We don't support dynamic output visibility yet. This is something I'll need to
  look into at some point.
* They are shared with shader/compositor nodes, which may be more limited in
  what can become a socket.
* There may be performance implications unless extra special cases are
  implemented, especially for multi-function nodes.
* Some nodes use socket renaming instead of dynamic socket visibility which
  isn't something we support more generally yet.

### Implementation

The core implementation is fairly straight forward. The heavy lifting is done by
the existing socket visibility inferencing. There is a new simple API that
allows individual nodes to implement custom input-usage-rules based on other
inputs in a decentralized way.

In most cases, the nodes to update just have a single menu, so there is a new
node-declaration utility that links a socket to a specific value of the menu
input. This internally handles the usage inferencing as well as making the
socket available when using link-drag-search.

In the modified nodes, I also had to explicitly set the "main input" now which
is used when inserting the node in a link. The automatic behavior doesn't work
currently when the first input is a menu. This is something we'll have to solve
more generally at some point but is out of scope for this patch.

Pull Request: https://projects.blender.org/blender/blender/pulls/140705
2025-07-16 08:31:59 +02:00
Campbell Barton
c3cdc11283 CMake: quiet build warnings from fmtlib
Reference fmtlib as a system include to suppress noisy messages.
2025-07-16 15:32:03 +10:00
quackarooni
5bb21bfa07 Fix #141610: Nodes: Active selection points to internal toggle socket after running "Remove Item"
Panel toggles are implemented by having a boolean socket with
`is_panel_toggle` set to `True`, as the first item in that panel's children.
These sockets are then hidden from the user, as the checkbox gets drawn
in the panel's UI.

In specific circumstances described in the bug report, the active selection
can sometimes land on these sockets. Leading to the user being able to
directly access these internal sockets.

The changes in the patch make the "Remove Item" operator check if
the resulting selection lands in a toggle socket, and move the selection
to that toggle's parent panel if that is the case.

Pull Request: https://projects.blender.org/blender/blender/pulls/141859
2025-07-16 07:11:14 +02:00
Campbell Barton
75dd3bc1e0 Viewport: respect grid scale in walk-mode for heights & gravity
Navigating around a larger/smaller scene wasn't scaling the height
& gravity by the grid size.
2025-07-16 04:59:02 +00:00
Campbell Barton
bedaafee78 Fix #138359: Walk teleport fails when the scene scale isn't 1.0
Teleport was either moving too far or not far enough with a scaled
scene. Remove scene scaling in this case it doesn't make sense when
interpolating between two points.
2025-07-16 14:54:22 +10:00
John Kiril Swenson
d910fb88b0 VSE: Clamp strip handles to video/audio bounds
This initial commit properly clamps handles for video/audio strips, and
provides functionality to enable/disable the behavior for all strip types
(addresses #90280).

Toggling handle clamping is done with "C",
just like with the redesigned slip operator (#137072).

If a strip is not already clamped when you start moving its handles,
then clamping behavior is disabled starting out. This means no abrupt
clamp until you explicitly ask for it.

Transform logic was altered, fixing a few bugs:
- When initializing a transform, `createTransSeqData` would already
  create some clamping data for channels. This patch replaces it with
  `offset_clamp` (for unconditional clamping which cannot be disabled)
  and `handle_xmin/xmax` (for hold offset clamping, which is optional).
    - Collecting this data ahead of time is necessary for the double
      handle tweak case -- `flushTransSeq` only works one strip at a
      time, so we can't clamp post-hoc.
- In `applySeqSlideValue`, we apply `transform_convert_sequencer_clamp`
  before values are printed to the header, but let the unclamped values
  get flushed to the strips themselves. This is so that we can have the
  data later at the individual strip level to recalculate clamps.
  Otherwise, if transform values are clamped preemptively, then we have
  no idea whether strips are clamped vs. merely resting at their
  boundaries.

Note that currently, handle clamping is drawn identically to overlaps.

More information in PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/134319
2025-07-16 06:16:19 +02:00
John Kiril Swenson
1cb30b9d1e Fix: VSE: Metastack channel preview with negative values
As mentioned in comments on #43646, a negative channel value in preview
view settings can be used to climb the metastack. But the functionality
did not work as expected in most cases.

This combines a one-line fix by Sergey with an updated description for the
property which documents the feature.

In the future we may want to change its operation to be less obscure,
since it has some use-cases in aligning strips within a metastrip with
those outside of it.
2025-07-16 06:12:09 +02:00
Germano Cavalcante
dfd4d2914f Refactor: Bypass DEG_foreach_dependent_ID_component when not needed
The `DEG_foreach_dependent_ID_component` is only used to mark objects
whose base will have `BA_SNAP_FIX_DEPS_FIASCO`.

If this flag is not used, the `DEG_foreach_dependent_ID_component` is
also not needed.
2025-07-15 20:18:57 -03:00
Germano Cavalcante
a2a2638a57 Fix: Assert finishing transformation with an 'Affect Only' option active
Attempt to use C-style MEM_freeN on a pointer created with CPP-style
MEM_new

Pull Request: https://projects.blender.org/blender/blender/pulls/141999
2025-07-15 23:54:48 +02:00
Hans Goudey
0781b90962 Cleanup: Formatting 2025-07-15 17:24:46 -04:00
Clément Foucault
4ebaee0aa1 Fix #106312: Workbench: Texture interpolation is shared across material
This was caused by the Material Sub pass being
shared for all materials using a same texture.
This patch simply adds the sampler state inside the
Map key. This will create one unique subpass for each
texture and for each sampler state.

Pull Request: https://projects.blender.org/blender/blender/pulls/141978
2025-07-15 22:47:17 +02:00
Hans Goudey
2cf9cba182 Cleanup: Remove else after return 2025-07-15 16:37:37 -04:00
Hans Goudey
98a1816e01 Cleanup: Clarify comment position in custom data type conversion 2025-07-15 16:37:37 -04:00
RedMser
e9d1fa944e Fix #138863: Filter Out Archives When Adding Quick Access Items on Windows
On Windows, filter out the most common archive file formats when adding
OS Quick Access items to the File Browser's system list. These items
can be opened like folders in the OS, but not within File Browser.

Pull Request: https://projects.blender.org/blender/blender/pulls/138884
2025-07-15 22:01:13 +02:00
Germano Cavalcante
bda79fe4c3 Fix #121266: Snap toggle in UI not updating during transform
During transform operations, the 'Snap Toggle' shortcut
(default: Shift + Tab) enables or disables snapping.

Previously, the UI did not reflect the toggle state until the operation
was finished.

It now updates live during the operation.
2025-07-15 16:51:30 -03:00
Harley Acheson
eed8683234 Fix #141885: Do Not Clip Panel Title If No Drag Widget
Changes in ca3076ed35 clips panel titles at the left edge of the drag
widget. This PR only does this when there actually is a drag widget.

Pull Request: https://projects.blender.org/blender/blender/pulls/141979
2025-07-15 20:37:17 +02:00
Jesse Yurkovich
a8668ddbd5 Fix: Use correct thin-film setup for MaterialX glass bsdf
Broken by cf92af3ac4

The `thin_film_bsdf` node no longer exists in the version of MaterialX
that we use. It's been removed in favor of specifying the thin-film
values directly on the `dielectric_bsdf`, `conductor_bsdf`, or
`generalized_schlick_bsdf` nodes.

There is another use of the node inside the Principled BSDF's `BSDF`
output case. The `Surface` case is correct but the BSDF layering setup
still needs addressed. This PR will get the tests passing though.

Pull Request: https://projects.blender.org/blender/blender/pulls/141974
2025-07-15 20:28:45 +02:00