Commit Graph

120055 Commits

Author SHA1 Message Date
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
Clément FOUCAULT
fc5d3fb998 Overlay-Next: Use unique handle per object
Add a new function to the draw manager to only
issue a unique resource ID per `ObjectRef`.
This avoids the memory overhead of duplicating
the handle for each overlay.

The handle is stored inside the `ObjectRef` on
first query.

Rel #102179
2024-09-14 12:43:39 +02:00
Laurynas Duburas
713ca95121 Fix: Overlay-Next: Grid2D tiles background and boundaries
Fixes Grid2D tiles background and boundaries drawing.

To reproduce  switch to mesh edit mode and in UV editing view overlay
options set `Tiles X` or `Y` to more than 1.

Pull Request: https://projects.blender.org/blender/blender/pulls/127516
2024-09-14 11:14:03 +02:00
Campbell Barton
8a29277ca8 Logging: replace print with logging if an animation fails to load
Also remove noisy print when a thumbnail can't be generated from an
animation. Similar prints have been commented and mainly seem useful
for debugging.
2024-09-14 15:26:12 +10:00
Campbell Barton
7e2785927c PlayAnim: don't set the title to the filename on WIN32
On MS-Windows the current frames file set the window title.

Remove this because it's strange to have the title flickering over
each name and the animation player already supports showing the filename
inside the window.
2024-09-14 15:26:11 +10:00
Campbell Barton
a8458534e8 Cleanup: use references in wm_playanim, int2 for window/image sizes 2024-09-14 15:06:10 +10:00
Campbell Barton
9d47d5f8a3 Fix crash scrubbing in the animation player with 1 frame loaded
Regression in caused an integer division by zero.

[0]: e6933e526c
2024-09-14 12:36:14 +10:00
Campbell Barton
95d29c9464 Cleanup: remove redundant null check & unused variable 2024-09-14 12:36:12 +10:00
Campbell Barton
30bbd1583f Cleanup: replace the term "folder" with "directory" for CMake files
This was already more common an in keeping with cmake's own naming.
2024-09-14 12:35:02 +10:00
Campbell Barton
6a1bd2ff40 Cleanup: use C++ comments for disabled code 2024-09-14 12:35:00 +10:00
Harley Acheson
019d987072 UI: Increase Width of ID Search Lists
As discussed in our UI Module meeting, this PR increases the width of
ID Search lists by 40%.

Pull Request: https://projects.blender.org/blender/blender/pulls/127599
2024-09-14 03:20:09 +02:00
Harley Acheson
a5779347b6 Fix #127438: Block Drag Cursor Issues
Avoid setting default cursor while number dragging. But always reset
cursor in title area if even there is a button in that space. Decrease
the title height slightly to work with title-less popups.

Pull Request: https://projects.blender.org/blender/blender/pulls/127598
2024-09-14 00:07:42 +02:00
Hans Goudey
7b69c82494 Refactor: Sculpt: Tag all nodes positions changed together, store in array
Replace the `PBVH_UpdateBB` flag with a separate vector of booleans.
The simplest impact of this is that we can tell when there are no changed
nodes in constant time. Besides that, it also works better with the recent
IndexMask usage for selections of nodes, and allows better const
correctness too, since nodes themselves don't have to be changed
when positions are changed. This also leads into plans to change PBVH
draw data tagging to avoid having to reupload all attributes when only
one changes.

Part of #118145.

Pull Request: https://projects.blender.org/blender/blender/pulls/127587
2024-09-13 21:31:08 +02:00
Sean Kim
181f2f8eee Fix #127576: Crash in Sculpt mode when using Sample Color off mesh
Also fixes an unreported crash if no color attribute exists

Pull Request: https://projects.blender.org/blender/blender/pulls/127589
2024-09-13 21:17:20 +02:00
Hans Goudey
96e71dc62c Cleanup: Sculpt: Various changes to indexing in displacement smear brush
Part of #118145.
2024-09-13 15:15:11 -04:00
Guillermo Venegas
033f18b5e9 Fix #127502: Popup resizes few times after closing a layout panel
Avoid truncation errors causing unneccessary resizing by passing floats
to UI_block_translate. That function translates block and button rects
which are floats.

Pull Request: https://projects.blender.org/blender/blender/pulls/127505
2024-09-13 20:04:15 +02:00
Hans Goudey
1241e3a5e4 Fix #127556: Sculpt smooth brush missing updates
Mistake in d64f62e4fa.
2024-09-13 13:15:14 -04:00
Laurynas Duburas
d6778f42d4 Overlay-Next: Origin
Overlay-Next  object centers.

Rel #102179

Pull Request: https://projects.blender.org/blender/blender/pulls/127578
2024-09-13 19:14:17 +02:00
Laurynas Duburas
d37eb7a998 Overlay-Next: Edit text
Overlay-Next version of  Edit text.

Rel #102179

Pull Request: https://projects.blender.org/blender/blender/pulls/127513
2024-09-13 19:04:55 +02:00
Guillermo Venegas
b721374e9b Fix #127504: Layout panel missaligned in UI_DIR_UP popups
Layout panels are relative to `block->rect.ymax`. This PR applies the
overflow created above `block->rect.ymax` as initial offset.

Pull Request: https://projects.blender.org/blender/blender/pulls/127507
2024-09-13 18:49:48 +02:00
Clément FOUCAULT
4e25dfb065 Overlay-Next: Mode Transfer
Rel #102179

Pull Request: https://projects.blender.org/blender/blender/pulls/127580
2024-09-13 18:39:28 +02:00
Sean Kim
bb97d651aa Cleanup: Remove unused variable
Pull Request: https://projects.blender.org/blender/blender/pulls/127584
2024-09-13 17:57:55 +02:00
Christoph Lendenfeld
cb6ed12ef1 Anim: Reuse action between related data
When inserting keys, look on related IDs for an action to reuse that.
This will make use of the slot system on the new layered action to ensure
the animation data doesn't collide.

This is done on the `id_action_ensure` function since that is the common
function to get an action off an `ID`.

IDs with more than 1 user will be skipped.

"Related ID" in this case is hardcoded with a `switch` statement for each ID type.
The system builds a list starting from the ID that should be keyed and
keeps expanding the list until an action is found or no more
non-duplicate IDs can be added. (This is using linear search for duplicate checks,
but I don't think we will deal with a lot of IDs in this case)

Pull Request: https://projects.blender.org/blender/blender/pulls/126655
2024-09-13 17:57:22 +02:00
Falk David
d911d673a4 Cleanup: Fix compiler warnings
Cleanup unused variable and remove unecessary typedef.
2024-09-13 17:54:35 +02:00