Commit Graph

150077 Commits

Author SHA1 Message Date
Campbell Barton
0bcafe14f1 Cleanup: resolve/suppress pylint warnings 2025-03-29 11:51:04 +11:00
Campbell Barton
12e3a046a5 Cleanup: remove unused defines 2025-03-29 11:49:08 +11:00
Campbell Barton
1ad24979f7 Cleanup: correct begin/end macro use 2025-03-29 11:37:21 +11:00
Harley Acheson
13ef69dc6c UI: Remove Frame Stalk When Timelines Minimized
When various timeline-like editors are minimized to header size, also
remove the vertical stalk under the current frame indicator.

Pull Request: https://projects.blender.org/blender/blender/pulls/136698
2025-03-29 00:07:04 +01:00
Cartesian Caramel
ade8576bf7 Geometry Nodes: new Camera Info Node
This adds a new Camera Info node to Geometry Nodes. It provides information
about the passed in camera like its projection matrix and focus distance.

This can be used for camera culling which was must more complex before.
It also allows building other view-dependent effects.

Pull Request: https://projects.blender.org/blender/blender/pulls/135311
2025-03-28 22:54:13 +01:00
Jacques Lucke
98c4d107ea Fix: BLI_str_endswith returns false when both inputs are the same
Found this while reviewing #136021. It's somewhat surprising that this didn't cause issues before.

This patch also adds some unit tests for `BLI_str_endswith` and `BLI_str_startswith`.

Pull Request: https://projects.blender.org/blender/blender/pulls/136679
2025-03-28 22:48:26 +01:00
Jacques Lucke
29fddf4710 Python: Geometry: create GeometrySet wrapper for Python
In Geometry Nodes a geometry is represented by a `GeometrySet`. This is a
container that can contain one geometry of each of the supported types (mesh,
curves, volume, grease pencil, pointcloud, instances). It's possible for a
`GeometrySet` to contain e.g. a mesh and a point cloud.

This patch creates a Python  wrapper for the built-in `GeometrySet`. For now,
it's main purpose is to consume the complete evaluated geometry of an object
without having to go through complex hoops via `depsgraph.object_instances`. It
also also allows retrieving instances that have been created with legacy
instancing systems such as dupli-verts or particles.

In the future, the `GeometrySet` API could also be used for more kinds of
geometry processing from Python, similar to how we use `GeometrySet` internally
as generic geometry storage.

Since we can't really have constness guarantees in Python currently, it's
enforced that the `GeometrySet` wrapper always has its own copy of each geometry
type (so e.g. it does not share a `Mesh` data-block pointer with any other place
in Blender). Without the copy, changes to the mesh in the geometry set would
also affect the evaluated geometry that Blender sees. The copy has a small cost,
but typically the overhead should be low, because attributes and other run-time
data can still be shared. This should be entirely thread-safe, assuming that no
code modifies implicitly shared data, which is forbidden. For historic reasons
there are still cases like #132423 where this assumption does not hold in all
cases. Those cases should be fixed. To my knowledge, this patch does not
introduce any new such issues or makes existing issues worse.

Pull Request: https://projects.blender.org/blender/blender/pulls/135318
2025-03-28 22:40:01 +01:00
Sean Kim
2ad17b956a BLI: Add rolling average support to ScopedTimerAverage
Adds a new argument for the class constructor as well as a new macro to
support printing the rolling average of a number of samples intead of
the total average.

This can be useful for getting a sample of an average durations in
functions that are continually running, e.g. the main event loop.

Pull Request: https://projects.blender.org/blender/blender/pulls/136530
2025-03-28 22:28:59 +01:00
Hans Goudey
ebe7259c65 Fix #136670: Missing update after UV editor selection
Typo in 9b70851d91.
2025-03-28 16:01:21 -04:00
Hans Goudey
a1c3771492 Fix #136668: Curve to mesh crash with fill caps and no faces in output 2025-03-28 15:03:45 -04:00
Brecht Van Lommel
149df31242 Fix #136633: Missing edit mode select update when GPU subdivision disabled
Apply batch cache updates to subdivided mesh.

