Commit Graph

117289 Commits

Author SHA1 Message Date
Campbell Barton
e00fed43e6 Cleanup: redundant struct declarations 2024-09-11 16:25:25 +10:00
Pratik Borhade
a8137e62c6 Fix #127382: Area docking crash with Action editor
Crash triggered due to null string (index is -1).
Problem and fix both are similar as !126584

Pull Request: https://projects.blender.org/blender/blender/pulls/127402
2024-09-10 23:29:30 +02:00
Hans Goudey
853269aeb0 Sculpt: Make multires BVH build similar to mesh
Structure the multires grids PBVH build to be similar to meshes,
splitting face indices into groups instead of grid indices. This
removes one step of indexing, decreases the amount of temporary
data, and allows sharing the majority of the implementation with
the mesh BVH build.

In a test file with 4 million faces at multires level 1, this reduced
BVH build time from 149 to 70 ms. The improvement will be
significantly lower for higher subdivision levels.

Pull Request: https://projects.blender.org/blender/blender/pulls/127429
2024-09-10 22:46:04 +02:00
Iliya Katueshenock
0b7090ca37 BKE: Utilities to create curves and point clouds without attributes
Same as #118297.

Pull Request: https://projects.blender.org/blender/blender/pulls/120368
2024-09-10 21:48:59 +02:00
Hans Goudey
a4b42daf80 Refactor: Sculpt: General cleanups to ensure PBVH function 2024-09-10 15:39:03 -04:00
Hans Goudey
7cd6b7175f Sculpt: Parallelize max face size reduction during grid BVH build 2024-09-10 15:29:53 -04:00
Hans Goudey
883568c0b1 Cleanup: Improve face size variable name 2024-09-10 15:29:53 -04:00
Hans Goudey
8cd80b0fac Cleanup: Correct comment and add note
I think the limit is unnecessary because I can't think of a good
reason for it and there is no reasoning in the git history.
2024-09-10 15:29:53 -04:00
Sean Kim
b748cf316f Fix: GPv3: Avoid NaN when reprojecting
Missed in https://projects.blender.org/blender/blender/pulls/126255

The `placement_loc_` variable was not initialized if using an axis
`ReprojectMode`. Also sets the `DrawingPlacementDepth` mode correctly.

Pull Request: https://projects.blender.org/blender/blender/pulls/126621
2024-09-10 21:28:26 +02:00
Hans Goudey
5d429bb063 Fix #127400: Sculpt mode drawing uses wrong version of color attribute 2024-09-10 14:55:25 -04:00
Lukas Tönne
488b5cda54 Fix: GPv3 interpolation tool incorrect point count
The interpolation tool computes the point count of output curves as the
maximum of each curve pair. The pairs are ordered by to/from frame
numbers. The point counts were stored in the "original" pair order, so
curve density could be quite incorrect.

Pull Request: https://projects.blender.org/blender/blender/pulls/127353
2024-09-10 19:35:10 +02:00
Falk David
942499382d GPv3: Vertex Paint Mode
This adds the vertex paint mode and all of the tools
from GPv2:
 * Average
 * Blur
 * Draw
 * Replace
 * Smear

Pull Request: https://projects.blender.org/blender/blender/pulls/125674
2024-09-10 18:56:31 +02:00
Sybren A. Stüvel
d30582cc56 Refactor: remove incorrect forward declaration of struct Action
Remove the forward declaration of `struct Action` from
`DNA_constraint_types.h`. That struct hasn't existed in a long time.

No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/127419
2024-09-10 17:55:58 +02:00
Sybren A. Stüvel
c4c8c46968 Refactor: fix wrong struct typedef name in DNA_action_types
Fix `typedef struct ActionChannelBag { ... } ChannelBag;` so that the
'typedef name' is also `ActionChannelBag`.

Note that this does _not_ change the struct name in DNA. It's purely for
the naming in our code.

No functional changes.
2024-09-10 17:55:57 +02:00
Lukas Tönne
81fdae07ef Fix #125922: GPv3 interpolate tool copies curve attributes as well
Interpolate tool was only mixing point attributes, leaving the
output curves without most curve attributes. Now the interpolate_curves
functions actually copy or mix curve attributes as well.

