Adds an option to the "Clear Recent Files List" operator to allow it
to remove only items that are not found. By default it clears "All
Items" but this can be changed to "Items Not Found".
Pull Request: https://projects.blender.org/blender/blender/pulls/127024
For historical reasons, the BVH tree considered face sharpness similar
to material indices and tried to make the value match for all faces in a
node. This is unnecessary because PBVH drawing supports mixed
sharpness within a node.
For the draw face set brush, dynamic topology remesh, and "Show All",
push all the affected nodes in one call. This helps to decrease overhead
from multithreading and data access.
This works around an issue where eevee was rendering a pure black cube in certain shader configurations in the default scene (#122837). This only affects X Elite devices (8cx Gen3 is unaffected).
Pull Request: https://projects.blender.org/blender/blender/pulls/127148
This commit rewrites the PBVH drawing using many of the principles from the
ongoing sculpt refactor. First of all, per BVH node overhead is minimized.
Previously the main entry point to the drawing API was per node, so there
was significant overhead fetching global data and maintaining caches on
a per-node basis. Now all of that "global" work happens for the entire
geometry.
We also now avoid creating wireframe index buffers and batches unless
the viewport actually requests wireframe data. This was theoretically
possible before, but the whole logic flow was so convoluted that the
optimization was too difficult. Similarly, multithreading is used more
consistently now. Because of OpenGL, flushing vertex/index buffers to
the GPU has to happen on the main thread, but everything else can be
multithreaded. With outer loops processing all relevant PBVH nodes,
it's now trivial to apply multithreading wherever possible.
Testing performance, overall this commit results in a 10% improvement in
the time between opening a file with a large mesh sculpt and the first
possible interaction. Specifically I measured a change from 8.4 to 7.6
seconds on a completely visible 16 million vertex mesh with a Ryzen 7950x.
I also measured a decrease in memory usage from 4.79 to 4.31 GB.
For multires I observed a similar improvement in memory usage,
though less of a performance improvement.
There are still significant opportunities for future improvement. #122775
would be particularly helpful. #99983 would be helpful too, though more
complicated, and #97665 describes the problems a bit more generally.
Part of #118145.
Pull Request: https://projects.blender.org/blender/blender/pulls/127002
This allows more flexibility about how we store undo data. Potentially
we wouldn't need to store everything segmented per-node if we didn't
expose the `undo::Node` struct.
Part of #118145.
Pull Request: https://projects.blender.org/blender/blender/pulls/127116
- Use `float3` C++ vector instead of pointers
- Return directly instead of using temporary boolean variable
- Use separate loops for "original positions" case to simplify hot loops
The issue is due to a dependency cycle which leads to access of data
which is not ready yet.
The dependency cycle was introduced in ada367a0e9.
This change makes it so there is no dependency cycle in the setup from
the report by re-routing dependencies a bit: the light linking now
bypasses the geometry component and is only wired to an operation
related on instancing collection (but not use by a boolean modifier).
Pull Request: https://projects.blender.org/blender/blender/pulls/127143
Previously, the `AttributeIDRef` wrapper was needed because it also had to
contain a pointer to an `AnonymousAttributeID`. However, since
b279a6d703 this is not necessary anymore.
Therefore we can use "raw" `StringRef` now which reduces the mental overhead
when working with attributes and also simplifies code.
Pull Request: https://projects.blender.org/blender/blender/pulls/127140
Functional Changes:
- Custom shapes using empties now supports line width.
- Line width is supported on MacOS.
- Fixed Stick bone drawing on MacOS.
Some shaders are duplicated and ported to the new
primitive expansion API.
The legacy code inside `overlay_armature.cc` have been
guarded behind `NO_LEGACY_OVERLAY` which can
be enabled to make sure no legacy code is used unnoticed.
This allows for spotting more easily code that needs to be
ported. Moreover, it is easier to remove this legacy code
when the time comes.
Rel #102179
Pull Request: https://projects.blender.org/blender/blender/pulls/126474
Resovle regression in [0].
Pointers in `action.chanbase` were used without first loading the
list-base. In this case the intention was to skip loading legacy
data, so clear the list instead.
[0]: c7bf1a697e
Copying an existing scene was creating a new scene where all the
caches were off. Likewise, "show missing media" flag and proxy
settings was not copied either.
Pull Request: https://projects.blender.org/blender/blender/pulls/126876
Original code was quite unorganized and not as easy to read through.
There were basically 3 code paths:
1. Division of `AVStream` duration by its timebase
2. Division of `AVFormatContext` duration by its timebase, with possible
AV offset compensation
3. Simply using frame count from `AVStream`
Finally there was possibility of ending up with duration of 0 in
specific case where `pFormatCtx->duration == AV_NOPTS_VALUE`, but I did
not find any test case for this (Added in aebb32748e).
During investigation for PR #126866, I have concluded, that before
commit 8903205dd9, the code which compared duration of stream and
container was incorrectly always true. But it resulted in correct
behavior for about 4 years. Code was reorganized with that assumption,
so above listed code paths are in order of possible execution. Exception
is code path 3, which is run first, but it's result is pretty much always
discarded.
Since all these workarounds are added around code path 3, it is safe
to assume, that it is least precise, so it should be considered last.
Pull Request: https://projects.blender.org/blender/blender/pulls/127010
The change was accidentally done in #121383 which primarily concerned
itself with overlay text colors, but started to use TH_BACK theme color
for the draw manager text (e.g. for geometry nodes value visualization)
outline color. Change behavior to use black or white outline color, based
on lightness of text color.
Pull Request: https://projects.blender.org/blender/blender/pulls/127071
In some cases when there are no faces there are no corner domain
topology attributes. Though this could be changed theoretically,
it's simpler to just make sure they exist in the few places we resize
a mesh rather than creating a new one from scratch.
It's possible for the `bArmature.collection_array` to be null if Bone
Collections were never added after armature creation. This could trip up
undo processing later when we call `MEM_freeN` on the collection.
Use a `MEM_SAFE_FREE` call instead which handles checking for null, as
well as setting to null when complete.
Pull Request: https://projects.blender.org/blender/blender/pulls/126945
Make sure the deform normals caches stored in `SculptSession` are
cleared after topology changes. These should eventually be stored
in an actual mesh rather than `SculptSession` which would simplify
the situation.
Before some recent refactors, normals were always calculated
when creating the sculpt BVH tree. Switching from dyntopo BMesh
back to base mesh sculpting, that didn't happen anymore.
Nowadays it makes more sense to update the normals as necessary
where they are used, so the intent of the code that uses normals
is clearer.
Pull Request: https://projects.blender.org/blender/blender/pulls/127111
The issue was that we were misinterpreting the `ANIMFILTER_FCURVESONLY`
flag in the animation filtering code. We were taking it to mean that
literally only actual fcurve channels should be included, but in fact
it should include the channel groups for those fcurve channels as well.
The graph editor code (but not the dopesheet code) depended on this
interpretation to function correctly, and doesn't display the groups
at all without it.
This fixes the issue by not excluding channel groups even when that
flag is set. This also updates the documentation of that flag to
clarify its actual semantics.
Pull Request: https://projects.blender.org/blender/blender/pulls/127108
This removes `AnonymousAttributeID` which was "attached" to every anonymous
attribute before. It adds more complexity than is justified for its
functionality.
It was originally introduced to keep the reference count of the anonymous
attribute so that it can be deleted automatically when the attribute is not
referenced anymore. For quite some time we have had deterministic attribute
life-times though which don't rely on the reference count anymore.
Anonymous attributes are sometimes shown in the UI as "friendly looking" string
like `"UV Map" from Cube`. Some information necessary for this was also stored
in `AnonymousAttributeID`. However, this can also be solved differently.
Specifically, this functionality has now been added directly to
`AttributeFieldInput`.
This refactor also allows removing `AttributeIDRef` which was mainly introduced
because we had to keep the `AnonymousAttributeID` attached with the attribute
name. Just using simple string types to identify attributes can reduce the
mental overhead quite significantly. This will be done as a separate refactor
though.
Pull Request: https://projects.blender.org/blender/blender/pulls/127081
This change does some preparations before we implement persistent
caching for static shaders.
- Move ownership of pipeline cache to the pipeline pool.
- Use two pools. one is only used for static shaders
other for non static shaders.
Related to #126229
Pull Request: https://projects.blender.org/blender/blender/pulls/127100
The term "tool" is historic from before the actual tool system got
introduced. Since then the term was already a bit confusing, because it
wasn't directly related to the tool system, but there was still some
relationship between the two. Now brushes and their types are decoupled
much more from the tool system, with a single "Brush" tool supporting
all kinds of brushes (draw, grab, cloth, smooth, ...).
For a more clear terminology, use "brush type" instead of "tool".
For #126032 we need to write the brush type to the asset metadata (done
in !124618), so we can filter brushes based on the type (so the grease
pencil eraser tool only shows eraser brushes, for example). I'd like to
use future proof names for that to avoid versioning of asset metadata in
future, so I'd rather do the full naming change now.
RNA properties (thus BPY names) are not changed for compatibility
reasons. Can be done in 5.0, see blender/blender#124201.
Pull Request: https://projects.blender.org/blender/blender/pulls/126796