Commit Graph

151573 Commits

Author SHA1 Message Date
Clément Foucault
644fb2b679 Fix #98654: GPUOffScreen example has wrong color management
This was because the display shader never did the correct
color transformation.

This is a risky fix as it expects all input texture to be in
the correct colorspace (srgb). If they aren't this will
produce darker result.

If this is a huge issue we can introduce a global setting
(like line width) to set if the attached texture is
in srgb space or linear. This would avoid to change the
drawing code all over the place.

Pull Request: https://projects.blender.org/blender/blender/pulls/141237
2025-07-03 14:07:58 +02:00
Campbell Barton
e442c16fef Cleanup: resolve Python linter warnings 2025-07-03 21:05:21 +10:00
Lukas Tönne
10e36132dc Merge branch 'blender-v4.5-release' 2025-07-03 12:14:24 +02:00
Lukas Tönne
7b403a2b10 Fix #141261: Support outline generation for single point curves
The outline perimeter generation was exiting without result for any
curve with less than two points. For single-point curve a simple circle
is now generated with the same resolution as two caps/corners combined.

Co-authored-by: Falk David <falk@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/141380
2025-07-03 12:13:27 +02:00
Sybren A. Stüvel
282a99d99f Merge remote-tracking branch 'origin/blender-v4.5-release' 2025-07-03 12:07:00 +02:00
Damien Picard
7f0d15b31f Python: Add new APIs to collection.exporters
Add three new RNA functions to `bpy.types.CollectionExports`:
- `collection.exporters.new('IO_FH_alembic', name="Alembic")`
- `collection.exporters.remove(exporter)`
- `collection.exporters.move(0, 1)`

which allow to respectively create, remove, and reorder collection
exporters. Previously, they were only achievable using operators and
not the Python data API.

Example usage:

```python
C.collection.exporters.new("test")
# Traceback (most recent call last):
#   File "<blender_console>", line 1, in <module>
# TypeError: CollectionExports.new(): error with argument 1, "type" -
#   enum "test" not found in ('IO_FH_alembic', 'IO_FH_usd',
#   'IO_FH_obj', 'IO_FH_ply', 'IO_FH_stl', 'IO_FH_fbx')

usd_exporter = C.collection.exporters.new('IO_FH_usd')
usd_exporter.filepath = "//exp.usd"

stl_exporter = C.collection.exporters.new('IO_FH_stl')

C.collection.exporters.move(0, 1)
C.collection.exporters.remove(stl_exporter)
```

The exporter UIList was updated to add arrows calling the move
operator.

Co-authored-by: Pratik Borhade <pratikborhade302@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/141076
2025-07-03 11:58:07 +02:00
Sybren A. Stüvel
d08c4e8cc9 Fix: Overlay: Invalid RGB order in overlay theme colors
Fix an accidental swap of the green & blue channel when drawing theme-
colored elements in the overlay engine.

Thanks @fclem for finding the issue.

Pull Request: https://projects.blender.org/blender/blender/pulls/141382
2025-07-03 11:57:33 +02:00
Pratik Borhade
c04bb9dee9 Merge branch 'blender-v4.5-release' 2025-07-03 14:57:46 +05:30
Pratik Borhade
fa1f9226d7 Fix #140845: Outliner: Allow reordering linked collections
Drag-drop operation of outliner doesn't allow dragging linked collection
ID. Poll function returns false for non-editable IDs. This make
sense if drop target is `INTO` linked collection.To fix this, support
drag-drop operation for `before/after` case and return false when
insert type is `TE_INSERT_INTO`.

Pull Request: https://projects.blender.org/blender/blender/pulls/140848
2025-07-03 11:26:53 +02:00
Thomas Dinges
b5c0f2dc32 Merge branch 'blender-v4.5-release' 2025-07-03 11:16:04 +02:00
Thomas Dinges
c94d5340b6 Cleanup: Make format 2025-07-03 11:14:58 +02:00
Campbell Barton
f0df1f5f38 Merge branch 'blender-v4.5-release' 2025-07-03 18:39:27 +10:00
Campbell Barton
9ba5963a1e Merge branch 'blender-v4.5-release' 2025-07-03 18:39:23 +10:00
Campbell Barton
62c063820c Merge branch 'blender-v4.5-release' 2025-07-03 18:39:21 +10:00
Campbell Barton
9a1ae5b514 Merge branch 'blender-v4.5-release' 2025-07-03 18:39:19 +10:00
Sybren A. Stüvel
90c05aa2d0 Tools: add option to weekly log generator to only show a single day
Add a new CLI option `--date YYYY-MM-DD` to the weekly log generator. Using
it will make it ignore the `--weeks-ago` parameter, and just show the
activity for that specific day.

