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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
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
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.
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.
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
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
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
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