Commit Graph

117289 Commits

Author SHA1 Message Date
Pratik Borhade
28fe4f6996 GPv3: Switch to properties tab when stroke icon clicked in outliner
When clicked on icon of GPv3 datablock, switch to object data properties
tab.

Pull Request: https://projects.blender.org/blender/blender/pulls/127139
2024-09-04 23:45:43 +02:00
Harley Acheson
382244c258 UI: Docking Drag Mouse Cursor
This shows the docking feedback very similar to how tooltips are shown
elsewhere. It describes the operation and also includes the icon and
name of the moving/changing area.

Pull Request: https://projects.blender.org/blender/blender/pulls/126898
2024-09-04 22:43:57 +02:00
Hans Goudey
fafe7ccc35 Cleanup: Add define for printing PBVH build timing information
Pull Request: https://projects.blender.org/blender/blender/pulls/127160
2024-09-04 22:33:29 +02:00
Hans Goudey
2aed58a285 Sculpt: Finalize mesh leaf nodes in a separate loop
Decreases BVH build runtime by approximately 6%.
Improve cache locality in the initial splitting loop and the finalization
of mesh leaf nodes by processing them in separate loops. The second
loop calculates the node's vertex indices.
2024-09-04 22:33:27 +02:00
Hans Goudey
fdb5af79d5 Cleanup: Remove unused variable 2024-09-04 22:33:27 +02:00
Hans Goudey
613055016d Sculpt: Parallelize bounds calculation during BVH build
Speeds up building the sculpt BVH tree by over 3x.
The total bounds for all the triangles/grids in the current node is
recalculated for every iteration of the node splitting algorithm that
builds the BVH tree. The first step was parallelized, but since the
number of elements is just divided in half every time, many of the
subsequent bounds calculations are significantly large to benefit from
parallelism too (actually all of them for mesh BVH currently, since the
leaf size is about 4000).
2024-09-04 22:33:27 +02:00
Hans Goudey
689f3aeb91 Refactor: Sculpt: Simplify BVH build material index split 2024-09-04 22:33:27 +02:00
Sean Kim
f27c1327b8 Fix #127130: Snake Hook applies twist continually
Caused by d42aec3cf7

The prior cleanup missed setting the optionals into an invalid state
when the original code would set the `valid` flag to false.

Pull Request: https://projects.blender.org/blender/blender/pulls/127158
2024-09-04 22:22:36 +02:00
Sean Kim
1de0645c24 Cleanup: Various sculpt.cc enum changes and removal
* Turn `StrokeFlags` into `enum class` and add `uint8_t` specifier
* Remove unused anonymous enum & unused struct

Pull Request: https://projects.blender.org/blender/blender/pulls/127157
2024-09-04 21:50:45 +02:00
Harley Acheson
4317f50f5f UI: Clear Recent Cleanup Option
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
2024-09-04 21:07:06 +02:00
Hans Goudey
89095826fd Fix: Debug build error after recent cleanup
The assert is redundant with asserts in `Span` now.
2024-09-04 13:58:58 -04:00
Hans Goudey
d84522390c Sculpt: Ignore sharp faces when building BVH tree
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.
2024-09-04 13:26:16 -04:00
Hans Goudey
d7d19ec297 Sculpt: Push multiple undo nodes at once for some operations
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.
2024-09-04 13:13:43 -04:00
Hans Goudey
c21ec8221d Refactor: Sculpt: Split mesh and grids undo data storage
Makes it simpler to optimize later on and makes it possible to simplify
some arguments.
2024-09-04 13:13:43 -04:00
Hans Goudey
b14badf3ea Cleanup: Subdiv: Use Span and float3 for vertex positions 2024-09-04 13:13:43 -04:00
Hans Goudey
f610f2e843 Cleanup: Sculpt: Make remaining undo struct definitions private 2024-09-04 13:13:43 -04:00
Anthony Roberts
5f34338296 Windows: Disable shader draw parameter support on certain Qualcomm GPUs
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
2024-09-04 18:19:54 +02:00
Hans Goudey
d601bf7e3d Sculpt: Restructure PBVH drawing to avoid overhead
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
2024-09-04 17:40:50 +02:00
Hans Goudey
1fe7feb4ec Refactor: Sculpt: Make sculpt undo node definition private
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
2024-09-04 17:16:41 +02:00
Hans Goudey
e5988cf912 Refactor: Sculpt: Miscellaneous cleanups to node intersect/nearest loops
- 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
2024-09-04 11:07:23 -04:00
Sergey Sharybin
40ae2d7df6 Fix #126949: Regression: Geometry nodes - instances and boolean operation bug
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
2024-09-04 16:31:48 +02:00
Bastien Montagne
3915a84fc6 Fix #127142: Do not instantiate loose 'annotation' legacy GPv2 data on link. 2024-09-04 16:21:55 +02:00
Sebastian Parborg
cfbb6b5627 Fix: Remove unused typedefs from the legacy armature overlay 2024-09-04 16:13:42 +02:00
Jacques Lucke
89ae1ba38a Attributes: remove AttributeIDRef in favor of just using strings
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
2024-09-04 16:13:03 +02:00
Clément Foucault
3ab60972b5 Fix: Overlay-Next: Missing select_bind call 2024-09-04 14:35:18 +02:00
Laurynas Duburas
e310e0450f Overlay-Next: add selection mode to relations
Adds selection mode to relations.
Fixes `overlay_extra_wire_vert.glsl` to support `drw_CustomID` and `in_select_buf` for `select_id_set`.

