Commit Graph

153108 Commits

Author SHA1 Message Date
Jeroen Bakker
e83cce910d Fix #144700: Incorrect operator model draw example
The example script for the Model Draw Operator was out of date. It
didn't used the polyline shader. This PR updates the example to use the
polyline shader.

Pull Request: https://projects.blender.org/blender/blender/pulls/144722
2025-08-19 07:42:44 +02:00
nutti
99aa76035d Fix: typo in mathutils.Vector doc-string
Ref !144731
2025-08-19 02:36:42 +00:00
Campbell Barton
087c442567 Build: unbreak lite builds (WITH_TBB=OFF) 2025-08-19 12:31:17 +10:00
илья _
ca60419b3a Mesh: Avoid mutex lock in hot loop for custom normals
Use a thread local buffer to gather info about the custom normal space
for each corners group in threading to concatenate them later. This
avoids need to lock a mutex to write into a buffer shared betwen threads
in the corner groups traversal hot loop.

The performance improvement depends on the mesh size and the number of
CPU threads. In some files there might be no change, in other files an
improvement of over 2x was observed, mostly because we can now remove
the compromise from c8a4026984.

Pull Request: https://projects.blender.org/blender/blender/pulls/144660
2025-08-19 03:46:03 +02:00
John Kiril Swenson
5a0c0826b7 VSE: Support adding multiple images
Before, trying to add multiple strips would always create an image
sequence. This patch allows images to be added in bulk, just like movie
& sound strips.

A new "Image Sequence Detection" property has been added which works
like the image editor. Toggling it off will always import individual
images and never create image sequences.
If it's on, you can also optionally "Use Placeholders" to fill in gaps,
which exhibits the same behavior as before (placeholders will show as
pink in the preview until you have the files on your system in the right
folders).

You can even add both image sequences and regular images at the same
time. Only caveat is that this doesn't work if the regular images are
interspersed within sequence frames in the file browser view when you
add them. I.e., all frames of a sequence should be listed without any
regular frames in between (but the sequence frame numbers don't have to
be in order). This can usually be ensured on all sort types (like date,
name).

NOTE: This patch also replaces the "end_frame" property on image /
effect strips with "length," to support behavior when multiple strips
are involved. This is a breaking change for the API, but is a fairly
small change and will be included in the release notes.

The "length" property allows one to adjust all image strips' lengths at
once. It does nothing for image sequences, however, since their lengths
are defined by their image count.

Pull Request: https://projects.blender.org/blender/blender/pulls/143974
2025-08-19 00:09:04 +02:00
John Kiril Swenson
644fcd6bfb Cleanup: VSE: Reorganize and clean up sequencer add code
- Deduplicate `scale_fit_methods` enum
- Reorder functions, polls, and code to locations that make sense
- Rename some functions to remove `seq` terminology in favor of `strip`
- Renames `len` in `LoadData` to `count` for images
- Add clarifying comments and improve descriptions
2025-08-18 15:10:42 -06:00
John Kiril Swenson
4254730b20 Cleanup: VSE: Add Doxygen sections to sequencer_add.cc 2025-08-18 15:10:41 -06:00
Hans Goudey
76c5bdf0be Refactor: Clear Panel and ARegion runtime pointers when writing files
Avoid writing unnecessary pointers to blend files.

Pull Request: https://projects.blender.org/blender/blender/pulls/144743
2025-08-18 20:56:40 +02:00
Hans Goudey
178eca9427 Refactor: Move various window manager runtime pointers out of DNA
All of these pointers were cleared on file read. It's clearer to just
move them to the runtime struct.

Pull Request: https://projects.blender.org/blender/blender/pulls/144729
2025-08-18 20:44:44 +02:00
Brecht Van Lommel
2615cecf10 Refactor: Cycles: Align log levels with CLOG
WORK -> DEBUG
DEBUG, STATS -> TRACE

Pull Request: https://projects.blender.org/blender/blender/pulls/144490
2025-08-18 20:22:44 +02:00
Brecht Van Lommel
6d6c950750 Fix #144543: Cycles NanoVDB render error with empty volume grid
Thanks to Weizhen for finding the cause.

Pull Request: https://projects.blender.org/blender/blender/pulls/144735
2025-08-18 20:21:44 +02:00
Brecht Van Lommel
05c7ec3a2f Fix: View transforms do not match display device in image save
In the image save operator, the view transforms did not match the display.

