Commit Graph

113078 Commits

Author SHA1 Message Date
Clément Foucault
11b07cf309 Overlay-Next: Motion Path
Rel #102179

Fixes discrepancies on Mac.

Pull Request: https://projects.blender.org/blender/blender/pulls/127623
2024-09-16 11:22:54 +02:00
Nathan Vegdahl
68a6317207 Fix: build fails when experimental features are disabled
Caused by using a function behind an experimental feature `ifdef`
in non-experimental code. The fix is to move the function out from
behind the `ifdef`, since it's perfectly fine to use in non-experimental
code.
2024-09-16 11:01:54 +02:00
Jeroen Bakker
0311d8082b Fix #127636: Inconsistent GPU module doc
Documentation of the `gpu.state.active_framebuffer_get` is inconsistent.
It mentions `framebuffer_active_get`. I believe the cause is that the
C methods in the Python wrapper are named inconsistently.

This PR fixes this by making the wrapper + documentation consistent
with the top level API.

Pull Request: https://projects.blender.org/blender/blender/pulls/127677
2024-09-16 09:51:04 +02:00
Campbell Barton
f392d9edad Cleanup: use int2 for WMInitStruct & screen size accessors 2024-09-16 12:40:07 +10:00
Hans Goudey
a0eccb4550 Cleanup: Multires: Use FunctionRef and lambdas in reshape 2024-09-15 22:01:13 -04:00
Hans Goudey
aba29c655a Cleanup: Multires: Use C++ threading API in reshape file 2024-09-15 22:01:13 -04:00
Campbell Barton
276d47095d Cleanup: use explicit cast when comparing size_t to -1 2024-09-16 11:39:03 +10:00
Campbell Barton
a988a85a5e Cleanup: use const variables/arguments 2024-09-16 11:39:02 +10:00
Campbell Barton
2360a3911c BLI_listbase: add a utility to check the number of items in the list
To avoid unnecessary looping over listbase items the function
`BLI_listbase_count_at_most` was used however it resulting in an awkward
expression: `BLI_listbase_count_at_most(list, count + 1) == count`
replace this with `BLI_listbase_count_is_equal_to(list, count)`.
2024-09-16 11:39:00 +10:00
Campbell Barton
47c6ac2930 Refactor: use integer values for cursor width in BLF
As all the values involved in cursor offset calculation are integers,
treating the cursor width to a float doesn't give any benefits.
2024-09-16 11:38:58 +10:00
Campbell Barton
94183b9e2e Refactor: add a function to access the window size in pixels
Replace uses of WM_window_native_pixel_x,y with
WM_window_native_pixel_size() which returns an int2 for convenience
and avoids an unnecessary call to GHOST_GetNativePixelSize(..).
2024-09-16 11:38:57 +10:00
Campbell Barton
bf7c52cfd5 Fix error in stereo3d side-by-side display
Regression in [0] for side-by-side & top-bottom display.

[0]: e01cadd657
2024-09-16 11:38:56 +10:00
Sean Kim
5c38eb0d81 Refactor: Sculpt: Add face set offset parameter for BMesh functions
Part of #118145.

Even though BMesh face set functionality does not currently work, there
are some reasonable assumptions we can make about the needed parameters
for some APIs.

This commit changes the signature for relevant unique face set functions
so that future changes are easier when / if face sets are fully
supported within BMesh.

Pull Request: https://projects.blender.org/blender/blender/pulls/127640
2024-09-15 23:24:13 +02:00
Harley Acheson
2278f8eb1b UI: Small Corrections to Text Caret Placement
This PR has very slight corrections to text cursor placement in input
widgets. The most important is a check for the situation where the
right edge of the current character can be greater than the left edge
of the next character. This can happen for some thin characters before
a space. Otherwise the code assumes RTL direction and gives an
incorrect placement. This also slightly tightens the position when at
the start of string, just after a space, or at end of the string.