Pull Request: https://projects.blender.org/blender/blender/pulls/136684
2025-03-28 20:02:10 +01:00
Hans Goudey
ec2cdce657 Fix #136625: Crash switching to Texture Paint workspace
Simple mistake in 9b70851d91.
The batch creation info wasn't moved to the vector, so nothing happened;
it was never created.
2025-03-28 14:47:44 -04:00
Hans Goudey
ffef093c25 Cleanup: Draw: Remove unused mesh buffer list defines 2025-03-28 14:47:44 -04:00
Brecht Van Lommel
0fd360428a Fix #136593, #136641: Quadriflow remesh gets stuck on Windows
This appears to be a pre-existing issue that got exposed by the refactor
for some files, while for others it was already happening.

Pull Request: https://projects.blender.org/blender/blender/pulls/136680
2025-03-28 19:25:56 +01:00
Hans Goudey
448d3d04d9 Cleanup: Unify and clean up mesh transform & translation functions
Use C++ types, move to C++ header, use them consistently in the
geometry transform function.
2025-03-28 11:36:39 -04:00
Brecht Van Lommel
ac5dc94c40 Fix #136619: Stereo image saving has wrong colorspace
The logic about which buffer it's going to use for saving is quite confusing.
This simply restores the logic from before 7584ccc28d while still guarding
against accessing null buffers.

Pull Request: https://projects.blender.org/blender/blender/pulls/136659
2025-03-28 13:58:03 +01:00
Jacques Lucke
c42249705b Cleanup: move subdiv levels to end of mesh info when printing GeometrySet 2025-03-28 12:54:18 +01:00
Xavier Hallade
e00cc8c100 Cycles: oneAPI: Use default linker on Windows
The initial issues that led to the choice of forcing the use of
linker.exe seem gone and there is currently no strong reason to use
linker.exe explicitly, so let's simplify and use the default setting.
2025-03-28 12:34:16 +01:00
Leon Schittek
2204d1308d Fix: Grease Pencil: Crash when exporting PDF/SVG with sampling
The selection and lengths for the resampling of the outline were based
on the original curves rather than the generated outline curves causing
out of bounds access.

---

#### Problem
Exporting grease pencil objects and setting the "Sampling" option
to higher than 0.0 will cause a crash during export.

In a debug build the following assert is triggert:

```
BLI_assert failed: C:\Users\leons\dev\blender-git\blender\source\blender\blenlib\BLI_virtual_array.hh:625, operator [](), at 'index < this->size()'
```

##### Steps to reproduce the issue

1. Open the attached .blend file: [gp-export-resample-crash.blend](/attachments/3be6839f-3376-4d75-ad54-077f1eeab472)
2. Select the "Monkey" grease pencil object and export it as PDF or SVG
3. In the export dialog set the "Sampling" to something other than `0.0` e.g. `0.2`
4. Confirm.
5. Blender should crash.

Pull Request: https://projects.blender.org/blender/blender/pulls/136585
2025-03-28 11:20:18 +01:00
Jacques Lucke
456e28df17 Fix: Nodes: wrong placeholder in some data-block sockets
For some socket types, the placeholder was showing the type of the socket instead
of the socket label.

Pull Request: https://projects.blender.org/blender/blender/pulls/136634
2025-03-28 11:10:29 +01:00
Campbell Barton
5d232486e6 Cleanup: minor clarifications in doc-strings for NDOF & OSKEY 2025-03-28 14:06:36 +11:00
Campbell Barton
38d9d971e5 WM: add a "Hyper" capability flag
Avoids the need to check against ghost backends.
2025-03-28 13:46:39 +11:00
Campbell Barton
894dca7f76 UI: correct the keymap editor to match the OSKEY label to the platform 2025-03-28 13:26:09 +11:00
Campbell Barton
46bfd3196d Cleanup: match wmEvent::modifier type for uiButHotkeyEvent::modifier_key 2025-03-28 01:58:11 +00:00
Campbell Barton
460b1a805d Fix #134733: NDOF jumps when switching between applications
Window de-activation wasn't reliably clearing the NDOF motion state.