Use RNA ancestors to guess the right matching view and display settings.

Pull Request: https://projects.blender.org/blender/blender/pulls/144734
2025-08-18 20:20:59 +02:00
Hans Goudey
56646137fe Refactor: Move some wmWindowManager runtime lists out of DNA
Mainly for the purpose of #127706, though there's plenty more runtime
data to move to the runtime struct out of DNA.

Pull Request: https://projects.blender.org/blender/blender/pulls/144691
2025-08-18 16:13:07 +02:00
Hans Goudey
a5d5eca487 Cleanup: Sequencer: Replace seqbasep variable access with function
With the aim of removing `seqbasep` to remove the complicated logic for
repairing pointers within the `Strip` struct when loading files and undo
steps, this commit just moves access of the variable behind a function.
In the future the function will retrieve the list from a Strip pointer,
for now it just returns the existing pointer.

Overall motivation is that blend file pointer manipulation is incompatible
with the changes required for #127706.

Pull Request: https://projects.blender.org/blender/blender/pulls/144624
2025-08-18 15:39:58 +02:00
Clément Foucault
e05089362c GPU: Shader: Add support for enum class
In the process, refactor the enum processing
using the new parser.

Pull Request: https://projects.blender.org/blender/blender/pulls/144704
2025-08-18 13:50:49 +02:00
Jacques Lucke
a065d16ef4 Fix: Geometry Nodes: crash accessing empty instances 2025-08-18 13:16:58 +02:00
Clément Foucault
dce0fa115f GPU: Shader: Preprocess: Improve error reporting
This makes the new parser code output correct errors.

Also simplify error logging.

Simplify a few things inside the parser interface.
Add debug string to the `Token` and `Scope`.

Pull Request: https://projects.blender.org/blender/blender/pulls/144708
2025-08-18 12:02:26 +02:00
Bastien Montagne
7997ff94dc I18N: Updated UI translations from git/weblate repository (5aae94a85f408). 2025-08-18 11:58:43 +02:00
Jeroen Bakker
066280446c Vulkan: Enable maintenance4 in VMA
VK_KHR_maintenance4 is enabled when available. VMA isn't aware that we
enabled it and could still use less optimized code-paths. This PR will
inform VMA that it can use the optimized code-paths.

The improvement is that we can decide in which memory area a specific
resource will be allocated, without the need of allocating the resource
header (VkImage/VkBuffer).

Pull Request: https://projects.blender.org/blender/blender/pulls/144552
2025-08-18 09:52:08 +02:00
Aaron Carlisle
ecba348b73 Docs: Update RNA to user manual URL mapping 2025-08-18 00:21:07 -04:00
Jesse Yurkovich
d4b0f02f72 Fix: Incorrect attribute type check during USD shape import
Accidentally changed in 1f92fd7577 and only noticed because there was a
suspicious drop in code coverage for the affected file.

Fix and add tests to ensure it doesn't happen again.

Pull Request: https://projects.blender.org/blender/blender/pulls/144702
2025-08-18 06:16:57 +02:00
Harley Acheson
35d84e3336 UI: Warning When Dragging Non-Blend File Onto Executable
Dragging a non-Blend file onto the Blender executable currently
silently fails with Blender just aborting. With this PR any files used
as file argument will load Blender and show a warning if the file does
not exist or is not a blend file. Blend files that cannot be read are
treated as they are now.

Pull Request: https://projects.blender.org/blender/blender/pulls/139128
2025-08-18 02:18:39 +02:00
Sean Kim
98869c514a Fix: Annotate tool in Image Editor shows brush properties & errors
Pull Request: https://projects.blender.org/blender/blender/pulls/144658
2025-08-18 01:16:42 +02:00
Sean Kim
1c8bee7da2 Fix: Grease Pencil panels / buttons not displaying
Introduced with a combination of 6957242a53 and 4434a30d40

Pull Request: https://projects.blender.org/blender/blender/pulls/144654
2025-08-18 00:27:35 +02:00
илья _
dba072ef93 Mesh: Avoid quadratic vertex valence complexity for corner normals
We have a set of corners around some vertex. They have arbitrary
connectivity between each other and form a set of linked lists through
shared smooth edges. We have to linearly traverse each of these lists to
mix the normals. And as a way to iterate over all these lists mixed in
some index space we use a mask of already visited corners. So we take
the first non-checked corner by mask lookup. And this lookup starts from
the beginning every time even if we know there is no way to find any
elements before current one. In a synthetic example with 20k fan fill
of circle this gives a 8x speed up.