Pull Request: https://projects.blender.org/blender/blender/pulls/127662
2024-09-15 21:43:49 +02:00
Jacques Lucke
13d30e22a1 Fix: modifier execution time not set for grease pencil modifiers 2024-09-15 18:02:51 +02:00
Jacques Lucke
f2e557725d Fix: Geometry Nodes: crash when using gizmo after changing area type 2024-09-15 17:46:32 +02:00
Campbell Barton
10e8f2f889 Cleanup: various non-functional changes 2024-09-15 23:22:22 +10:00
Campbell Barton
8b2ab34ec6 Cleanup: avoid redundant copy to access the filename 2024-09-15 23:14:13 +10:00
Campbell Barton
a42611be92 Cleanup: remove redundant checks 2024-09-15 23:14:11 +10:00
Campbell Barton
17f809718a Cleanup: avoid shadowing variables 2024-09-15 23:14:10 +10:00
Campbell Barton
9b39b4c91c Cleanup: use const pointers/references 2024-09-15 23:14:09 +10:00
Campbell Barton
1104e4233d Cleanup: pass string by const reference 2024-09-15 23:14:08 +10:00
Campbell Barton
9be29e1bbc Cleanup: match function & declaration names 2024-09-15 23:14:07 +10:00
Campbell Barton
1d21c98fc8 Cleanup: quiet dangling-reference GCC warning 2024-09-15 23:14:05 +10:00
Campbell Barton
0d9c4bc5b3 BKE_lib: avoid potential read uninitialized memory in BKE_id_copy_*
BKE_id_copy_in_lib took an argument `r_newid` which was was to
initialize `new_id` in the functions body.

While this may not have caused any user visible bugs, it's error prone,
one caller even passed in an uninitialized pointer.

- Rename `r_newid` to `new_id_p` since it's not a return argument.
- Initialize the value from all callers.
2024-09-15 23:07:17 +10:00
Campbell Barton
085da6a08a Fix error in font scale rounding for the animation player 2024-09-15 23:07:16 +10:00
Campbell Barton
630eff9b5e Fix fake_retiming_key_init returning uninitialized stack memory
The SeqRetimingKey returned from fake_retiming_key_init left
original_strip_frame_index & retiming_factor uninitialized.
2024-09-15 23:07:15 +10:00
Jacques Lucke
35bb4f4711 Geometry Nodes: support accessing repeat zone lazy-function graph from Python
The tricky thing here is that this graph is only generated while geometry nodes
is evaluated and is generally only stored temporarily. To make it accessible via
Python, the accessor method will cause a reevaluation specifically to log the
generated graph.
2024-09-15 00:56:53 +02:00
Sean Kim
c8ff7f41a1 Fix: Invalid default value for vert_face_set_get with empty Span
The default value is expected to be 0, not INT_MIN

Pull Request: https://projects.blender.org/blender/blender/pulls/127628
2024-09-14 21:16:07 +02:00
Hans Goudey
c6ce6dbe01 BLI: Add IndexMask set_bits function
This is like "to_bits" but doesn't clear the bit span first.

Pull Request: https://projects.blender.org/blender/blender/pulls/127625
2024-09-14 21:09:41 +02:00
Kevin C. Burke
5475040906 Fix: Spelling mistake in Grease Pencil API docs
Fix: Spelling mistake in Grease Pencil API docs

https://projects.blender.org/blender/blender-manual/issues/104920

Pull Request: https://projects.blender.org/blender/blender/pulls/127597
2024-09-14 20:18:30 +02:00
Hans Goudey
c5ccc8ceea Fix #127602: Sculpt multires drawing crash with material index attribute
The evaluated mesh is empty since its data is replaced with the SubdivCCG.
2024-09-14 13:23:38 -04:00
Hans Goudey
2946a840ad Fix: Sculpt: Avoid nested threading in undo node push
This can run into problems with missing task isolation
when thread local variables are used in iteration over nodes.
It's likely to just add overhead anyway; there should be enough
parallelism coming from the number of nodes anyway.
2024-09-14 13:01:42 -04:00
Hans Goudey
7283cbef65 Cleanup: Sculpt: Add todo comments for PBVH data to remove 2024-09-14 13:01:42 -04:00
Hans Goudey
a021dd36ef Cleanup: Sculpt: Remove unnecessary PBVH node flags
These have been made redundant by previous commits.
Part of #118145.
2024-09-14 13:01:42 -04:00
Hans Goudey
0499e061d0 Cleanup: Sculpt: Remove drawing update tests
Updating attributes is now done specifically for each attribute,
and topology and visibility updates tag the draw cache data
explicitly too. That makes checking for updates with these
tags unnecessary.
2024-09-14 13:01:42 -04:00
Hans Goudey
0b4820b563 Cleanup: Sculpt: Deduplicate node visibility update on build 2024-09-14 13:01:42 -04:00
Hans Goudey
b77ff173b0 Refactor: Sculpt: Use bit vector for visibility update tags
Also refactor topology update tags, which are used quite similarly
(they mean the same for the drawing code, except for BMesh).