See code-comments for details.
2025-03-28 12:48:30 +11:00
Campbell Barton
403900909a GHOST/Win32: Set the window "inactive" on window de-activation
Match the behavior of other platforms by clearing the active window
when it's de-activated.

On Win32 Blender always considered the last-active window to be active
because de-activation wasn't handled.

Part of !136122, needed to fix #134733.

Co-authored-by: Kamil Galik <kgalik@3dconnexion.com>
2025-03-28 12:48:30 +11:00
Pratik Borhade
28704a47a1 Fix #136157: UI: Eyedropper tooltip remains visible in non-active space
When mouse is moved from one area to other of same spacetype, previous
region is not redrawn. This results in tooltip being stuck at the edge of
previous area. In such case, send a redraw call to that region.

Pull Request: https://projects.blender.org/blender/blender/pulls/136168
2025-03-28 02:03:44 +01:00
Campbell Barton
b252a6c7fb Cleanup: various non-functional changes for C++ 2025-03-28 00:59:15 +00:00
Campbell Barton
69682c78f2 Cleanup: pass values by const reference 2025-03-28 00:59:13 +00:00
Campbell Barton
90287acff2 Cleanup: remove redundant null checks
Use references instead of pointers when assigning values from struct
members, then remove the null check.
2025-03-28 00:59:12 +00:00
Campbell Barton
12e17e2477 Cleanup: use const arguments, variables 2025-03-28 00:59:11 +00:00
Campbell Barton
460a05cbbc Cleanup: match declaration names 2025-03-28 00:59:09 +00:00
Campbell Barton
f84e473b1a Cleanup: simplify check if the preferences is already shown
Minor change to !136139.
2025-03-28 11:59:06 +11:00
Sean Kim
25b6cecbb1 Cleanup: Consolidate symmetry iteration check
Removes the `SCULPT_` prefixed version and moves the function into
`paint_intern.hh` as it is shared across all mesh painting types
that support symmetry.

Pull Request: https://projects.blender.org/blender/blender/pulls/136638
2025-03-28 00:49:45 +01:00
IREXTIA
e7d1674ca6 UI: preferences.addon_show() | Skip opening another window if there's already a preferences editor in the current window
When viewing extension details, no need to call userpref_show if a
Preferences editor is in the main window, as that will just open a new
Preferences window.

Pull Request: https://projects.blender.org/blender/blender/pulls/136139
2025-03-28 00:21:11 +01:00
Brecht Van Lommel
378b4e2ca4 Refactor: Improve image buffer save/load functions in GHOST 2025-03-27 22:31:03 +01:00
Brecht Van Lommel
a02e0fa147 Refactor: Improve image buffer save/load function names and arguments 2025-03-27 22:07:51 +01:00
Brecht Van Lommel
124c0f1692 OpenColorIO: Support using file rules to detect colorspace
The Blender config.ocio does not have any rules, but custom ones can.

The default file rule is ignored if default_byte or default_float roles
exist. These roles are Blender specific, so would not be found in a typical
OCIO config. But when they are set appropriately, they help provide better
default guesses than what is possible with standard OCIO rules.

Pull Request: https://projects.blender.org/blender/blender/pulls/136516
2025-03-27 22:07:50 +01:00
Brecht Van Lommel
ccd7bc2078 Refactor: Modify colorspace handling for image buffer reading
The file formats now fill in ImColorSpaceInfo with the metadata colorspace
and a boolean saying if the pixels have HDR colors. And then the actual
colorspace is decided in imb_handle_colorspace_and_alpha.

