This renames `UI_block_layout` API as `blender::ui::block_layout`,
following uiLayout refactors.
This function now returns a layout reference instead of pointer,
this changes applies this return type where the layout can be used
as such reference.
Changes includes the use of `blender::ui::LayoutDirection` and
`blender::ui::LayoutType` as typed enum parameters.
Part of: #117604
Pull Request: https://projects.blender.org/blender/blender/pulls/141401
Tune the grain size used for the parallel_for to alleviate excessive
mutex contention inside `handle_fan_result_and_custom_normals`.
I happened to notice that the 4004 Moore Lane USD scene[1] experienced a
load time regression compared to the prior release. It looks due to the
grain size used and here are some 3-run averages for the import:
```
Grain | Time in seconds
256 (main) | (14.6+14.6+14.8)/3 = 14.6667
1024 | (13+12.8+12.9)/3 = 12.9
4096 | (13.3+13.1+13.1)/3 = 13.1667
16384 | (12.2+12+ 12.5)/3 = 12.2333
65536 | (9.4+9.2+9.6)/3 = 9.4
131072 | (7.9+7.7+8)/3 = 7.8667
262144 | (7.3+7.1+7.2)/3 = 7.2
max(16384, #verts/2) (PR) | (7.1+6.9+6.8)/3 = 6.9333
```
This PR gets the scenario loading in just under 7 seconds now compared
to over 14 originally.
[1] https://dpel.aswf.io/4004-moore-lane/
Pull Request: https://projects.blender.org/blender/blender/pulls/141249
Currently drag and drop expects to selection to be in the same folder,
but blender internal file browser allows to select files from different
folders when recursion is active.
When writing to operator properties the `directory` is taken now from
the first file provided, and `files` are now relative to this
`directory` instead of just taking the file name.
When reading from operator properties filepaths are normalized.
I notice this issue while reading about #140942, the issue would
require a proper fix too.
Pull Request: https://projects.blender.org/blender/blender/pulls/140948
As noted in [0], locking or atomics are not required for merging
requests for a single mesh, because there is no multithreaded iteration
over objects that will process the same mesh in multiple threads. This
locking was added preemptively over the years and has made code
needlessly complicated, even while the final design for parallel object
iteration isn't completely clear. This PR removes the locks to simplify
some changes necessary for mesh attribute storage refactors.
[0]: b6764e77ef
Pull Request: https://projects.blender.org/blender/blender/pulls/141405
While calculating the scaling factor when rasterizing SVG files to
cursors there is an extra code line left in that was only used
during testing. Basically the size is correctly calculated and then
this extra line does it again, but in a different way. This can result
in the very bottom single line of the cursor being cut off at some
sizes.
Pull Request: https://projects.blender.org/blender/blender/pulls/141410
Most gizmo parts have a hit space larger than the visible part. Some
parts have a hardcoded expanded hitspace, while some parts have a
(hidden) expansion of the line widths during selection. So when using
the Transform widget most pieces are easier to hit than they appear.
Except for the "cubes" at the end of the scaling arrows. This means
they are hard to hit when in orthographic views since the rotation
lines are on top of them. This PR increases the size of the cubes
during selection so they are wider than the rotation lines. This also
similarly increases the selection hit size of the arrowheads, but
mostly wider. The little squares for plane translation are also
increased but just a bit.
Pull Request: https://projects.blender.org/blender/blender/pulls/141362
This was only true when the mode was set to World.
Make it consistent with the Custom backgroubnd option and
fallback to Theme background color for lookdev and render.
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
When moving a handle so its length is 0, the other handle was automatically set to 0 as well.
Cancelling the action didn't move the other handle back to 0, but set its length to 1.
The reason for that was that the code tries to maintain the relation between the two handles,
but that would lead to a divide by 0 when either of the handles has a length of 0.
So it would set the handle length to 1 in that case.
The fix is to ensure that the length of a handle is never 0. This is done by clamping it at the key
position with a threshold of 0.001 and an extra floating point step to support large floating
point values.
This should not affect animation in any way.
This was discussed in the animation & rigging module meeting
https://devtalk.blender.org/t/2025-06-26-animation-rigging-module-meeting/41272#p-153605-patches-review-decision-time-5
Co-authored by Nathan Vegdahl
Pull Request: https://projects.blender.org/blender/blender/pulls/141029
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
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
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
- `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
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
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
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
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.
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
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.
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
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
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
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
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