Pull Request: https://projects.blender.org/blender/blender/pulls/144649
2025-08-17 20:11:40 +02:00
Hans Goudey
072d251b8e Refactor: Use optional Span instead of empty Span with no attribute
The semantics of checking "has_value()" (etc.) are much better than
checking for an empty span when dealing with the result of an attribute
lookup. This mainly affects the Bezier curve handle position attributes
currently. Plenty of places assume those attributes exist now. In a
couple places the code is a bit safer now, otherwise it's just a bit
more obvious.

Pull Request: https://projects.blender.org/blender/blender/pulls/144506
2025-08-17 18:08:18 +02:00
Nika Kutsniashvili
15567f597d UI: Remove unused theme properties
There are many accumulated unused properties in theme. Generally, it's a mess,
lot of copy-paste errors and leftovers between editors, shared functions with no
actual use, etc. Some were just added and never used, like Pattern and Layout nodes,
which were meant to be used with Texture Nodes I believe, but it never happened.

Overall 19 properties removed:

- 3D Viewport: Edge UV Face Select
- 3D Viewport: Last Selected Point

- Dope Sheet/Timeline: Value Sliders
- Dope Sheet/Timeline: View Sliders
- Nonlinear Animation: View Sliders
- Video Sequencer: Window Sliders
- Graph Editor/Drivers: Window Sliders

- Graph Editor/Drivers: Vertex Bevel
- Graph Editor/Drivers: Vertex Group Unreferenced
- Image/UV Editor: Vertex Bevel
- Image/UV Editor: Vertex Group Unreferenced

- Image/UV Editor: Freestyle Face Mask
- Image/UV Editor: Face Retopology
- Image/UV Editor: Face Orientation Front
- Image/UV Editor: Face Orientation Back

- Node Editors: Selected Text
- Node Editors: Pattern Node
- Node Editors: Layout Node

- Video Sequencer: Draw Action

---

Details:
- Made Vertex Bevel and Vertex Group Unreferenced colors in `rna_def_userdef_theme_spaces_vertex`
optional, so that they don't appear in Graph Editor and UV Editor theme properties, where they're unused.
- Same thing in `rna_def_userdef_theme_spaces_face` for face attributes (Freestyle Mark, Retopology),
so that they don't appear in UV Editor, where they're unused. Also did same for face orientation colors,
but used different argument for them, since they could be used in future (remember seeing PR for this).

Pull Request: https://projects.blender.org/blender/blender/pulls/143782
2025-08-17 15:39:39 +02:00
Ramon Klauck
5dc5bd5a2b VSE: Add "Mirror" menu to preview strip menu
This PR adds a "Mirror" menu to the Strip menu within the VSE preview.
This menu is similar to the "Mirror" menu in the view3d "Object" menu.
It allows the user to access the mirror operator through a menu, rather
than via a shortcut.

Pull Request: https://projects.blender.org/blender/blender/pulls/142506
2025-08-17 14:01:40 +02:00
Ramon Klauck
81380a5fc2 VSE: Enable Pie Menu on Drag for Preview Keyframe Insert
When the "Pie Menu on Drag" is active in the preferences, pressing "I"
and then moving the mouse will open a pie menu where the user can
select which keying set to key.

Pull Request: https://projects.blender.org/blender/blender/pulls/144573
2025-08-17 14:01:03 +02:00
Harley Acheson
6485722c17 UI: Use UI_alert For Vulcan Fallback Warning
This PR just updates the error message shown when the selected backend
is Vulcan but that fails and uses OpenGL instead. This currently uses a
bespoke popup alert block, but this PR replaces that with new UI_alert
function with the same wording.

Pull Request: https://projects.blender.org/blender/blender/pulls/144676
2025-08-17 02:57:24 +02:00
илья _
d65c059973 Cleanup: Mesh: Use edge_other_vert instead of ternary operator
Its generally preferable to use `edge_other_vert` if you have a set of
2 ints and know some of them and want to select other. This is
preferable since it will make a check that assumption is met and at
least one of the ints is the same as the known one. This function itself
is also made to work with topological indices so has invariant for
positive ints and can work without branches and even test instructions.

