Commit Graph

120055 Commits

Author SHA1 Message Date
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
Aras Pranckevicius
67c9b97058 ImBuf: slightly faster byte->float image conversion
IMB_buffer_byte_from_float for "predivide" case was doing two function
calls per pixel. Make it do the work with one function per pixel.
Do the same in IMB_buffer_byte_from_float_mask.

IMB_buffer_byte_from_float on one thread, running on 4K resolution
image, on Ryzen 5950X (Win10/VS2022): 27.4ms -> 24.4ms

Pull Request: https://projects.blender.org/blender/blender/pulls/127308
2024-09-09 13:15:30 +02:00
Aras Pranckevicius
a904db3ee7 Color management: skip no-op colorspace transforms for float images (mostly affects VSE)
In VSE, the default setting is that even float images are all in sRGB
(or rather, display) space. However code that was drawing the final
VSE float image on screen, was first converting it to linear space,
and then back to display space.

An optimization already existed that skipped "no-op" conversions for
byte images. This adds a similar case for float images.

Note: I found a previous fix to an old issue (#39953, commit fe29f92030)
in related code. Probably should be double checked whether it has not
regressed.

VSE at 4K resolution, with a single 4K resolution EXR image strip,
playback on Ryzen5950X (Win10/VS2022):
- Playback average FPS 11 -> 18
- Time for sequencer_preview_region_draw part: 92ms -> 58ms
  - Time for sequencer_draw_display_buffer in there: 52ms -> 15ms

Pull Request: https://projects.blender.org/blender/blender/pulls/127305
2024-09-09 13:13:16 +02:00
Vitalijs Komasilovs
0db13bef19 Fix #126463: EEVEE: wrong texture binding for Curves Info node
Fixing texture binding according to `Curves Info` node attributes.

Pull Request: https://projects.blender.org/blender/blender/pulls/127206
2024-09-09 13:03:04 +02:00
Philipp Oeser
1f49236a54 Fix #127180: Outliner assert selecting unselectable editbones
Prevent actual selection (keeping activation of the bone).

Since `buttons_context_path_bone` / `buttons_context_path_pose_bone` go
after `arm->act_bone` / `arm->act_edbone` to set the context "bone",
"pose_bone" or "edit_bone" -- and that is set no matter what in
`tree_element_bone_activate` / `tree_element_active_ebone__sel` -- we
can set the bone active, not actually select it and the Properties
Editor can still show the relevant info.

Pull Request: https://projects.blender.org/blender/blender/pulls/127235
2024-09-09 12:46:25 +02:00
Jeroen Bakker
994e05accd Vulkan: Encoding of Mat3 in Std430 struct
The encoding of mat3 in std430 was incorrect leading to a drawing
artifact in the direction control of sunlight in sky textures.

The error was that every 3 floats requires an additional float
as each row of the mat3 is aligned to 16 bytes.

Pull Request: https://projects.blender.org/blender/blender/pulls/127246
2024-09-09 12:44:22 +02:00
Nathan Vegdahl
55765c86c7 Anim: gray out disconnected action slots in channel list
The approach taken here is really simple: just check if the channel
either is or belongs to an action slot, and if so then reduce the
alpha of its text label if it's unselected and its slot has no users.

Pull Request: https://projects.blender.org/blender/blender/pulls/127257
2024-09-09 12:40:03 +02:00
Dalai Felinto
d939557e4b UI: Fix viewport selection icons
These icons are extremely order dependent and set dynamically in a
four-way option at:

`rna_object_type_visibility_icon_get_common`

Problem introduced on: 60cc73afe6, when I sorted the non-toggle icons
alphabetically.

Bug reported by Pablo Vazquez in real life.
2024-09-09 11:10:51 +02:00
Sietse Brouwer
9c9b562d54 GPv3: Smooth active vertex group operator
This PR implements the "Smooth" operator in Weight Paint mode for GPv3.
The Smooth operator smooths the weights in the active vertex group by
applying a gaussian blur to the vertex weights.

The operator has two properties:
- `factor` (0.0 - 1.0): The extent to which the smoothed weight is
applied to the original weight, where 0.0 is 'keep the original weight'
and 1.0 is 'replace fully with the smoothed weight'.
- `repeat`: The number of times the smoothing is executed. A higher
value means more smoothing.

The operator is added to the 'Weight' menu in Weight Paint mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/126429
2024-09-09 10:59:06 +02:00
Pratik Borhade
29160edd0b Fix #126702: GPv3: Export PDF selected frames exports some unselected frames
`frame_at()` returns previous keyframe of which the drawing is visible
at current framec. When previous keyframe is selected, all the intermediate frames
till iteration reach the next keyframe are also exported.
To fix this, look inside `frames()` map instead of `frame_at()`.

Pull Request: https://projects.blender.org/blender/blender/pulls/126779
2024-09-09 10:44:15 +02:00
Hans Goudey
1bc0ec1b80 Sculpt: Improve mesh BVH build time by storing less temporary data
Each time the face bounds are used after they're initially computed, we
recompute the center of the bounds. We only use the actual bounds to
calculate the bounds of each node to decide how it should be split.
This commit changes to store the bounds centers instead, and just use
the full bounds as a type for the parallel reduction.

In a test with a 16 million face grid on a Ryzen 7840U, I observed a
1.28x decrease in BVH build time, from 1072 to 836 ms.

I didn't apply a similar change to multires grids BVH building because
it's not clear the same bottleneck exists due to the lower ratio of
"primitives" (grids) to final subdivided vertices.
2024-09-08 16:54:51 -04:00
Iliya Katueshenock
0358a3d11f Fix #127319: Access violation in Sample Nearest Surface node
There was garbage in a C structure which does not have default constructor.
So manual index initialization is required.

Pull Request: https://projects.blender.org/blender/blender/pulls/127322
2024-09-08 21:14:15 +02:00
Hans Goudey
06b25fee0e Cleanup: Remove useless/incorrect comments
The "simplify" comment copied many times shows that these
aren't helpful-- they waste space and give the wrong impression
about the purpose of code comments.
2024-09-08 12:07:10 -04:00
Hans Goudey
75c17761dd Fix #127302: Grease pencil "close" operator causes crash 2024-09-08 12:02:48 -04:00
Hans Goudey
48231f5094 Fix #127280: Crash in sculpt original data lookup
1fe7feb4ec used the wrong data lookup functions which would
end up calling the dereference operator on an empty optional.
2024-09-08 11:50:02 -04:00
Jacques Lucke
2ddc574ad9 Fix #127233: performance regression with new attribute filters
When I first developed the attribute filters they were just a `FunctionRef`
and thus could be stored by value in this struct. Now that they are a
virtual type, that is not possible anymore.
2024-09-07 19:04:54 +02:00
Hans Goudey
8283bf37a2 Fix #127260: Cloth brush crash with large mesh
The array for the cloth simulation node states was created with
an incorrect size.
2024-09-07 10:04:39 -04:00
Sean Kim
2204157a2c Refactor: Clear result neighbor vector for vert_neighbors_get_bmesh
This commit opts to align the behavior with `vert_neighbors_get_mesh`
which also clears the provided vector instead of leaving it up to the
caller to do so.

Pull Request: https://projects.blender.org/blender/blender/pulls/127273
2024-09-07 05:53:33 +02:00
Sean Kim
01fa3b861e Fix: Sculpt dyntopo boundary automasking processing too many neighbors
Pull Request: https://projects.blender.org/blender/blender/pulls/127270
2024-09-07 04:11:41 +02:00
Sean Kim
916812bbcf Cleanup: Specialize cavity occlusion automasking
Part of #118145.

Pull Request: https://projects.blender.org/blender/blender/pulls/127218
2024-09-07 03:39:29 +02:00
Jesse Yurkovich
b520ae6efe Cleanup: Small non-functional cleanup in usd_writer_mesh
Changes include:
- Simplify active_uvmap_name handling
- Remove unneeded defaultTime global variable

Pull Request: https://projects.blender.org/blender/blender/pulls/127268
2024-09-06 23:34:51 +02:00
Hans Goudey
27ce4b9fc4 Fix: Sculpt: Automask bake crash with dyntopo topology changing brush 2024-09-06 15:54:17 -04:00
Hans Goudey
1787fe7e6c Fix: Sculpt: Debug assert in raycast original data lookup
Raycast and "nearest to ray" use the local vertex indices from triangles
to index original data, which needs to be sized with all the vertices, not
just unique vertices. Add a new function to access that data.
2024-09-06 15:30:44 -04:00
Harley Acheson
0e690d3abb UI: Dialog Drag Cursors
Mouse cursor changes when hovering at the top of popup blocks to
indicate that these can be dragged. On Mac this looks like a hand,
while for other platforms it is a drag cursor.

Pull Request: https://projects.blender.org/blender/blender/pulls/118358
2024-09-06 20:22:24 +02:00
Harley Acheson
458c60269b UI: Hand Cursors
Add multiple "hand" mouse cursors. These are mostly needed for Mac,
which needs open, close, and pointing hand cursors. This also adds
similar for Windows, but just for completeness and testing.

Pull Request: https://projects.blender.org/blender/blender/pulls/127164
2024-09-06 19:05:59 +02:00
Miguel Pozo
eab640e044 Draw: Batch shader compilation for image render
Enable deferred parallel batch compilation for image renders.
This replaces the use of the `WM_job` system with a regular thread,
since `WM_job` requires access to the main context,
which is not accessible from the render thread.
It also simplifies the system so it creates a single thread at startup
and deletes it at exit.

Pull Request: https://projects.blender.org/blender/blender/pulls/125005
2024-09-06 18:13:43 +02:00
Hans Goudey
2952498724 Cleanup: Sculpt: Add debug timing for multires BVH build 2024-09-06 12:13:04 -04:00
Nathan Vegdahl
e991765a83 Fix: incorrect indentation in action editor with layered actions
The code that decides the indentation for channel groups and fcurve channels
already accounted for the difference between the Action Editor and Dopesheet/
Graph Editor, since the level of nesting is different in the Action Editor vs
the other two.  However, it didn't account for the difference between legacy and
layered actions, which have different nesting in the Action Editor.

Additionally, before layered actions were introduced it was impossible for
the Action Editor to display channels from e.g. materials, but those channels
can now be displayed in the Action Editor via the slot system.  However, the
indentation code was structured such that material (etc.) channels were *always*
indented as if they were in the Dopesheet/Graph Editor, where they're always
nested under the IDs that use them.

This commit fixes the issue by having a separate code path for indenting in the
Action Editor that only indents channel groups and fcurve channels, and which
properly handles the difference between layered and legacy actions.

Pull Request: https://projects.blender.org/blender/blender/pulls/127202
2024-09-06 17:37:50 +02:00
Christoph Lendenfeld
7cb0e2cd1e Anim: Convert FCurve groups from legacy to layered
When converting a legacy Action to a layered Action,
also convert group memberships.

This is important for bones to retain their structure in
the Channel Box.

Pull Request: https://projects.blender.org/blender/blender/pulls/127188
2024-09-06 17:24:13 +02:00
Clément Foucault
dc89c935fa GPv3: Implement Wireframe batch
Fix #120604

Pull Request: https://projects.blender.org/blender/blender/pulls/127147
2024-09-06 16:50:21 +02:00
Laurynas Duburas
4948ade694 Overlay-Next: Edit-Mesh measurements
Overlay-Next version of mesh measurements.

Rel #102179

Pull Request: https://projects.blender.org/blender/blender/pulls/127124
2024-09-06 16:45:40 +02:00
Hans Goudey
a434ead0d8 Cleanup: Sculpt: Rename BMesh data scatter/gather functions
Remove "vert" from the name since it's inferred by the argument type.
2024-09-06 10:36:53 -04:00
Hans Goudey
d87aae2b06 Cleanup: Sculpt: Reorder data gathering functions in header 2024-09-06 10:36:53 -04:00
Clément FOUCAULT
8551cbfa05 Overlay-Next: Prepass: Conservative raster
Allow selection of very thin meshes.

Rel #102179

Pull Request: https://projects.blender.org/blender/blender/pulls/127244
2024-09-06 16:14:49 +02:00
Nathan Vegdahl
92a7229f67 Anim: implement channel grouping/moving ops for layered actions
This adds layered animation support to the following operators, allowing users to manage the grouping and arrangement of fcurves in the channel list:

- "Group Channels"
- "Ungroup Channels"
- "Move Channels"

Pull Request: https://projects.blender.org/blender/blender/pulls/127080
2024-09-06 16:12:05 +02:00