Only float-based attributes are interpolated for now to avoid
meaningless values for material indices, boolean flags, etc. Other
attribute types are simply copied from the first curve in each pair.

Pull Request: https://projects.blender.org/blender/blender/pulls/127350
2024-09-10 17:53:23 +02:00
Pratik Borhade
5a9b1ddb6c Cleanup: Curves: Store first/last stroke point in variable
Store `points.first()/last()` in a variable to prevent multiple calls to
range function. Also discussed in !126591.

Pull Request: https://projects.blender.org/blender/blender/pulls/127344
2024-09-10 15:16:04 +02:00
Sybren A. Stüvel
3fdc9e9637 Refactor: convert BKE_action.h to C++
Move the contents of `BKE_action.h` into `BKE_action.hh` and remove
C-isms.

No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/127407
2024-09-10 14:55:47 +02:00
Sybren A. Stüvel
3ca0b4fc4d Anim: clarify 'disabled' message for bone collection operations
Clarify the 'disabled' message in the tooltip for certain bone collection
operations. They now tell you to create an override "on the Armature Data",
and not just "on the Armature". This should clarify that it's not enough
to create an override on the armature Object.

Pull Request: https://projects.blender.org/blender/blender/pulls/127405
2024-09-10 14:36:25 +02:00
Sybren A. Stüvel
636d83fbea Refactor: convert BKE_nla.h to C++
Rename `BKE_nla.h` to `BKE_nla.hh` and remove C-isms.

No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/127395
2024-09-10 13:41:01 +02:00
YimingWu
06e70e7bc0 GPv3: Implement Grease Pencil to mesh conversion
Support Object > Convert > Mesh option for grease pencil v3.
This does the conversion by first converting it into Curves then use the
same routine to convert Curves into Mesh wires.