Part of #118145.
2024-09-14 13:01:42 -04:00
Hans Goudey
65c2e5abde Cleanup: Sculpt: Remove unused PBVH redraw tag function 2024-09-14 13:01:42 -04:00
Hans Goudey
76c322047e Sculpt: Only re-upload mask attribute data
Similar to the previous commits, previously all GPU buffers
were recreated when only masks changed. Now only
that masks are re-uploaded, using the same mechanism.

Part of #118145.
2024-09-14 13:01:42 -04:00
Hans Goudey
30c1475dfd Sculpt: Update node mask status eagerly
Similar to 7b69c82494.
We didn't make any good use of the time in between changing
mask values and recalculating whether nodes were fully masked
or not masked at all. There was no point in the lazy calculation.
Eager calculation should be faster too, for the same reason as
the above commit.

Part of #118145.
2024-09-14 13:01:42 -04:00
Hans Goudey
d24e8029d2 Sculpt: Only re-upload face color attribute data
Similar to the previous commit, previously all GPU buffers
were recreated when only a color attribute changed. Now only
that attribute is re-uploaded, using the same mechanism.

Part of #118145.
2024-09-14 13:01:42 -04:00
Hans Goudey
60ab232afb Sculpt: Only re-upload face set data when changed
Similar to the previous commit, previously all GPU buffers
were recreated when only face sets changed. Now only face
sets are re-uploaded, using the same mechanism.

Part of #118145.
2024-09-14 13:01:42 -04:00
Hans Goudey
0c677e9494 Sculpt: Only change position draw buffers on PBVH deformation
Previously tagging node positions dirty set the `PBVH_UpdateDrawBuffers`
flag which was then used by `node_draw_update_mask` and
`tag_all_attributes_dirty`, which, as hinted by the name, causes a refresh
of all the PBVH GPU vertex buffers, not just positions and normals.

Instead of using that flag, add a function to the draw cache to tag only
position-related data dirty. This should give a performance improvement
when there are also face sets, masks, and/or generic attributes being
extracted for drawing.

Part of $118145.
2024-09-14 13:01:42 -04:00
Hans Goudey
900184ac4b Sculpt: Use separate bit vector for BVH node normals dirty tags
Similar to 7b69c82494.
Part of #118145.
2024-09-14 13:01:42 -04:00
Hans Goudey
afa1a6bebf Fix: Data race writing to bitmap in PBVH draw
Mistake in d601bf7e3d.
A bit vector can't be written to in parallel.
2024-09-14 13:01:42 -04:00
Hans Goudey
5b03fee0d2 Sculpt: Use bit vector for bounds dirty tags
Reduce the amount of memory used for the tags by 8x
and improve the performance of changed nodes IndexMask
creation.

Part of #118145.
2024-09-14 13:01:41 -04:00
Laurynas Duburas
34f9b7e36c Overlay-Next: grid added to ShapeCache
Substitute for `DRW_cache_grid_get()` added to `overlay::ShapeCache`.

Pull Request: https://projects.blender.org/blender/blender/pulls/127594
2024-09-14 18:22:17 +02:00
Jacques Lucke
2274d6a4b1 Fix: subversion bump because updated Python API in previous commit
This changed the API: 54a13d462f
2024-09-14 17:28:36 +02:00
Jacques Lucke
54a13d462f Debug: support getting dot graphs from Python
This allows building tools that simplify Blender core development.

The depsgraph already exposed the dot graph using the `debug_relations_graphviz`
method. This has been extended to return the data as a string. The filepath is
optional now.

Similar functions have been added for node trees. Note that these should be used
on evaluated node trees.
2024-09-14 17:10:33 +02:00