When tweaking envelope radii of (connected) envelope bones, we dont
always make sure that corresponding head and tail radii are in sync.
Using the `Bone Size` tool should take care of this (and it works to
some extend) but tweaking the radii through the sidepanel UI or the
Properties Editor (through RNA), then corresponding heads and tails
radii get out of sync.
Once we are in such unfortunate situation, then code in the transform
system's `recalcData_edit_armature` fails with wrong assumptions, it
propagates radii from children to parents which are unexpected / not in
use.
So one thing to do would be to add this syncing of radii to
`rna_Armature_editbone_transform_update`.
This alone would solve the "problem" in new files.
For existing files that are already out of sync we add versioning that
corrects this on file load
Pull Request: https://projects.blender.org/blender/blender/pulls/137599
This converts the public `uiLayoutColumnFlow` and `uiLayoutGridFlow` functions
to an object oriented API (an `uiLayout::column_flow` and `uiLayout::grid_flow` respectively),
matching the python API.
This reduces the difference between the C++ API with the python version,
its also helps while converting code from python to C++ code (or vice-versa),
making it almost seamless.
Both renamed functions now returns an `uiLayout` reference instead of a pointer.
New calls to this method should use references too.
Part of: #117604
Pull Request: https://projects.blender.org/blender/blender/pulls/138074
Previously UV sync-select in face mode would isolate UV selection
so dragging a face would disconnect it from adjacent faces.
Now the sticky mode is respected for face selection.
This is needed for #136817 so storing per-selection doesn't result
in a user visible change in behavior.
When a object matrix has a determinant of 0 (which typically means 0s on
one or more of the scale axes), the matrix inversion would become
invalid thus the inversion matrix will be quietly set to diag(0). This
would basically reset all vertices to the origin of the object after
applying the inversion matrix. This happens in the "apply rotation"
stage.
Now addtional warnings will be shown to the user when there are
objects that tries to go through such operation, and they will be
skipped.
-------
It will look like this when some objects failed, if you want to test, just scale some objects to 0 and apply rotation:

Pull Request: https://projects.blender.org/blender/blender/pulls/128273
Clamping behavior in the new slip operator (added in #137072) would
silently fail if any strip(s) in the selection did not have enough
underlying content to fill the strip bounds.
This patch allows the user to continue slipping along a clamp defined
by the strips that support it. A warning in the status bar
is also added in this case.
If no strips can clamp, the button is disabled entirely, with only the
warning present.
Images available in the PR.
Pull Request: https://projects.blender.org/blender/blender/pulls/137980
The code that updated the ray based on the constraint point was
incorrect in orthographic view. In this view, it's the ray origin that
changes, not the direction. This has now been fixed.
Additionally, as a further improvement, when snapping is not available,
a fallback point is now used as the constraint point.
Pull Request: https://projects.blender.org/blender/blender/pulls/137776
In all paint and sculpt modes, it was practically impossible for modal
operators to set a modal cursor, because the cursor was immediately
overwritten by the paint cursor. In this patch the paint cursor function
checks for a modal cursor first. When a modal cursor exists, it isn't
overwritten by the paint cursor.
Pull Request: https://projects.blender.org/blender/blender/pulls/137893
This commit reduces the Mesh paint BVH node limit on vertices from
10000 to 2500. In general, a lower value here improves performance for
both raycasting and brush strokes, as smaller leaf nodes mean more nodes
can be filtered in the broad sphere tests instead of needing each
vertex to be processed.
There are a number of considerations that go into profiling this value:
* This change is most impactful for large meshes, where the user is
going to be modifying a small total percentage of the model's area.
* Lower values may improve CPU performance, but overall responsiveness
as perceived by the user goes down with values much smaller than 2500.
This is likely due to GPU overhead, as each BVH node corresponds to a
VBO.
* A lower node limits increase the BVH building time.
The new limit of 2500 corresponds to the following performance changes
as compared to the prior baseline:
* 1.12x ~ 1.52x FPS increase depending on the ratio of brush to mesh
size.
* 1.27x ~ 2.88x performance increase for the brush evaluation.
* 1.31x slower BVH build times on a mesh with 10 million verts
(0.2864s to 0.3761s).
Further performance data and comparison videos can be seen in the
associated PR.
Pull Request: https://projects.blender.org/blender/blender/pulls/137871
Previously, the bundled essential brushes in Sculpt Mode were changed
from the Scrape, Fill, and Flatten types to the Plane brush type. This
commit does the same thing programmatically and removes the now old code
related to these obsolete brushes.
Resolves#134076
Pull Request: https://projects.blender.org/blender/blender/pulls/138022
Adjust the logic in `view_zoomstep_apply_ex` to ensure that spaces
without the new flag `V2D_ZOOM_IGNORE_KEEPOFS` will still zoom if they
do not also have `keepofs` flags set.
This means spaces like Geometry Nodes can zoom again.
The correct order is View Space -> World Space -> Object Space, which
implies that the view to world matrix `cache->vc->rv3d->viewinv` has to
be applied before `ob.world_to_object`.
Introduced in 5a21fa0ada
Pull Request: https://projects.blender.org/blender/blender/pulls/138146
Allow configuring the inline buffer capacity for the slots array, and
add an inline buffer for the keys vector. Previously there was always
an allocation when adding an element.
The inline capacity is manually configured in a few places as part of
this commit.
Pull Request: https://projects.blender.org/blender/blender/pulls/136461
Two separate fixes are needed to resolve the crash. First is in the
store named attribute node, which incorrectly retrieved an attribute
value validator without checking the field type. The other is various
missing checks for the case when the evaluated positions for a
specific curve are empty.
Pull Request: https://projects.blender.org/blender/blender/pulls/137861
Create an option in `View2D.flag` that allows us to have separate
behavior for area resizing (left aligned with `V2D_KEEPOFS_X`) and
zooming (centered with the keepofs flags disabled). Add this to the
versioning code.
Pull Request: https://projects.blender.org/blender/blender/pulls/138041
Caused by 06f6d77979.
Legacy curve objects have not taken the radius into account in the
past. Better to stick with that behavior and only affect the new
curve object type. This only affects non-instanced legacy curve
objects; generally generated curves are presented to the depsgraph
iterator as the new object type.
Pull Request: https://projects.blender.org/blender/blender/pulls/137852
See #129009 for context.
The preprocessor parses metadata and writes a header file containing
an inline function that inits the `GPUSource` with the metadata.
These header files are then included inside `gpu_shader_dependency.cc`.
This still keep the usage of the `metadata` enums and classes to avoid
pulling the whole blender module inside the preprocessor executable.
This speeds-up startup time in Debug build:
`gpu_shader_dependency_init`
- Before : 37ms
- After : 4ms
I didn't measure release, but it is unlikely to be noticeable (in the
order of 4ms > 1ms).
Pull Request: https://projects.blender.org/blender/blender/pulls/138070
This avoid recreating the GPU context for each individual
tests. This reduces the overhead drastically.
Excluding static_shaders and texture_pool tests I get for GPUVulkanTest:
`Before: 129 tests from 1 test suite ran. (26304 ms total) `
`After: 129 tests from 1 test suite ran. (6965 ms total) `
Including static_shaders and texture_pool tests I get for GPUMetalTest:
`Before: 124 tests from 1 test suite ran. (54654 ms total)`
`After: 124 tests from 1 test suite ran. (1870 ms total)`
Given the tests are run twice for the workarounds versions, the
speedup can be multiplied by 2.
Overall tests time is still largely dominated by shader compilation time.
However, there is still 3x improvement using this patch:
Including static_shaders and texture_pool tests I get for GPUVulkanTest,
GPUVulkanWorkaroundTest, GPUOpenGLTest, GPUOpenGLWorkaroundTest:
`Before: 516 tests from 4 test suites ran. (318878 ms total)`
`After: 516 tests from 4 test suites ran. (106593 ms total)`
Pull Request: https://projects.blender.org/blender/blender/pulls/138097
This improves the user experience, because the data-flow is not interrupted
temporarily. The automatically inserted links are exactly the same that the
Evaluate Closure node uses when no closure is connected.
Pull Request: https://projects.blender.org/blender/blender/pulls/138125
The corner-cost bias used when calculating the shortest path meant
the path could cross over itself.
Resolve by tagging vertices as well as edges to prevent stepping across
vertices used by edges that have been added to the heap.
This removes the minimum thickness clamping in the shader.
The reason why this was clamped in the first place was to reduce
aliasing artifacts. With the new super sampling method for
rendering, this should no longer be an issue.
Note: This can break visual compatibility, but the previous radii
were arguably "wrong". This essentially fixes this and renders
the strokes with the actual radii from the attribute.
Previous files that might have relied on the clamping will have
to be updated.
Pull Request: https://projects.blender.org/blender/blender/pulls/138119
Metal and Vulkan don't support line smoothing. There is a workaround
implemented. This workaround is only enabled when linesmooth value is
larger than 1. However When using smooth lines it should also be used.
This is fixed by adding a `GPU_line_smooth_get` function for getting the
current line smooth state.
Pull Request: https://projects.blender.org/blender/blender/pulls/138123
This patch removes the Alpha option in the Map UV node. That's because
it currently only has a marginal effect on the result of the node and is
unnoticeable to the user.
The alpha option was supposed to darken the edges of the object that has
the UVs by attenuating the result according to the Laplacian of UV
coordinates. But the attenuation factor was too small to be noticeable.
This option was probably added when UV passes had no anti-aliased alpha
and was therefore needed to smooth the transition at the edges probably.
We asked for user feedback and got feedback from the studio, and it seem
the option is mostly unused.
Pull Request: https://projects.blender.org/blender/blender/pulls/138116
This is implements option 1 of #129309. It contains a few changes:
* Split `BHead8` into `SmallBHead8` and `LargeBHead8`. The latter is the new one
and uses `int64_t` for array sizes instead of just `int`. That applies to to
buffer size in bytes (`len`) and the array size (`nr`).
* The first .blend file header (the first few bytes of the file) are updated
according to #129309.
* Support reading files with that use `BHead4`, `SmallBHead8` and `LargeBHead8`.
* New option in the preferences that controls whether new files are written with
the older `SmallBHead8` or the new `LargeBHead8`. The new file format is
disabled by default. Potential unofficial 32 bit builds (#67184) always write
`BHead4`, but can read all types (in theory anyway, can't test it).
Note that there are other places in Blender that don't fully support arrays this
large. E.g. I noticed that the spreadsheet currently can't scroll all the way
down.
The experimental option can be removed once we are in the 5.0 branch, at which
point only 4.5 will be able to open the files saved with 5.0.
Co-authored-by: Bastien Montagne <bastien@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/129751
- ImBuf reference counting: turn that into just an atomic integer
- Cachefile safety: turn into a mutex, since work under the spinlock
was quite heavy (hashtable creation, other memory allocations)
- Movie clip editor: turn into a mutex, since work under the spinlock
was very heavy (reading files from disk, etc.)
- Mesh intersect: remove the previously commented out spinlock path;
replace BLI mutex with C++ mutex for shorter code
Pull Request: https://projects.blender.org/blender/blender/pulls/137989
Each time when rendering an image a new context is created. When the
context is destroyed it can still contain a render graph, which ownership
isn't transferred back to the device. Resulting in an increase of several
MB per render. The render graph is cleanly destroyed during quiting as
there is a master list of created render graphs.
Fixed by moving the ownership of the render graph back to the device
when a context is unregistered.
Pull Request: https://projects.blender.org/blender/blender/pulls/138095
When using a tablet an increased gizmo hit-radius was used,
afterwards toggling modifier keys could then re-evaluate the
highlighted gizmo with a smaller radius, meaning that pressing modifiers
caused gizmos to become inactive.
Revert [0] while keeping larger radius for both mouse & tablet motion
from 10 to 12 px (scaled by the UI scale).
[0]: a043a0e74d
There is an internal flag which gets set only during USD import,
which allows for custom attributes to be read from Mesh Sequence Cache.
This flag is not shown anywhere in the UI, and is not accessible through
python, which can lead to confusing behavior.
For example, loading a .usd file through `bpy.ops.wm.usd_import` will read
custom attributes, but when `Mesh Sequence Cache` is added manually then
loading the same usd file through `bpy.ops.cachefile.open` will not load
custom attributes.
Further, if the user edits `object.modifiers['MeshSequenceCache'].read_data`
then `MOD_MESHSEQ_READ_ATTRIBUTES` flag will be removed with no way
to bring it back.
Pull Request: https://projects.blender.org/blender/blender/pulls/132475
There are two way to access input data in geometry nodes: `get_input` and `extract_input`.
They semantially the same as copy and move constructor. Since sometimes we can access
input multiple times in arbitrary context, we can not always use move constructor. But if
execution flow is trivial then `extract_input` should be preferred.
Pull Request: https://projects.blender.org/blender/blender/pulls/138057