Pull Request: https://projects.blender.org/blender/blender/pulls/144631
2025-08-16 22:12:10 +02:00
Ray Molenkamp
50b86c64d2 Fix: execute_node_group only accepting positive values for arguments
Reported on chat, confirmed with the python docs which lists
cursor_position as "float array of 3 items in [1.17549e-38, inf]"

Root cause is a fun fact about floats, FLT_MIN is the smallest positive
value possible, not the largest negative value (like INT_MIN)

Pull Request: https://projects.blender.org/blender/blender/pulls/144657
2025-08-16 20:38:28 +02:00
Campbell Barton
990f0863e8 PyDoc: include buffer access in examples, cleanup
Note that buffer access is possible, also minor mathutils test cleanup.
2025-08-16 17:39:35 +10:00
Pratik Borhade
e297fb4f14 UI: Tree View: Operator to delete with X key
Tree view elements can be deleted by the remove operator located on the
right side with `-` icon. But these operators are different for every
type. Now introduced `UI_OT_view_item_delete`. With that it is possible
to delete elements with X key when mouse is over tree view. In future
maybe we could remove type specific operators (for example: `GREASE_PENCIL_OT_layer_remove`).

See video in PR description

Pull Request: https://projects.blender.org/blender/blender/pulls/144045
2025-08-16 08:21:49 +02:00
Oxicid
b856b6010e PyAPI: buffer protocol support for mathutils types
Adding buffer protocol support increases the speed of copying a Vector
(3D) array into a `numpy.array` by up to x3.8.

Ref !144401
2025-08-16 06:14:19 +00:00
Campbell Barton
ebfa7edeb1 Cleanup: use snake case, replace "m_" prefix with "_" suffix
Follow our own C++ conventions for GHOST.
2025-08-16 16:14:18 +10:00
Campbell Barton
c888bc55e7 Cleanup: quiet GCC warning 2025-08-16 16:14:18 +10:00
Harley Acheson
9a3f80b8f2 UI: Generalized Alert and Popup Block Error Indication
This PR adds an optional block alert level, defaulting to none. Then
for error-level alerts only it adds a red line and a color icon.
Dialogs with other alert types do not change at all. This also adds
a UI_alert function to create such dialogs.

Pull Request: https://projects.blender.org/blender/blender/pulls/134084
2025-08-16 02:45:36 +02:00
Sean Kim
d3712a16db Cleanup: Adjust recently added RadialControl comment
Pull Request: https://projects.blender.org/blender/blender/pulls/144596
2025-08-15 22:54:35 +02:00
илья _
0f97bbf944 Refactor: Improve packaging of curve edit draw segments in memory
Right after #143858 this refactor aim to fix issue with bezier
curve handle segments location in index buffer object.
Before there were a lot of unused segments.
Now there is no any unused bit of memory.

Pull Request: https://projects.blender.org/blender/blender/pulls/143966
2025-08-15 21:51:49 +02:00
Guillermo Venegas
ead9643fe4 Cleanup: UI: Remove uiItem::flag_ public access
Follow up from recent UI refactors.
Part of: #117604

Pull Request: https://projects.blender.org/blender/blender/pulls/143724
2025-08-15 21:50:39 +02:00
Nika Kutsniashvili
7d2b024151 UI: Theme: Move curve handle properties in common
Continuing #140360, after 39c066ee53

Moving curve handle colors & size from space editors into common theme properties.

They are now shared by 3D Viewport, Image Editor, Graph Editor, and Movie Clip Editor,
instead of each of them having their own properties.

(Video in PR)

---

Details:
- NURB U/V lines, active spline, and last selected point colors were defined
in `rna_def_userdef_theme_spaces_curves` but were optional and only called by
3D viewport. Since no other editor calls that function anymore, I removed it and
moved those properties directly inside `rna_def_userdef_theme_space_view3d`.
- In Image Editor & Movie Clip Editor (Mask mode), curves don't ever show
selection colors, and Vector handles are generally never visible, that is
bug/missing in Blender in general, not a result of this PR.
- Handle vertex size were included in Dope Sheet and NLA, where handles don't
exist. Now as a side effect they're removed as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/143762
2025-08-15 21:40:56 +02:00
Casey Bianco-Davis
a767671c56 Grease Pencil: Edit Mode Pen Tool
This adds the `Pen` tool to Grease Pencil Edit Mode.