This centralizes the logic in one place to make it possible to add
OpenColorIO file rules.

Pull Request: https://projects.blender.org/blender/blender/pulls/136516
2025-03-27 22:07:50 +01:00
Brecht Van Lommel
c225772735 Refactor: Initialize IMB module for image test
Needed for future changes, surprising that it worked without.

Pull Request: https://projects.blender.org/blender/blender/pulls/136516
2025-03-27 22:07:50 +01:00
Alex Fuller
a1b7ce1d22 Cycles: Move UV tangent computation into the core
This makes it available in Cycles standalone, and the implementation
can be shared with Blender. This also makes it possible to compute
tangents after tessellation for adaptive subdivision.

There is a difference in UV map tangents when there are no UVs. They
are now generated from object space coordinates instead of auto
texture space coordinates. This is more efficient, and a corner case
that we don't have to keep compatible.

Co-authored-by: Brecht Van Lommel <brecht@blender.org>

Pull Request: https://projects.blender.org/blender/cycles/pulls/25
2025-03-27 22:07:50 +01:00
Alex Fuller
438ac2a653 Cycles: Add OSL metadata for default geometry attributes
Add support for OSL parameter metadata named `defaultgeomprop`, whose
values are interpreted the same way as the property on MaterialX node
inputs. When set to `Tworld` the tangent is then automatically linked
to the shader and generated for the mesh.

Pull Request: https://projects.blender.org/blender/cycles/pulls/25
2025-03-27 22:07:50 +01:00
Brecht Van Lommel
47e1b24c29 Refactor: Cycles: Apply static transforms later in scene update
It makes more sense to do it after geometry processing, in particular
for the tangent computation that is coming.

Pull Request: https://projects.blender.org/blender/blender/pulls/136576
2025-03-27 22:07:50 +01:00
Brecht Van Lommel
e394fd191b Refactor: Cycles: Sync various build fixes from the standalone repository
Pull Request: https://projects.blender.org/blender/blender/pulls/136576
2025-03-27 22:07:50 +01:00
Pierre Pontier
178b0cbff9 Cleanup: Fix warnings about comparing int and size_t
Pull Request: https://projects.blender.org/blender/cycles/pulls/24
2025-03-27 22:07:50 +01:00
Brecht Van Lommel
26ccbaf8b5 Fix: Cycles build broken without OpenSubdiv 2025-03-27 22:07:50 +01:00
Richard Antalik
972fda1a7d Cleanup: Refactor VSE effect input get function
Function `strip_effect_get_new_inputs` contained selection parsing and
error handling. It also returned values by setting 3 pointer addresses.

Split function to selection parsing which returns strips in container
and validation function, which returns error string if selection is not
valid. If selection is valid, empty string is returned

Pull Request: https://projects.blender.org/blender/blender/pulls/136474
2025-03-27 22:02:38 +01:00
Jacques Lucke
8b1add3346 Refactor: Geometry Nodes: support retrieving geometry set without applying subdiv
This should ideally be used more in Geometry Nodes to avoid realizing subdiv
on the cpu if it's not really necessary. However, fully supporting it require more changes
in places that actually need the final subdivided mesh.

This also extends the "to string" conversion for `GeometrySet` to include information
about the subdivision level.
2025-03-27 20:40:58 +01:00
Jacques Lucke
94edc7e77a Geometry Nodes: add utility to ensure that no geometry components are shared 2025-03-27 20:40:58 +01:00
Leon Schittek
695acd83a6 Fix: UI: Missing node socket outline in properties editor
Set the proper outline color when drawing node sockets with
`node_socket_draw`.
This was a regression introduced by commit `13e0077c5c`.

Pull Request: https://projects.blender.org/blender/blender/pulls/136578
2025-03-27 20:33:59 +01:00