Blender cannot handle bones with (near) zero length. Prior to this
commit such bones were deleted when exiting Armature Edit mode. Now
they are kept and elongated so that they are numerically stable (or at
least they should be, given the threshold to the length that was
already in place).
To avoid the elongation from impacting the position of child bones,
they are disconnected from the tiny bone.
Apart from that it's quite nice for users that Blender no longer
silently deletes bones, this is also useful for the USD importer, as
it can import bones and expect them to exist afterwards (see
#147048).
Note: this only impacts armatures with bones of length ≤ 0.000001
units.
Pull Request: https://projects.blender.org/blender/blender/pulls/147814
Add a command line option to load Blender without a window frame.
Currently this is only used on Wayland, enabled for WITH_UI_TESTS since
attempting to load LIBDECOR caused the tests to crash on start on Fedora.
For tests there is no need to use LIBDECOR, so disable the window frame.
This can also be used by users who don't want to use the X11 fallback if
LIBDECOR can't be found.
Ref !147716
Rename modules in `./scripts/modules/` to use an underscore prefix to
make it clear they aren't intended to be part of public API's. This
also means there is no implication that these modules should be stable,
allowing us to change them based on Blender's internal usage.
The following modules have been marked as private:
- `animsys_refactor`
- `bl_console_utils`
- `bl_i18n_utils`
- `bl_previews_utils`
- `bl_rna_utils`
- `bl_text_utils`
- `bl_ui_utils`
- `bpy_restrict_state`
- `console_python`
- `console_shell`
- `graphviz_export`
- `keyingsets_utils`
- `rna_info`
- `rna_manual_reference`
- `rna_xml`
Note that we could further re-arrange these modules
(under `_bpy_internal` in some cases), this change is mainly to mark
them as private, further changes can be handed on a case-by-case basis.
Ref !147773
Mesh invariants imply that edges and faces must be unique, so things
like reversed edges or duplicate faces with equal vertices are invalid.
For this reason, every time we generate new elements we have to ensure
that all new elements are unique between each other and already existing
elements. The recent refactor (ea875f6f32) introduced a new
algorithm to generate new mesh elements, and deduplication of new
elements was also a part of it. The problem is that the deduplication
only guaranteed that the original elements and new elements don't
overlap; deduplication between each new elements is not complete.
To solve the problem both new triangles and new edges have to be
deduplicated, even if there is no duplicates. Just to know this we have
to build a hash sets.
Triangle deduplication is a special part of the triangulation code,
but edges already handled elsewhere in the code base.
This refactor fixes this by replacing the original approach with one
which guarantees distinct faces and edges in the result.
Unfortunately, this fix increases runtime of the node 10x for a simple
cube with 500-vertex sides. It should be possible to make the
performance better again, but that requires more work.
Other work had to be done to enable this, so this depends on:
- [x] 157e7e0351
- [x] fa8574b80b
Co-authored-by: Hans Goudey <hans@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/147634
The final image produced by the compositor can have domain translation
on it (e.g. caused by a Translate or Transform node). Similar to how
the regular compositor viewer node remembers the output domain
translation, do the same in the compositor modifier.
Bubble back that translation up to VSE rendering code, where it is
then added to regular strip transform.
In order to make this "bubble up" part easier, refactored modifiers
so that instead of soup of parameters they all get a struct
ModifierApplyContext with all the relevant data.
Added a new VSE render test that covers various compositor
transformation nodes (translate, rotate, transform, corner pin).
Pull Request: https://projects.blender.org/blender/blender/pulls/147695
This allows exclusions to be set in the `tests` filter for the
benchmarks using the exclamation mark. Exclusions apply *after*
inclusions ie:
tests = ['*', '!victor', '!koro']
would select all available tests then specifically exclude victor
and koro, while:
tests = ['!victor']
would just exclude victor, since nothing is marked for inclusion
no tests will be run.
tests = ['!victor','bmw27,'victor']
would exclude victor, but include bmw27 and victor but as victor was
marked for exclusion only bmw27 will be ran.
Requested by bart in #146019
Pull Request: https://projects.blender.org/blender/blender/pulls/147588
The fix in this case is to properly use the stored builtin attribute defaults
when capturing the field on the mesh. I extracted that to a function so
the code would read better with early returns.
Pull Request: https://projects.blender.org/blender/blender/pulls/147646
Support loops at the GLSL level instead of relying on
NOD_shader_nodes_inline.
This improves compilation and runtime performance, avoids causing
recompilations on iteration count changes, and allows supporting
dynamic iteration counts.
(EEVEE-only)
Pull Request: https://projects.blender.org/blender/blender/pulls/145269
Split the result mesh generation to work into two loops. The first loop
builds topology maps used for propagating attribute values, and the next
loop mixes attribute values with those maps. This has a few benefits:
The propagation can be done in parallel, and the topology mapping code
can get simpler. Also, we reduce the overhead that comes with iterating
over all attributes for every single element. Overall I didn't measure
a large performance difference though, because the new code has the
downside of needing to allocate two more arrays.
There is a small difference of a propagated byte color (250 vs. 251) in
the geometry nodes test due to a subtle difference in the mixing
implementation.
Part of #122398.
Pull Request: https://projects.blender.org/blender/blender/pulls/147367
The UI property was changed 7b97bc48d8
to a negative boolean but the boolean conversion inside EEVEE was
not inverted.
This mean that since 4.2, the default behavior for Lightprobe
volume has been broken / inverted.
To make an existing scene bake the same as before, all material
needs to have their `BackFace Culling > Light Probe Volume` options
inverted. This is done automatically through the versioning code.
The only test cases broken are the ones using default materials which
do not have their property turned off.
Release Notes should contains the compatibility breakage.
Pull Request: https://projects.blender.org/blender/blender/pulls/147218
Move the selection flag for pose bones, from the (edit)bone to the
pose bone.
Previously having multiple instances of armatures in pose mode at the
same time caused issues because selecting a pose bone on one armature
would automatically select it on all instances of it.
This is now fixed since the selection state is stored on the pose bone
(Object level) Doing so breaks API compatibility with 4.5 since the
RNA property on the Bone no longer affects the pose bone. Instead,
there is a new property on the pose bone for that.
Due to this change, some runtime flags for the transform system also
had to be moved to the pose bone. This is due to the fact that these
flags are used by the transform system to pass information between
functions. If we keep the flag at the bone level, this wouldn't work
with armature instances. See `bPoseChannelRuntimeFlag`
Fixes#117892
Pull Request: https://projects.blender.org/blender/blender/pulls/146102
This patch adjusts the LGG Color Balance mode to operate in linear space
as opposed to sRGB space, which is more inline with other software and
is more expected to the user.
Versioning was added using pre and post gamma correction, but it is
very slightly different in the blacks because the gamma node only does
power correction.
Pull Request: https://projects.blender.org/blender/blender/pulls/147533
Given a grid of velocities, this node advects the values of the input
grid. Different options for integration scheme and clamping are
exposed. Currently their names are just as defined in OpenVDB.
Pull Request: https://projects.blender.org/blender/blender/pulls/147273
Add a new constraint called "Geometry Attribute", which directly
samples vector, quaternion, or 4x4 matrix attributes from geometry and
applies these to an object's or bone's transform.
This can be used to transfer data generated by geometry nodes to the
object or bone level. By default the constraint will sample a vector
on the vertex domain. The default attribute is `position` for
simplicity, but the attribute value does not have to have anything to
do with neither the transform of the geometry object nor the geometry
itself.
Pull Request: https://projects.blender.org/blender/blender/pulls/136477
Currently when a strip has a transform that does not fill the whole
render area, first the image of the strip is transformed, and then
any modifiers are applied on that. This is mostly in the new
Compositor modifier, where procedural textures, gradients, image
coordinates "stick to the screen" instead of following the transformed
strip.
This changes the behavior so that first the modifiers are applied
to the strip image, and then the strip is transformed. This is
potentially a visually breaking change:
- This can alter visual look of existing strip, especially if they are
scaled. Previous behavior was first scale filtering, then modifier;
now it is first modifier, then scale filtering.
- Most obvious change is Compositor modifier (which is new in 5.0).
- Compositor modifier can actually expand the input image (e.g. Blur
node with "expand bounds" option set), and that works.
- Note that Masks continue to be applied in global/screen space. There
can be small look differences with rotated/scaled strips that use
masks, due to Mask application now needing to do filtered mask image
lookups.
- If anyone needs previous behavior (modifier is applied on the
"whole screen"), they can put transformed strip into a meta strip,
and apply the modifier on the meta strip itself.
Compositor modifier examples with images in the PR.
Pull Request: https://projects.blender.org/blender/blender/pulls/146181
Support sync selection in the UV editor, with face-corner selection,
so it's possible to select individual UV vertices/edges in the UV editor
without UV's attached to the same underlying edge also becoming selected.
There is limited support for maintaining the UV selection when selecting
from the 3D viewport, common operations such as picking &
box/circle/lasso select support this, however other selection operations
such as "Select Random" or "Select Similar" will clear this data,
causing all UV's connected to selected mesh elements to become selected.
We may add support for additional operators as needed.
Details:
- UV Sync Selection is now enabled by default.
- In edit-mode the UV selection is stored in BMLoop/BMFace which are
written to custom-data layers when converted to a Mesh.
- To avoid unnecessary overhead - this data is created on demand.
Operators may clear this data - selecting all or none do so,
as there is no reason to store this data for a uniform selection.
- The Python API includes functions to synchronize the selection to/from
UV's as well as flushing based on the mode.
- Python scripts that manipulate the selection will either need to clear
this synchronized state or maintain it.
See:
- Design task: #78393.
- Implementation task: #131642.
Ref !138197
This PR gives access to OpenVDB's level set filtering operations
through individual **SDF Grid** nodes.
- **Mean Curvature**: Smoothens high curvature areas more than flatter
ones.
- **Laplacian**: Approximates mean curvature flow for true SDFs at lower
computational cost.
- **Median**: Reduces noise while preserving sharp features.
- **Mean**: Fast separable averaging filter for general-purpose
smoothing with linear computational complexity.
- **Offset**: Uniform dilation/erosion operation that shifts the SDF
surface by a world-space distance.
- **Fillet**: Rounds off concave internal corners by operating only on
regions with negative principal curvature.
Pull Request: https://projects.blender.org/blender/blender/pulls/147224
Add a function `bpy.data.file_path_foreach()` with a callback function
`visit_path_fn`:
```py
def visit_path_fn(
owner_id: bpy.types.ID,
file_path: str,
_meta: typing.Any,
) -> str | None:
return file_path.replace('xxx', 'yyy') or None
bpy.data.file_path_foreach(
visit_path_fn,
*,
subset=None,
visit_types=None,
flags={},
)
```
When the function returns `None`, nothing happens. When it returns a
string, the reported file path is replaced with the returned string.
`subset` and `visit_types` have the same meaning as `subset` resp.
`key_types` in `bpy.data.file_path_map()`. Since the latter parameter
doesn't affect keys in a map, but rather the visited ID types, I named
it `visit_types` instead.
`flags` wraps most of `eBPathForeachFlag` as `set[str]`, with their
prefixes removed. `BKE_BPATH_FOREACH_PATH_RESOLVE_TOKEN` becomes
`RESOLVE_TOKEN`, etc. `BKE_BPATH_FOREACH_PATH_ABSOLUTE` is excluded,
as it only affects a field in the C++ callback structure that is not
passed to Python at all. If it turns out to be useful at some point,
we can always add it.
`_meta` is for future use, and is intended to give metadata of the
path (like whether it's an input or an output path, a single file or
the first file in a sequence, supports variables, etc.). By adding
this to the API now, we avoid a breaking change when this feature is
actually implemented.
Design task: #145734
Pull Request: https://projects.blender.org/blender/blender/pulls/146261
The dilate threshold test fails on Qualcomm GPU due to an unknown
reason, but the tests shows significant differences in all platforms
regardless, they are just small enough to pass the test threshold. The
difference is most likely the new SMAA implementation done to match the
GPU version, so updating the reference is reasonable here.
Pull Request: https://projects.blender.org/blender/blender/pulls/147451
The result of the Keying Screen node tests is very different yet the
test succeeds, that's because the test result has a very small number of
pixels compared to the final image. To fix this, we match the size of
the result with the render size.
This also updated the test reference which should have been updated
after the new RBF interpolation implementation of the node.
Pull Request: https://projects.blender.org/blender/blender/pulls/147449
Previously, Repeat Zones with non-static iterations would be fully
disconnected.
With this patch, they behave as if they have 0 iterations.
Co-authored-by: Jacques Lucke
Pull Request: https://projects.blender.org/blender/blender/pulls/147211
Instead of modifying the active mesh in place, which means we can't
use the size of its data arrays when copying its data, and its caches
are immediately invalidated, copy data to a separate out-of-main
result mesh first. The only downside is that for a moment during
the operator the shape key array sizes will be out of sync with the
mesh size.
Also the custom data for multires layers wasn't copied properly
after the recent refactor that rewrote this code. Take the opportunity
to fix that too.
The motivation for this change is an improvement to copy different
kinds of custom normals properly to the joined mesh, which never
worked since free custom normals were introduced.
This contains a few changes to the expected results in the tests.
Those are edge cases, and the new results make more sense.
Explicitly set the transform of a grid.
The new transform can fail to be applied if the input transform isn't
invertible or for some extremes of scaling (0 or combinations of
negative and positive) and numerical errors with `openvdb`. If a
transform is not applied an error is raised and the `Is Valid`
returns false.
Pull Request: https://projects.blender.org/blender/blender/pulls/146824
Adds four new grid operator nodes that wrap OpenVDB's differential
operators. All nodes take a grid input and output a grid, potentially
with a different data type.
New nodes:
- Grid Curl: Calculate curl of vector field (Vec3 → Vec3)
- Grid Divergence: Calculate divergence of vector field (Vec3 → Float)
- Grid Gradient: Calculate gradient of scalar field (Float → Vec3)
- Grid Laplacian: Calculate Laplacian of scalar field (Float → Float)
These operators enable vector calculus operations on volume grids for
effects like flow analysis, vortex detection, etc.
Co-authored-by: Hans Goudey <hans@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/146845
Adjust various unit tests so that they no longer use the legacy Action
API (which was deprecated in Blender 4.4 and will be removed in 5.0).
No functional changes.
This is part of #146586
Pull Request: https://projects.blender.org/blender/blender/pulls/147060
Crash seems to happen due to parallelized access of data in liboverride
diffing code (presumably when a same linked data is used as reference
for several local liboverrides?).
Since there is zero reason to actually create IDGroup properties there
(it's actually fairly bad, also adding useless overhead and trash data
in system IDProperties), add a new API to access a Pointer PropertyRNA,
`RNA_property_pointer_get_never_create`, which ensures that the call
never creates data, and simply returns `PointerRNA_NULL` instead.
Also reverts abd683fcb5 and re-enable liboverride unittests.
NOTE: This only addresses the case from the report, the current behavior
of `RNA_property_pointer_get` is simply wrong and needs to be rethought.
This is not a simple change though most likely. See also #147072.
Pull Request: https://projects.blender.org/blender/blender/pulls/146990