Pull Request: https://projects.blender.org/blender/blender/pulls/123835
2024-09-10 13:36:31 +02:00
Aras Pranckevicius
4556624edd VSE: Draw thumbnails in timeline by default
Now that thumbnails are faster to load and less flicker-y (#126405), and faster to draw in the timeline (#126972), they can be enabled by default.

Existing files continue to use their current setting.

Pull Request: https://projects.blender.org/blender/blender/pulls/127403
2024-09-10 13:01:24 +02:00
Iliya Katueshenock
957330043f Refactor: Attributes: support different source and destination domains in propagation utilities
Pull Request: https://projects.blender.org/blender/blender/pulls/127026
2024-09-10 12:59:03 +02:00
YimingWu
168c568058 Fix #126946: GPv3: Handle erase mode when using a tablet pen
Pressing ctrl-click should switch the drawing tool into a eraser
for grease pencil. This is now handled by detecting
`EVT_TABLET_ERASER` and switch to `BRUSH_STROKE_ERASE` mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/126962
2024-09-10 11:59:08 +02:00
Jeroen Bakker
59fa82118e Vulkan: Blendfile thumbnail generation
Vulkan would crash when generating a thumbnail in case there is no
3D viewport in the active workspace. When this happens the front buffer
is downscaled as thumbnail. We didn't create a front buffer as swap
chains are handled differently.

We work around this issue in the same way as Metal does. Create a dummy
front framebuffer and share the surface texture. When the thumbnail
generator reads from the front buffer it will read the data that was
created by the back buffer.

Pull Request: https://projects.blender.org/blender/blender/pulls/127393
2024-09-10 11:02:43 +02:00
Sybren A. Stüvel
ed0cfe7312 Anim: fix crash drawing Action groups when built without Action Slots
Fix a crash that happens when drawing Action groups in the dope sheet, when
Blender is built without experimental features (hence without Action
slots) and it has loaded a blend file with slotted Actions.

Basically a pointer needs to be set to `nullptr` when reading such a file,
as it ensures that the rest of the code treats the group as "from a legacy
Action".

Pull Request: https://projects.blender.org/blender/blender/pulls/127339
2024-09-10 10:59:29 +02:00
Jeroen Bakker
e22fc36fd5 Vulkan: Incorrect selection in edit mode
Edit mode selection returns incorrect indices. The reason is
that the extent of the area downloaded to the CPU for evaluation was
incorrect and read pixels could not in the place where they are
actually stored.

Was an oversight when fixing face selection. It wasn't that noticeable
there as faces typically cover a larger space.

Pull Request: https://projects.blender.org/blender/blender/pulls/127386
2024-09-10 10:58:37 +02:00
Campbell Barton
c702e42f92 Cleanup: code-comments in smooth-view 2024-09-10 18:57:18 +10:00
Campbell Barton
884d882155 Cleanup: track the "changed" state when exiting local-view
Previously it was assumed that exiting the local-view succeeded
even when nothing was changed.

Now VIEW3D_OT_localview doesn't perform any updates
when existing the local view does nothing.
2024-09-10 17:31:12 +10:00
Campbell Barton
3ad14a6fc0 Viewport: use the smooth-view preference when refreshing
Replace hard coded value with a preference to match other smooth-view
operations, making it possible to disable smooth-view.
2024-09-10 17:31:08 +10:00
Campbell Barton
2593fffa4d Fix local view failing to restore axis-roll
Entering local-view, then setting an axis via the num-pad and exiting
local view would restore the original axis but not the axis-roll.

Store the axis-roll for local-view & smooth-view operations.
2024-09-10 17:31:06 +10:00
Campbell Barton
d122d19f00 Fix missing redraw when setting the view axis
When the viewport orientation matched the view axis,
setting an axis view didn't redraw the region.

This caused the viewport text & grid not to update.
2024-09-10 17:31:05 +10:00
Campbell Barton
9d6ecd0ed6 Fix local view toggle setting the view to "User"
Activating local view could set an axis view to "User"
when activated before the previous action had completed.
2024-09-10 17:31:04 +10:00
Campbell Barton
62dbebc18e Cleanup: pass const depsgraph for viewport funcitons 2024-09-10 17:31:02 +10:00
Harley Acheson
565f9f6b8a UI: Do Not Allow Docking into Temp Windows
Do not allow dragging screen areas into Temp windows, like Properties.

Pull Request: https://projects.blender.org/blender/blender/pulls/127379
2024-09-10 02:43:07 +02:00
Harley Acheson
72a0be0944 UI: Mac Cursors While Docking
With docking enabled, for Mac hovering over the corner actions zones
shows an open hand cursor, while dragging it uses the closed hand
cursor. For other platforms this just uses the "move" cursor.

Pull Request: https://projects.blender.org/blender/blender/pulls/127291
2024-09-10 00:55:52 +02:00
Harley Acheson
2859eabd1c Fix #127364: Status Bar Icons Issues
The icons used for the status bar event icons were recently sorted,
resulting in a reversal of the filled/unfilled pairs. This PR makes
them not rely on the order. This also improves the centering of the
text in the buttons. The complaint about the word "Space" is because
this word has a descender. This requires using BLF_boundbox, rather
than BLF_width_and_height to get the position relative to the baseline.

Pull Request: https://projects.blender.org/blender/blender/pulls/127376
2024-09-10 00:06:10 +02:00
Sean Kim
d745325829 Cleanup: Specialize calc_pose_data function
Part of #118145

* Removes PBVHVertRef and other related function usage in this method

Pull Request: https://projects.blender.org/blender/blender/pulls/127375
2024-09-09 23:54:52 +02:00
Sean Kim
7b9004d57b Fix #127328: Snake Hook brush rotation applied incorrectly for symmetry
Pull Request: https://projects.blender.org/blender/blender/pulls/127373
2024-09-09 22:44:20 +02:00
Hans Goudey
6e0223a04c Fix #127356: Expand face set snapping doesn't work
Mistake in dd1454a648.
2024-09-09 15:34:33 -04:00
Lukas Tönne
8aead3a6d9 Fix #126707: SVG export nodes wrong hierarchy ignores clipping
SVG was exported with all the paths in the base node, which breaks the
`clipPath` reference.

Pull Request: https://projects.blender.org/blender/blender/pulls/127355
2024-09-09 18:42:20 +02:00
Hans Goudey
ad7d7212c1 Sculpt: Face corner indexed mesh GPU data extraction
Reduce VBO data uploaded to the GPU by a bit less than 2x, at the cost of
creating triangle index buffers. Since the index buffers only need to be
created when topology changes, this means significantly less data needs
to be uploaded to the GPU while sculpting. The hot loops for extracting
mesh data also don't need to access triangles or face visibility, and also
drawing can become more efficient with indices for cached vertex values.

Part of #118145.

Pull Request: https://projects.blender.org/blender/blender/pulls/127351
2024-09-09 18:19:16 +02:00
Aras Pranckevicius
9d3b2b51a7 Cleanup: None of VSE effects have three image inputs
So remove all code related to "ibuf3" handling since it is just always null.

Pull Request: https://projects.blender.org/blender/blender/pulls/127348
2024-09-09 18:02:59 +02:00
Clément FOUCAULT
897f7a8482 GPU: Fix assertion when trying to use shader printf on metal
Make sure all printing happens inside render boundaries
since it needs to read a storage buffer which needs to
record some commands inside command buffers.
2024-09-09 16:30:36 +02:00
Hans Goudey
dc4ff79f64 Cleanup: Formatting
VS Code doesn't stage the whitespace changes apparently.
2024-09-09 09:56:13 -04:00
Hans Goudey
6462216ef7 Cleanup: Sculpt: Simplify arguments to BVH build function
Pass the already partitioned span face indices rather than the full
array and separate start and end indices.
2024-09-09 09:50:00 -04:00
Clément FOUCAULT
adbb732ba2 Overlay-Next: Sculpt
Rel #102179

Pull Request: https://projects.blender.org/blender/blender/pulls/127261
2024-09-09 15:39:28 +02:00
Hans Goudey
eee34de007 Sculpt: Simplify and optimize BVH build node partitioning
Use `std::partition` instead of implementing something similar
ourselves. This is much easier to understand, and it's also much
faster and requires less memory during the build.

I observed a change in the runtime building a 16 million face
BVH from 492 to 389 ms, a 1.27x improvement (with a Ryzen
7950x).

`std::partition` is not multithreaded. I expect there would be
some improvement from multithreading this, at least for the
first few splits.

Currently this only applies to Mesh sculpting.

Pull Request: https://projects.blender.org/blender/blender/pulls/127332
2024-09-09 15:16:28 +02:00
Aras Pranckevicius
577630d24f VSE: Optimize away some pointless image copies when applying modifiers
SEQ_modifier_apply_stack is called from exactly one place, and it always
was throwing away the input image, and taking the newly produced image.
Which means, we can stop copying it. Just run the modifiers on the
input image.

In a test file that is HD (1080p) resolution, two EXR image sequences,
adjustment layer with Color Balance, and a text strip on top,
playback framerate (Ryzen 5950X, Win10/VS2022) goes 20.8 -> 22.1 fps

Pull Request: https://projects.blender.org/blender/blender/pulls/127346
2024-09-09 14:55:24 +02:00
Nathan Vegdahl
0b5e878ae1 Refactor: use references in channel group unit tests
@dr.sybren recommended this in the review of #127080, to be consistent with
the more modern C++ style Blender is trying to adhere to in new code.

No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/127343
2024-09-09 14:04:24 +02:00
Aras Pranckevicius
5c259a1bae VSE: Faster processing of alpha-over strip at the bottom of strip stack
When a strip with alpha-over blend mode (which is default) has an alpha
channel and is at the bottom of the whole stack, there's no point in
blending it with black color; the result will be identical.

So stop doing that. Also, whenever some other case happens at the bottom
of the stack (e.g. some other blend mode), create the fake "black input"
image at the needed color type (float or byte) and with the correct
color space already applied. Otherwise, especially for floats, VSE
spends much time converting this fake black input from byte to float,
and then converting it to sequencer color space.

Test case of two EXR files blended over each other, at 4K resolution,
on Ryzen 5950X (Win10/VS2022):
- whole sequencer_preview_region_draw 115ms -> 75ms
- seq_render_give_ibuf part: 64ms -> 24ms

Pull Request: https://projects.blender.org/blender/blender/pulls/127310
2024-09-09 13:16:12 +02:00