Pull Request: https://projects.blender.org/blender/blender/pulls/127082
2024-09-04 14:29:35 +02:00
Clément Foucault
05deb10405 Fix: Overlay: Intel driver hang caused by shader compilation
Thanks @xavierh for the fix.

Fix #126812
2024-09-04 13:44:42 +02:00
Campbell Barton
36415cfaad Fix memory leak loading legacy meshes without any edges 2024-09-04 21:28:16 +10:00
Jacques Lucke
8fd1a6d094 Fix: Geometry Nodes: don't allow accessing anonymous attributes from named attribute nodes 2024-09-04 13:07:25 +02:00
Jacques Lucke
d38b7286e9 Cleanup: use StringRef instead of std::string in a few places 2024-09-04 13:07:25 +02:00
Clément Foucault
508b39661d Overlay-Next: Armature
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
2024-09-04 12:56:37 +02:00
Campbell Barton
5ec49b61e9 Fix crash linking legacy animation data
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
2024-09-04 20:43:44 +10:00
Miguel Pozo
d3909d42c6 Fix #125506: GP flicker in Video Sequencer
`gpencil_engine_enabled` is uninitialized at `Film::init` time,
so this replaces the check to rely on the DepsGraph instead.

Pull Request: https://projects.blender.org/blender/blender/pulls/127113
2024-09-04 12:13:40 +02:00
Campbell Barton
8db8185276 Fix crash reading files from v2.66
Old files can contain names without any name part (`*` in this case).

Resolve the buffer overflow by checking for nil before the name begins.
2024-09-04 20:12:06 +10:00
Aras Pranckevicius
76f7c19c8d Fix: Scene copy does not copy VSE cache/proxy flags
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
2024-09-04 11:57:54 +02:00
Campbell Barton
ad67ad63fe Cleanup: spelling in comments 2024-09-04 19:34:15 +10:00
Campbell Barton
842f87d1de Cleanup: unused parameter warnings 2024-09-04 19:34:15 +10:00
Campbell Barton
9d3ddf6a04 Fix crash entering edit-mode for text objects from old blender versions 2024-09-04 19:34:15 +10:00
Campbell Barton
de7fced7eb Fix #126990: Changing editors doesn't set the default tool
Regression in [0].

[0]: 83fe5712ab
2024-09-04 19:34:15 +10:00
Richard Antalik
23f2db9eed FFmpeg: Simplify code for determining video frame count
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
2024-09-04 08:40:01 +02:00
YimingWu
fe4bd519f3 Fix #127073: GPv3: Auto keying in edit mode
GPv3 didn't handle auto keyframe insertion in edit mode transformation,
now corrected by using `insert_duplicate_frame` when target frame doesn't
exist.

Pull Request: https://projects.blender.org/blender/blender/pulls/127078
2024-09-04 06:06:21 +02:00
Aras Pranckevicius
174387e4d9 Fix #126908: 3D view background color affects attribute text outline color
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
2024-09-03 22:01:14 +02:00
Hans Goudey
324e1441a2 Fix #127085: Extrude mesh crash with no faces
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.
2024-09-03 14:13:21 -04:00
Jesse Yurkovich
787eb2b433 Fix: prevent free of nullptr during bone collection undo processing
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
2024-09-03 19:19:26 +02:00
Sybren A. Stüvel
4d4ad34f4c Anim: Action Slot icon
Add an icon for Action Slots. Design task: #123372

Pull Request: https://projects.blender.org/blender/blender/pulls/127102
2024-09-03 18:33:36 +02:00
Miguel Pozo
6f81cb7c63 Fix #126194: Parallel shader compilation crash 2024-09-03 18:13:19 +02:00
Jacques Lucke
3393af16da Cleanup: remove unused FunctionRef::call_safe
It's better to be more explicit in the calling code about what
happens when there is no function.
2024-09-03 18:06:12 +02:00
Hans Goudey
fc7de7c92f Cleanup: Sculpt: Use specific node types for original data access
This already exposes one place where we used the wrong function.
2024-09-03 11:13:52 -04:00
Hans Goudey
aaf445830c Fix: Sculpt: Geodesic distances crash after recent cleanup
Caused by 49409bdc89
2024-09-03 11:13:18 -04:00
Hans Goudey
4f23e4c6b0 Fix: Crash in some cases after disabling dynamic topology
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.
2024-09-03 10:45:20 -04:00