Currently, the Layout node class is used by the Reroute, Frame and
Compositing Switch node. To bring more uniformity, and clear up the use
of each class, this commit moves the Compositing Switch node from
the Layout class to the Converter class. This aligns it with similar
nodes (Compositing Split, Compositing Switch View, Geometry Switch)
which use the same class, and limits the Layout class to layout-related
nodes. On the UI side, this also gives the Compositing Switch node a
more relevant header color.
Pull Request: https://projects.blender.org/blender/blender/pulls/131392
The issue was that the struct `tPoseSlideOp` tracks the
viewport overlay flags so they can be restored after the operator has run.
But the flag was stored at the end of `pose_slide_invoke_common` which
exits early if no keys are selected.
This then calls `pose_slide_exit` which sets the viewport flags to 0, because they were
never stored in the first place.
The fix is to move the storing of the flag up to `pose_slide_init` to ensure that it
is captured as soon as the struct is allocated.
Pull Request: https://projects.blender.org/blender/blender/pulls/131327
In OpenGL the last vertex is the provoking vertex. In Vulkan the first
vertex is the provoking vertex. This PR uses `VK_EXT_provoking_vertex`
to use the last vertex as the provoking vertex.
Pull Request: https://projects.blender.org/blender/blender/pulls/131412
This patch adds an option to use the new perlin noise as a noise function for the FCurve modifier.
That fixes the issue of the old noise function which could produce values outside the -0.5/0.5 range (For a strength of 1).
The old way is still preserved and will be automatically used for old files.
Because of the different noise function, I've added two more parameters to the noise modifier.
The default values for those parameters are chosen to be as close to the original noise modifier as possible.
However the match is not 1:1
## Depth
With the new noise, the parameters for "Lacunarity" and "Roughness" are available to the user.
By default they are set in such a way that changing the "Depth" results in a similar noise pattern.
## Offset and Scale
The offset and scale parameters now behave differently. Before they would also shift the phase in some way, now all they do is shift or scale the noise.
## Amplitude
The biggest difference is in the amplitude of the noise.
Overall the amplitude is a lot smaller in general than with the legacy noise, but it does fix the issue of the amplitude reaching outside the -0.5/0.5 range.
By shifting the phase I was able to find points where the amplitude reaches 0.5 but never above that.
Pull Request: https://projects.blender.org/blender/blender/pulls/129535
Implemented in 4291ab855c
Fixed in c20399442d (even though that commit introduced the crash)
The crash happens because we are dealing with multiple
`DrawingPlacement` (using the constructor from c20399442d which allows
for passing in cached depths) in **threads**. The depth_cache gets freed
in the destructor of `DrawingPlacement` though, thus ruining the data
for a `DrawingPlacement` in another thread.
To resolve, pass in a copy of the depths.
Pull Request: https://projects.blender.org/blender/blender/pulls/131356
The color threshold in Blender 4.2 is interpreted to mean that colors above the
threshold are "background" and colors below threshold are "foreground".
This is arbitrary but works well for black-on-white drawings.
Pull Request: https://projects.blender.org/blender/blender/pulls/131324
Rather than using a default "Anim" name when exporting armature
animations, use the animation's Action name instead. Likewise use the
UsdSkelAnimation name for the Action's name during import.
Blendshapes/shapekeys still use the default "Anim" name as there's no
action for these situations.
Pull Request: https://projects.blender.org/blender/blender/pulls/131021
We create invisible buttons for socket tooltips because sockets themselves
aren't buttons and because we don't have a special tooltip handler for the
node editor. Currently those buttons have an empty right click menu with
just the "Edit Source" operator. Changing to label buttons removes the
right click menu but keeps tooltips working.
This didn't work earlier because label buttons didn't have tooltips.
That has been implemented in the meantime.
Pull Request: https://projects.blender.org/blender/blender/pulls/131399
Some editors are not redrawn while baking, but the properties editor currently
is and therefore needs this special check.
Eventually, we should rename or split the `is_rendering` flag to make it
more obvious that it also means baking.
Vertex groups are written as generic attributes in bakes currently.
In order to restore them as vertex groups properly when reading bakes,
keep track of the vertex group names in the bake metadata.
Pull Request: https://projects.blender.org/blender/blender/pulls/131393
When using the "Measure" Tool with Gizmos turned off, trying to delete
anything will result in an error message instead. When Gizmos are on
then view3d_ruler_remove_invoke will return OPERATOR_PASS_THROUGH if
no rulers are selected. This way you can delete other objects. But if
Gizmos are off then it returns OPERATOR_CANCELLED which stops in its
tracks. Return OPERATOR_PASS_THROUGH in this case instead.
Pull Request: https://projects.blender.org/blender/blender/pulls/131340
The option is already disregarded by the new viewport
selection code.
This only remove the usage of the flag and assume it is
always off.
The UI and DNA clearing needs to be done in another commit.
Starting with USD 24.11, the external boost dependency is being phased
out. It will instead use their own internal pxr_boost::python library.
This PR adapts the code inside `usd_hook.cc` to build and run in this
new environment.
Pull Request: https://projects.blender.org/blender/blender/pulls/131343
This implements a basic text overlay for matrix attributes. The matrix is split into location,
rotation and scale to make the values more useful. There are probably ways to present
this in a more beautiful way, but for now this is already much more useful compared to
showing nothing. Also, previously, this would hit an assert in a debug build.
Co-authored-by: Hans Goudey <hans@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/131301
Continuation of #131332.
Including built-in headers in VS2019 ends up including `corecrt_math.h`
as a side effect, which has many functions that overlap in name with
our stubs.
This puts the conflicting functions inside its own namespace (`glsl`)
and declares macros for them.
(Note this has the side effect of not allowing us to use those as
variable names)
This also removes the `<cassert>` and `<cstdio>` includes.
Pull Request: https://projects.blender.org/blender/blender/pulls/131386
Avoid extra parameter to force refresh a screen, only use the screen refresh
tag. Having both leads to unnecessarily complicated logic.
Also document behavior in function comment and make function name more clear.
Depth only drawing was not always enabling the overlay engine
(now responsible for depth prepass). And the depth prepass
was not populated if overlays were turned off.
The poll function doesn't apply here because it just checks for object
editability and edit mode, object types, and modifier types. We shouldn't
have a poll function at all because the hovered modifier might not be
part of the context.
Resolves#90008.
Pull Request: https://projects.blender.org/blender/blender/pulls/131384
172e9c5b83 attempted to move area type and region type initialization to
`ED_screens_init()` so it's done before region polls run (which depends on
region types). However this was only done for active workspaces, so when
changing workspaces region types may still be missing before region polling.
We could iterate all screens there instead, not just those from the active
workspace. But in the end I decided it's better to move this back to regular
screen refreshing, but before region polling. This way all this related logic
stays closer together. It still only runs on complete screen refreshes, so when
the screen layout changes generally.
Move `CD_CUSTOMLOOPNORMAL` to the newly added
`CD_PROP_INT16_2D` generic attribute type. This is similar to
previous commits moving specific custom data types.
The attribute name is `custom_normal`. When the attribute with
that name is on the face corner domain, the code will interpret it
as stored in the existing deformation-invariant spherical coordinate
space.
The API remains the same, with the additional opportunity to edit
custom normal data as an attribute directly (which admittedly is fairly
unintuitive currently).
See #130484.
Pull Request: https://projects.blender.org/blender/blender/pulls/130689
These functions showed up in a profile of a geometry nodes setup
using BVH sampling. They are so simple that function call overhead
is likely to be significant, and giving the compiler a view of what they
do is also likely to be helpful.
The preview generation job is not safe from cases when the underlying data is
changed outside of the job.
Ideally we'd solve possible threading conflict by making the job somehow
smarter. Until then kill the preview job manually, following similar pattern
from other places (for example, lib_id_generate_preview_exec).
Pull Request: https://projects.blender.org/blender/blender/pulls/131372
Currently we calculate neighbors for vertices in batches. The idea is
to access topology data all at once, storing the result in a local node-
sized vector that can fit in CPU caches. Currently we use
`Vector<Vector<int>>` for storing the neighbors, and that works well
enough when the number of neighbors fits into the inline buffer, but
whenever it doesn't it causes many vector reallocations and scatters
the neighbor storage in arbitrary memory locations.
This commit changes to using a `GroupedSpan` to store the neighbors, in
other words contiguous storage split into groups by an array of offset
integers. This reduces local per-vertex memory usage by 20 bytes and
makes memory access more predictable.
I observed a 1.39x performance improvement for the mesh smooth filter
on a large triangulated mesh, and a 1.14x improvement for a mesh of
mostly quads. In the brush benchmark on a quad mesh the difference I
observed is a small slowdown. I'm not sure why that happens but I trust
the results from the filter a bit more.
Resolves#130797.
Pull Request: https://projects.blender.org/blender/blender/pulls/130941
For me on Mac picking "Video Editing" template in startup dialog
now consistently crashes, due to bToolRef being null.
Looks like other code places check for tool being null before trying
to use it; `sequencer_main_cursor` however was not.
Pull Request: https://projects.blender.org/blender/blender/pulls/131358
The BLI bicubic interpolation function with border boundary is wrong
around edges. It returns zero, where interpolated values should exist.
This is due to a wrong early exit condition, where only a 2x2 window is
assumed instead of the 4x4 window considered by bicubic interpolation.
To fix this, assume a 2 pixel region in the early exit condition for
both directions.
Pull Request: https://projects.blender.org/blender/blender/pulls/131320
Avoid rebuilding BVH trees when meshes are copied.
Similar to the other uses of the shared cache system,
this can arbitrarily improve performance when meshes
are copied but not deformed and BVH building is the
main bottleneck. In a simple test file I got a 6x speedup.
The amount of code is also reduced and the system is
much simpler overall-- built out of common threading
patterns like `SharedCache` with its double-checked lock.
RAII is used in a few places to simplify memory management
too.
The downside is storing more `SharedCache` items in the
mesh runtime struct. That has a slight cost when copying
a small mesh many times, but we have ideas to improve that
in the future anyway (#104327).
Pull Request: https://projects.blender.org/blender/blender/pulls/130865