This is just something I personally found useful, to occasionally inspect
a specific date (WBSO daily log).

Pull Request: https://projects.blender.org/blender/blender/pulls/141281
2025-07-03 10:38:13 +02:00
Campbell Barton
def2db3bdb Build: resolve error building without TBB 2025-07-03 18:36:29 +10:00
Andrej730
1a9e90e965 PyDoc: bpy_struct, add missing types and more explicit signatures
- `bpy_struct.id_data` - provide a type.
- `bpy_struct` - add missing return types to
  `bpy_struct.get`, `bpy_struct.pop`, `bpy_struct.path_resolve`.
- `bpy_struct` - add missing argument types to some methods.
- `bpy_struct` - provide explicit `/` and `*` in signatures to make it
  clear which arguments are positional / keyword-only.

Ref !141334
2025-07-03 18:25:09 +10:00
Bastien Montagne
841b518bf6 Refactor: Make Main struct a non-trivial C++ one.
Allows to use regular constructor/destructors. And standard CPP data
like string, maps, etc.

Main is defined as non-movable and non-copyable for the time being.

The existing creating/deleting API is kept as-is, moving to direct
MEM_new/MEM_delete usages in the code is kept as a later cleanup commit.

The 'ListBase' of split-by-libraries Mains has been replaced by a VectorSet.

This is an unfortunate consequence of making Main a non-trivial C++
struct: it is no more guaranteed that next/prev pointers required for
ListBase remain immediately at the top of the struct anymore - and on
Windows they indeed don't.

So move to a more modern form of storage for split-by-libraries mains,
with a few other related changes to internal readfile code.

WARNING: This is quite a sensitive change, extensively tested locally
(including library-related changes across undos and redos, in complex
production scenes).

Pull Request: https://projects.blender.org/blender/blender/pulls/141086
2025-07-03 10:22:30 +02:00
Campbell Barton
4127f5c47c Extensions: suppress errors printed because of missing directories
When dropping an extension onto Blender, the URL lookup would print
errors to the STDOUT if a repository directory was missing.

While this didn't break installation, these kinds of errors should
only be shown when the directory is expected to exist.

The issue was raised in #141212.
2025-07-03 18:21:16 +10:00
Campbell Barton
6f954e5c1a Extensions: strip the "www." prefix when creating repository names
Exclude this prefix as it's not useful to include in the name.
The issue was raised in #141212.
2025-07-03 18:21:16 +10:00
Campbell Barton
e0d2a0bc1a Fix URL's in extension errors accessing remote data
The base URL was used when reporting errors accessing a URL,
use the full URL being accessed instead since anything else
is misleading, the full URL is needed to troubleshoot issues.
2025-07-03 18:21:16 +10:00
Jeroen Bakker
b1fc86cc75 Merge branch 'blender-v4.5-release' 2025-07-03 09:56:23 +02:00
Jeroen Bakker
eeb2dc8a9e Fix #141305: Vulkan: Animation player memory leak
When playing back render result a separate process is started for
playback. This process didn't call the GPU_context_frame_begin/end
functions resulting in post-poning destroying discarded resources until
the playback process was 'exited'.

Pull Request: https://projects.blender.org/blender/blender/pulls/141376
2025-07-03 09:55:09 +02:00
Jeroen Bakker
5e17f5f41a Fix #141347: Assert in polybuild
Polybuild didn't select a point shaders when
drawing points.

Pull Request: https://projects.blender.org/blender/blender/pulls/141373
2025-07-03 09:54:45 +02:00
Jeroen Bakker
2d00580471 Fix #141274: Assert drawing debug drivers
Fixes an assert when drawing debug drivers. Here a poly shader was used
to draw points. This isn't valid and Vulkan backend warns developers
about it.

