This is discussed more in PR #140773.
The cause of the breakage was the change of the Manifold library
version from 3.0.1 to 3.1.0. That change is very positive otherwise
because we can remove the "use runids" workaround to prevent bad
face merging, and that removal is also part of this commit.
Removing that changes the time to do a big sphere-sphere test
from 660ms to 340ms.
The problem that needed fixing is that the new library version appears
not to do some aggressive simplification that the old version did,
and as a result, when we dissolve triangulation edges after the boolean
is done, it sometimes leaves valence-2 vertices on original edges.
To fix that, new code detects and then dissolves such vertices.
The 2 values in `t->snap` are not enough to indicate the transformation
value for each axis including precision.
Therefore, imitating the snap to grid solution, `t->snap` has been
replaced by `t->increment` and `t->increment_precision`.
Pull Request: https://projects.blender.org/blender/blender/pulls/140980
These functions were refactored recently, e.g. see e300d44e69. In some cases
it's less clear now which functions are getters and which are setters. Case in
point, I first thought `layout.use_property_split()` would enable property
split (that's what the name suggests). Previous names like
`uiLayoutGetPropDecorate()` and `uiLayoutSetPropDecorate()` were more clear.
By using the `[[nodiscard]]` attribute for getters, the compiler will emit
warnings when using such functions like a setter, without using the returned
value.
`IDP_ARRAY` properties storing `IDP_GROUP` data would not duplicate
these on copying, leading to two different array properties sharing the
same groups data...
NOTE: Uunclear how bad this issue was actually, since Blender itself will
never create such arrays of group IDProps afaik. At least could not find
any.
We really need to cleanup this code and add actual cpp-level unittests.
Add an error check that the path being linked doesn't match the current
blend file.
Also resolve reference leak in the case of library override errors.
This avoid legacy code inside the DRWContext.
Note that this change the draw order w.r.t. gizmos. Now the
gizmos will hide the text.
Moreover, streamline the condition for enabling text drawing
in order to fix#78971.
The line width is already specified before the program bind
and the uniform doesn't even exists for `GPU_SHADER_3D_UNIFORM_COLOR`.
This might be the remains of an invalid use of the wide line
workaround.
This patch adds support for the experimental structure types currently
used bu Geometry Nodes. Pixel nodes were declared as function nodes,
which gives dynamic structures for all their sockets. Other nodes now
explicitly declared their inputs as dynamic if not single value, while
the compositor_expects_single_value marker was removed in favor of the
StructureType::Single type.
Pull Request: https://projects.blender.org/blender/blender/pulls/140910
The issue was that this operator is using the same
path as the viewport display. So the colors are
clamped if the display is not HDR.
This fix is easy now that we have an HDR path for
the viewport display. We just enforce using it
when doing the viewport render preview.
Saved files in 4.5 with a compositing node tree containing a Normal
Node with animated 'Dot' input crash in 5.0.
A test case with animated dot and normal inputs was added as well.
Pull Request: https://projects.blender.org/blender/blender/pulls/140908
This is caused by the Attenuation property that is not
scale agnostic. We don't want to change its behavior as
it would break a lot of files. Instead, we allow users
to set its influence to 0 or less than 1 in order to
nullify or adjust its impact at larger AO radii.
The compositor crashes when using any image coordinates in GPU mode.
That's because the realization operation didn't support Float2 images so
far. To fix this, we handle Float2 images for realization.
Geometry nodes can't be evaluated when the node tree is not available. This
never worked before and the modifier evaluation was "cancelled" later on before
already. However, new code in the modifier evaluation requires the modifier to
be cancelled earlier already which is what this patch does.
Pull Request: https://projects.blender.org/blender/blender/pulls/140923
Using "Edit Source" from a buttons context menu in a popover could
access freed memory when comparing buttons. Resolve by checking the
button still exists in the region.
Caused by change in `AVCodecID` enum. Our `IMB_Ffmpeg_Codec_ID` enum,
which was stored in .blend file did match `AVCodecID`. But after change
in external library headers it fails to initialize correct codec.
Function `MOV_av_codec_id_get()` was added to map these 2 enums and
the values are no longer hard coded.
Functions, that accepted `int codec_id` argument were modified to accept
`IMB_Ffmpeg_Codec_ID` or `AVCodecID` types.
Because `codec_id` was still stored as integer in DNA, get/set struct functions
were added. This way, compiler always knows what type is used and emit
error/warning when incompatible types are used.
Unfortunately, there is no way to ensure, that DNA `codec_id` field is not
accessed directly in future code other than comment.
Pull Request: https://projects.blender.org/blender/blender/pulls/140745
The compositor executes redundantly if previews are enabled but no
other output is computed. This shouldn't be the case because previews
are secondary outputs that need a primary output to compute with.
We improve this this by only executing the compositor if a primary
output is needed, regardless if previews are needed or not.
Pull Request: https://projects.blender.org/blender/blender/pulls/140920
The theme cursor size was ignored when setting custom cursors
such as the knife, only the DPI from GHOST was taken into account.
This meant cursors such as the knife would sometimes display too small.
Now when the theme-size is larger, a larger cursor will be used.
Currently the theme size is read from XCURSOR_SIZE environment variable
however it may be read from the system preferences in the future.
Also fix the software cursor sizes which incorrectly used the UI scale
preference which is ignored by cursor sizes.
For files saved with the new format, the versioning can incorrectly
replace the AttributeStorage data with whatever is inside of CustomData,
even if that's nothing. So far this is only in one unlikely case for
point clouds, but these functions will soon be used for Grease Pencil
and curves.
Add a "ForUninitialized" utility function and use copy construction
correctly. This doesn't make a difference yet because we only
have trivially constructible attribute types so far.
This PR makes it easier to add keyframes for strips in preview.
This works same way as in 3D viewport, using keying sets. Pressing I
key adds keyframe to default keying set, pressing K dhows menu with
available keying sets. For VSE, location, rotation and scale properties
are available for now. Other existing keying sets are not valid for
VSE.
Deleting keyframes and potentially adding more keying sets will be
handled in separate PR.
Pull Request: https://projects.blender.org/blender/blender/pulls/140107
This doesn't yet touch lines that use the `ReshapeGridElement` or
`ReshapeConstGridElement` structs, those require further cleanup
elsewhere before making such changes.
Pull Request: https://projects.blender.org/blender/blender/pulls/140782
Prepare for #140378 by replacing all uses of `ResourceHandle` inside
the engine code with `ResourceHandleRange`.
Aside from the replacement, this changes `ResourceHandleRange` itself
to ensure we use them correctly:
- Prevent direct access to the first handle, to avoid not taking ranges
into account by mistake.
- Add missing functions that are safe to use for ranges
(`has_inverted_handedness` and `is_valid`).
- Add functions that aren't safe to use for ranges, but are required
for the code paths that don't support them yet (these functions assert
that the range points to a single handle, and therefore can be used
safely).
The main change is in `draw_handle.hh`, everything else is just a 1:1
port to use these new functions.
Pull Request: https://projects.blender.org/blender/blender/pulls/140611
Improves the screenshot selection UX by ensuring the selection
rectangle stays within the window.
**Changes**
- Clamp the selection rectangle while dragging the cursor,
preventing it from extending outside the window.
- When shifting the selection area, movement is constrained
so that the entire rectangle remains within the window.
- When `force_square` is `true`, the square is clamped to the
largest possible square that fits within the window bounds
if it would otherwise exceed them.
Pull Request: https://projects.blender.org/blender/blender/pulls/139805
Fix#140813 crash, when bevel operation doesn't choose proper representative
face (called frep, facerep or rep_face in code). In such scenario a nullptr
would be assigned to uv_face->attached_frep field in register_uv_face function
and later, as a result of that, BM_face_vert_share_loop function would crash
during call to update_uv_vert_map function.
This commit also includes additional safety check in register_uv_face function,
as well as removes compiler warning about assigned but unused center_bme variable.
This is from PR https://projects.blender.org/blender/blender/pulls/140864
but applied to the 4.5 release branch.
Fix#140813 crash, when bevel operation doesn't choose proper representative
face (called frep, facerep or rep_face in code). In such scenario a nullptr
would be assigned to uv_face->attached_frep field in register_uv_face function
and later, as a result of that, BM_face_vert_share_loop function would crash
during call to update_uv_vert_map function.
This commit also includes additional safety check in register_uv_face function,
as well as removes compiler warning about assigned but unused center_bme variable.
This is from PR https://projects.blender.org/blender/blender/pulls/140864
but applied to the 4.5 release branch.
CustomData lookup is very expensive compared to everything else
happening in this function. Use a slightly ugly approach to avoid it
when the display type isn't "Attribute" or "Texture". This gives a 5%
FPS playback improvement in the Erindale Flower shop demo file.
Pull Request: https://projects.blender.org/blender/blender/pulls/140547
This patch removes the Texture node from the compositor, which was based
on the legacy Internal Textures system in Blender. The main motivation
for removing this node is as follows:
- Procedural texturing nodes that previously existed in shading and
geometry nodes are now supported in the compositor, which cover 95% of
what is previously possible using and even adds new possibilities like
Gabor, Bricks, and various improvements to existing texture types.
- The old texture system did not support GPU evaluation, so it was
always computed and cached on the CPU, which causes bad performance
especially for interactive use in the viewport compositor. While the
new nodes are fully GPU accelerated and do not require any caching.
- The Texture node didn't support Texture nodes, so it was not fully
supported and we so far had a warning about that.
- The general direction in Blender is to remove the old texture system,
and the compositor was one of the last main users of it. 5.0 is thus
the ideal time to remove such use.
- The Texture node was always and still is a source of bugs, since it
relies on proper tagging for cache invalidation and updates, which is
so far not perfect. It also suffers from UI/UX issues, since it needs
to be adjusted from the properties panel, which can break if there are
other texture nodes in the context.
This is a breaking change and no versioning was attempted since:
1. It is impossible to get the same results as before due to the use of
different random number generators, so any versioning would just give us
the general look.
2. The Texture node supports a lot of possible configurations. For
instance, each general texture can have many options for the basis type,
and each basis type might have multiple options. So versioning all of
that will take a lot of time, code, and effort.
Pull Request: https://projects.blender.org/blender/blender/pulls/140545
This change enables HDR support for wayland as an experimental feature.
It supports both non-linear extended sRGB and un-clamped sRGB.
Windows isn't supported as the HDR settings are not accessible via an
API and would require similar settings that games use to configure the
monitor. Adding those sliders isn't what we would like to add.
Vulkan (working group) is working on new extensions that might change
the shortcomings. It isn't clear yet what the extension will do and what
the impact is for applications that want to use it. When the extension
is out we should review at the situation again.
Pull Request: https://projects.blender.org/blender/blender/pulls/133159