With the pen tool you can:
- Extrude points by `Left Click`.
- Move the handles by dragging the mouse.
- Snap handles to 45 degree increments with `Shift`.
- Cycle through the handle types by `Double Clicking`.
- Add new point on segments by `Ctrl Clicking`.
- Remove existing point by `Ctrl Clicking`.
- Close a curve by clicking on one end while having the other selected.
- Move existing segment by clicking and dragging on the edge.
- Move points by clicking and dragging the mouse.

Some changes have been made compared to the legacy
curve object's pen tool:
- `Angle locking` with `Alt` was replaced with `Angle Snapping`
   using `Shift`. This was done to match the behavior of Grease Pencil
   primitive tools.
- `Move Entire Point` was changed from the `Space` key to `Alt`. This
   was done because some laptops can't move the mouse while
  `Space` is held.
- `Link Handles` and `Free Align Toggle` were not implemented.
- `Toggle Vector` and `Close Spline Method` were removed.
- `Close Spline` was removed and set to always be true.
- `Extrude Handle` type was removed as a option and was replaced
   by the `shift` modifier key when clicking.
- Newly created points are placed on the drawing plane, instead of
  the view plane.

When a new curve is created, the material will be the active material
and the radius will be set from the `radius` property.

Note: This tool is added to edit mode because it uses handle selection
and bézier overlays which currently don't exist in draw mode.
A future PR will implement a draw mode version.

Pull Request: https://projects.blender.org/blender/blender/pulls/142646
2025-08-15 18:17:09 +02:00
Weizhen Huang
3dc73a3fda Tests: update GPU volume tests
New files are added since 5646d9a5ca

Pull Request: https://projects.blender.org/blender/blender/pulls/144622
2025-08-15 18:15:34 +02:00
Pablo Vazquez
4c2169267a UI: Widen Preferences Window
The default size of the Preferences window is often not wide enough
to fit some strings under System, Keymap, and others.

Make Preferences window slightly wider, but still a conservative width
so it doesn't cover up much of the screen at the smallest recommended
screen size (1920x1080).

See PR for details and screenshots.

Pull Request: https://projects.blender.org/blender/blender/pulls/144497
2025-08-15 18:01:20 +02:00
Aras Pranckevicius
e5cc7ce59b Fix: VSE preview draw was not caching the OCIO GPU shader
IMB_colormanagement_setup_glsl_draw_to_scene_linear (only used by
VSE preview rendering) inside GPUShaderBinder::to_scene_linear_bind
was trying to cache the created OCIO GPU shader, but failed to actually
do it: it was querying scene_linear_cache, but putting the shader
into display_cache.

This lack of caching was costing around 1ms on each VSE preview draw.

Pull Request: https://projects.blender.org/blender/blender/pulls/144617
2025-08-15 15:15:08 +02:00
Clément Foucault
3c3f21ec00 GPU: Shader: Replace template macro implementation by copy paste
Use the lately introduced parser for that.

This allows to use preprocessor directive inside them.
By extension, it alows having resource accessors inside
templates.
Also error report is less confusing on most shader compilers.

The counterpart is that the shader files that are shipped
with blender are inflated.

Pull Request: https://projects.blender.org/blender/blender/pulls/144588
2025-08-15 15:13:54 +02:00
Oxicid
b1d9a91647 FBX: Add material name collision mode
Introduces the Material Name Collision option, similar to how
USD / OBJ importers have it.

Pull Request: https://projects.blender.org/blender/blender/pulls/144375
2025-08-15 15:04:36 +02:00
Thomas Hope
da46eed108 IO: Add Apply Transforms option to obj exporter
When enabled (default), exported OBJ files have the object transform
applied to their vertices. This is the previous default behaviour.

When disabled, exported vertices use their local object coordinates.

Pull Request: https://projects.blender.org/blender/blender/pulls/139436
2025-08-15 15:03:44 +02:00
Jeroen Bakker
f4103acb3f Refactor: Vulkan: Swapchain submission fence
First advance to the next frame and use the same index for all
resources. Previous implementation used a fence of the next frame, what
added confusion why that was actually needed.

Should not make a change in functionality or performance.

Pull Request: https://projects.blender.org/blender/blender/pulls/144615
2025-08-15 13:46:42 +02:00