PixelBuffer required addition of buffer re-allocation during mapping
to avoid host updates over-writing previous in-flight data as required
by the GPU. Changes allow multiple copies of existing pixel data to
be in-flight simultaneously.
Authored by Apple: Michael Parkin-White
Pull Request: https://projects.blender.org/blender/blender/pulls/110305
In `Layer::remove_frame` there is a case where the frame is not removed,
but overridden by a null-frame. In this case, the frames map was not
tagged, when it should have been.
Changing the frames map would lead to a crash later in undo.
This was because the `frames_storage` was not written to file corectly.
When the `frames_storage` was tagged dirty, it recreated the
`frames_storage.num` as well as the `keys` and `values` pointers.
The `keys` and `values` pointers were written after the update, but
since the `num` is just an `int` in the embeded struct, it was written
before being updated. This lead to an out-of-sync state and later
to the crash.
The fix makes sure we write the struct *after* updating it.
Use `parallel_for` instead of the C threading API, extract some
constant checks from hot loops, and use `EnumerableThreadSpecific`
for thread-local storage.
Pull Request: https://projects.blender.org/blender/blender/pulls/105940
Text of preview-tile widgets would change color while pressing the mouse
button on them, this wasn't useful and just made the UI feel glitchy.
The widget background already indicates the state well.
Preview-tile widgets are currently only used in the asset view template.
More usages will be introduced in the asset-shelf patch (#104831).
Caused by 5ed14e9269.
That commit accidentally removed the `copy_v2_v2_int(t->mval, mval);`
line which was responsible for initializing the value of `mval`.
This was because the `ob->runtime.geometry_set_eval` was populated
with the new `GreasePencilComponent` but
`GeometrySet::compute_boundbox_without_instances()` did not compute
the bounding box of the grease pencil geometry.
Thus the bounding box was not correctly set and the object not
correctly rendered.
functions imported from creator.cc still had extern the "C"
attribute causing a linker error due it it looking for the
undecorated symbol for these functions.
Whenever `grow_array` in
`blender/source/blender/blenkernel/intern/grease_pencil.cc` was called,
it would not free the original array after relocating the data to the
newly allocated memory. This fixes the memory leak.
functions imported from creator.c were missing the extern "C"
attribute causing a linker error due it it looking for the
decorated symbol for these functions.
PR adds support for the selection of grease pencil layers in
animation editor.
- selection status is stored in `GreasePencilLayerTreeNode`
- Existing `GP_LAYER_TREE_NODE_SELECT` flag is used for selection
- selection of channel updates the active layer in object properties
Part of #110056
Pull Request: https://projects.blender.org/blender/blender/pulls/110133
Adaptation of the operator `ACTION_OT_keyframe_insert` to take into account grease pencil channels.
Grease pencil keyframes can now be inserted in blank mode, or in additive mode (duplicate the current frame in the new keyframe).
Two API functions were added :
* `add_duplicate_drawings` which copies the data of a drawing to creates a duplicate, and
* `insert_duplicate_frame` which creates a duplicate frame of an existing one either by copy or instance.
The additive mode option is also added to the UI.
The Layer method `frame_key_at` previously private was set to public.
Pull Request: https://projects.blender.org/blender/blender/pulls/110649
Replace `BKE_mesh_face_flip_ex()` with `bke::mesh_flip_faces()`.
This gives better performance since it avoids custom data name
lookups for every face index, and processes data in a more cache
friendly way. Also remove the `CustomData_swap` API function
as mentioned in 09b6eac5c4.
Flipping 16 million faces, I observed a 3.25x speedup, from 760 to 230 ms.
Pull Request: https://projects.blender.org/blender/blender/pulls/110702
The C-style API is still in place, but the implementation
is moved to a virtual method.
This is part of unification of viewport and final render
structure.
Should be no functional changes.
Ref #108618
Pull Request: https://projects.blender.org/blender/blender/pulls/110696
Caused by 91b27ab637, which caused the final position
arrays to be returned in more situations (in this case, when the final
result is a non-wrapper mesh). Instead, use the cage mesh, which
is more correct anyway-- it just wasn't always available before.
Face set code modifies visibility of faces, then flushes those changes
to vertex and edge visibility. However, then it did an extra flush back
from vertices to faces and edges, which shouldn't be necessary.
Each of the four algorithms is different, and not all of them will
parallelize linearly, but for large meshes these "flushing" operations
begin to become noticeable compared to other multithreaded code.
For example, flushing visibility to vertices and edges after a change
to faces became 3.75x faster, from 90 to 24 ms.
Also avoid duplicating selection interpolation logic, use the attribute
API instead.
The aim is to replace the `BKE_mesh_faces_flip` functions with
this newer C++ function using the attribute API. But that is must
be called by RNA, so move this to blenkernel to avoid a circular
dependency between the geometry module and RNA.
The Library Overrides view of the Outliner was casting a
`TreeElementOverridesData` pointer to an `ID` pointer, which would be
undefined behavior. Make sure it uses the actual ID referenced by the
`TreeElementOverridesData`.
Instead of the default `add` and `remove` functions for the frames map,
use `add_new` and `remove_contained` for when it is known that a value
is or isn't in the map already. This should be slightly more efficient
(and just better practice overall).
This was caused by `mod` not being available to integer
types. It isn't part of the GLSL stadard officially.
In this particular case, it is not needed. so replace it
with the `%` operator.
Adds a user count to drawings to track how many frames use the drawing.
If the user count hits `0` the drawing should be deleted.
Also adds a function to delete a frame in a layer. This will
decrement the user count of the drawing and delete it if there are no
users left. This is consistent with the way GPv2 worked.
Pull Request: https://projects.blender.org/blender/blender/pulls/110579