Pull Request: https://projects.blender.org/blender/blender/pulls/141372
2025-07-03 09:54:21 +02:00
YimingWu
95259228d9 Fix #140430: Nodes: Hide panel names when socket is shown on modifier UI
Previously, if a socket inside a panel has the same name prefix as the
panel name, the panel name will be removed from socket names when
displayed inside nodes, but this is not done when displaying them on the
modifier interface, which is too verbose visually. Now panel names are
removed from these property labels as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/140448
2025-07-03 08:58:34 +02:00
Campbell Barton
e48dd42804 Merge branch 'blender-v4.5-release' 2025-07-03 14:53:51 +10:00
Campbell Barton
a375f4ce7b Merge branch 'blender-v4.5-release' 2025-07-03 14:53:44 +10:00
Campbell Barton
2a54251df9 Merge branch 'blender-v4.5-release' 2025-07-03 14:53:36 +10:00
Campbell Barton
b50a525076 Fix #141336: Modeling: Don't assume gizmo available in polybuild tool
Check the polybuild gizmo is drawn before using it,
also account for it being empty (the cause of the crash), although this
shouldn't happen in practice.
2025-07-03 14:50:23 +10:00
илья _
9c30e3577e Fix: Nodes: Correct label translation
Use `N_` for default labels in case value is invalid.
So no double translation.

Synchronize translation context with related property if exist.
So enum item translated like property with such enum.

Use nodes context for zone labels.

Pull Request: https://projects.blender.org/blender/blender/pulls/138393
2025-07-03 05:27:03 +02:00
Campbell Barton
21e9be6c5e UI: show the ~/ abbreviation for $HOME in the title on Unix systems
Avoid overly long paths in the title bar using the `~` prefix.

Based on feedback from !141059 there is consensus on supporting this
on Linux, that PR also supports abbreviations on other systems but
platform maintainers had concerns (see PR for details).

Apply the functionality for generic Linux/Unix systems,
the functionality for other platforms can be evaluated separately.
2025-07-03 02:50:38 +00:00
YimingWu
abbd4eb9b8 Fix (unreported): Prevent crash when duplicating linked collections
If any of the selected collection entries in the outliner is a linked
collection, `outliner_collection_from_tree_element` can return null and
it will crash in `BKE_collection_child_find`. This patch handles this
case by skipping those entries and modified the warning message to show
how many selected entries have failed.

----

This is how the message looks like now:

<img width="746" alt="image.png" src="attachments/b91f2a64-7f2d-42d4-8657-7deaf00e90b6">

Pull Request: https://projects.blender.org/blender/blender/pulls/140847
2025-07-03 09:53:13 +08:00
YimingWu
8a3d773b16 Fix (unreported): Prevent crash when duplicating linked collections
If any of the selected collection entries in the outliner is a linked
collection, `outliner_collection_from_tree_element` can return null and
it will crash in `BKE_collection_child_find`. This patch handles this
case by skipping those entries and modified the warning message to show
how many selected entries have failed.

----

This is how the message looks like now:

<img width="746" alt="image.png" src="attachments/b91f2a64-7f2d-42d4-8657-7deaf00e90b6">

Pull Request: https://projects.blender.org/blender/blender/pulls/140847
2025-07-03 03:51:56 +02:00
Andrej730
560e81075a Fix: PyDocs - add missing Context.copy() return type
Ref !141359
2025-07-03 10:59:17 +10:00
Andrej730
b06bf220b9 Fix: PyDocs - add missing Context.copy() return type
Ref !141359
2025-07-03 10:15:32 +10:00
Jonas Holzman
95abfc00a5 Merge branch 'blender-v4.5-release' 2025-07-03 00:07:52 +02:00
Jonas Holzman
b0ffd4cb07 Fix: macOS: Support multi-monitor window positioning
This commit brings multi-monitor window positioning support to the macOS
GHOST backend. This fixes a plethora of issues with macOS window
creation and positioning, such as:

 * Windows not being properly restored when loading a file with Load UI
 * Users default startup windows not being properly restored on multiple
   screens
 * Temporary windows (Settings, Render, Playblast, etc..) wrongly
   appearing in unexpected places / other screens
 * Duplicating an area into a new window (AKA popping out an editor) not
   working on non-primary screens.
 * etc..

Internally, this makes all macOS windows coordinates be relative to the
user primary monitor, instead of being local to the currently focused
one. I have tested this to properly work using all sorts of multiple
screen arrangements, and can also confirm that restoring windows from
screens that do not exist anymore / are now out of bounds (due to being
unplugged or re-arranged) also works properly, in which case they get
snapped back to the closest available screen similarly to other backends.

This fixes issue #126410 and implements behavior described in TODO task #69819.

Pull Request: https://projects.blender.org/blender/blender/pulls/141159
2025-07-03 00:05:52 +02:00
Sean Kim
412452fe39 Cleanup: Add comments for adjacency maps in SubdivCCG
Pull Request: https://projects.blender.org/blender/blender/pulls/141306
2025-07-02 20:59:30 +02:00
Hans Goudey
f3399a41e2 Fix #141355: Set attribute operator broken for meshes
Mistake in 1f92fd7577

Also unify the code a bit between geometry types.
2025-07-02 12:40:00 -04:00
Guillermo Venegas
d00a0f29b4 UI: Make uiLayout NonCopyable and NonMovable
Almost all uiLayout methods that creates sub-layouts returns a uiLayout
reference, API users must use the returned sub-layout to add items,
this prevents a accidental copy that could break Blender.

Pull Request: https://projects.blender.org/blender/blender/pulls/141051
2025-07-02 18:31:04 +02:00
Julien Duroure
2aed558f08 Fix #141345 - glTF: Fixes after recent Blender changes on IDprops 2025-07-02 18:04:00 +02:00
Clément Foucault
f5022c14ab Merge branch 'blender-v4.5-release' 2025-07-02 17:47:14 +02:00
Clément Foucault
bdad5325a7 Fix #141112: Plane Probe is cut off in camera view if Shift X/Y in certain way
Previous fix 531bc5ca69 broke the tracing part of planar
probe. This is because the code was relying on assumption that
are no longer true. Fix this by passing the correct
projection matrix and inverse proj mat to the tracing code.

Pull Request: https://projects.blender.org/blender/blender/pulls/141349
2025-07-02 17:46:45 +02:00
Clément Foucault
b30938a15f Fix #141112: Plane Probe is cut off in camera view if Shift X/Y in certain way
Previous fix 531bc5ca69 broke the tracing part of planar
probe. This is because the code was relying on assumption that
are no longer true. Fix this by passing the correct
projection matrix and inverse proj mat to the tracing code.

Pull Request: https://projects.blender.org/blender/blender/pulls/141349
2025-07-02 17:45:41 +02:00
Jacques Lucke
ebf9449518 Fix #141070: missing viewport update after disabling viewer
Pull Request: https://projects.blender.org/blender/blender/pulls/141320
2025-07-02 17:32:37 +02:00
Falk David
56dc3539ce Merge branch 'blender-v4.5-release' 2025-07-02 17:17:24 +02:00
Falk David
92d72467a7 Fix #141222: Assert hit when resizing CurvesGeometry to 0
The `CurvesGeometry::resize` function would not work properly when
passing a new size of zero.
1) The `CustomData_realloc` would allocate an array with zero size.
2) A new size of 1 is passed to `implicit_sharing::resize_trivial_array`
   for the curve offsets when it should pass 0.
3) A value is written out-of-bounds to `curve_offsets`

This fixes the issues in the following ways:
1) `CustomData_realloc` now doesn't allocate any data when the new
    size is 0 and sets the `layer->data` to `nullptr`.
2) When the new number of curves is 0, resize the `curve_offsets` to 0
  not to 1. This also ensures that the data pointer is `nullptr`.
3) Make sure to only write the first and last curve offset when the
  number of curves is greater than 0.

Pull Request: https://projects.blender.org/blender/blender/pulls/141333
2025-07-02 17:16:50 +02:00
Hans Goudey
9e2ffcf7b6 Merge branch 'blender-v4.5-release' 2025-07-02 10:55:51 -04:00