Instead of allocating a separate bitmap per grid for the hide status, store
all the bits in a recently added C++ data structure that stores all bits in one
contiguous memory chunk. When nothing is hidden, nothing is allocated
(that saves 32 MB for a 16 million vertex multires sculpt). Intuitively it
could have better performance because of the cache benefits of
contiguous memory, but this is hard to measure. It also has a nicer
API than `BLI_bitmap`.
I discussed this with Sergey in person recently. Most of the changes are
just straightforward refactors. The part that isn't is a change to the "show/hide"
operator to structure it similarly to the mesh handling in 4e66769ec0.
Pull Request: https://projects.blender.org/blender/blender/pulls/115687
This merge does not rename any ID. In case a conflict happens (an ID of
the same name and library already exists in destination Main), its
counterpart in source Main is not moved, and its usages by other
moved-from-source IDs are remapped accordingly.
Libraries are also properly de-duplicated, and remapped as necessary.
Source Main is always freed by this function, since it is either empty,
or contains left-over IDs very likely to have invalid relationships
after the merge.
NOTE: This commit also enables `main_test.cc` unittests, which was
comitted by mistake in fe3cb11ae4, sorry about that.
Pull Request: https://projects.blender.org/blender/blender/pulls/115671
Usually Library pointers should not be affected by remapping, but this
can be needed in some cases.
WARNING: Use with caution, this is potentially a dangerous operation for
Main data integrity/validity.
Speedup the "apply zebra stripes" image loop by multi-threading it.
For non-float images, avoid an extra image copy that was not doing
anything useful.
4K UHD resolution, Windows Ryzen 5950X:
- LDR: whole `sequencer_get_scope` 16.4ms -> 5.3ms, just `draw_zebra`
part: 7.5ms -> 3.3ms
- Float image: whole `sequencer_get_scope` 126.6ms -> 114.1ms, just
`draw_zebra` part: 22.4ms -> 7.4ms. Whole scope is still expensive
due to color management work being done.
Pull Request: https://projects.blender.org/blender/blender/pulls/115622
Defer creating events until the "frame" callback runs to ensure
the tablet state has been fully updated before the events are created.
This also avoids redundant motion events which are now only sent
when the motion/pressure or tilt callbacks run.
Updating NLA menu to be more inline with VSE / other Animation editors.
Remove "Edit" drop down, and instead split operators into "Track" & "Strip" Menus. Update Add menu to be more concise.
Pull Request: https://projects.blender.org/blender/blender/pulls/114805
The position of the vertical value slider has to be clamped to be
within the area of that slider, otherwise it can draw outside the
range when a value is over 1.
Pull Request: https://projects.blender.org/blender/blender/pulls/115680
While in weight paint mode, `ob.vertex_groups.active` can be None.
This happens when selecting a non-deforming bone, or a deforming bone
that doesn't have a group yet.
Now check for this.
Pull Request: https://projects.blender.org/blender/blender/pulls/115666
This operator (`SCULPT_OT_reveal_all`) is redundant with
the "Hide Show" operator (`PAINT_OT_hide_show`). Since
the latter was recently changed to be much faster, remove the
former and update keymaps and menus. The industry compatible
keymap actually already contains the hide/show operator.
Pull Request: https://projects.blender.org/blender/blender/pulls/115629
Move the geometry shading add_operation_node call to
build_object_geometry_datablock.
Avoids triggering an assertion when the same geometry data is shared
by multiple objects.
Pull Request: https://projects.blender.org/blender/blender/pulls/115615
This function is only used in Sequencer code to convert source byte images
into float images. For a "simple case" where there is no color space
conversion needed, it was doing that on a single thread, in two passes over
the image (first byte -> float conversion, then alpha premultiply).
VSE 4K resolution playback, with two image strips where one of them has
"convert to float" option, on Windows / Ryzen 5950X:
- Overall playback FPS: 3.40 -> 4.03. Still very slow, and a lot of time
is spent in allocating, clearing and deleting various temp images, as
well as final color conversion for display.
- `seq_imbuf_to_sequencer_space` part: 217.9ms -> 86.6ms. Most of
remaining cost is just in just memory allocation+clear, which is why
it's not drastically faster due to threading.
Pull Request: https://projects.blender.org/blender/blender/pulls/115628
The experimental GPU compositor crashes when the render size is huge.
This is just due to GPU texture allocation failing. The patch fixes that
by downscaling the render result when reading, then upscaling it again
when writing. Additionally, the render size was adapted to the
downscaled size since it is used by other input nodes. This is not an
ideal solution, but it a good temporary solution to prevent crashes
until we have proper support for huge textures.
Pull Request: https://projects.blender.org/blender/blender/pulls/115299
The compositor doesn't run when changing node tree options. That was due
to a nullptr notifier reference for RNA node tree edits.
This patch uses the node tree ID for the notifier reference.
Additionally, the listener code was extended to always tag the node tree
when the reference is null, which converts missing updates issues like
this one to superfluous updates, since it is safer.
Pull Request: https://projects.blender.org/blender/blender/pulls/115532
This layout is more flexible and polymorphic.
While the worst case is worse (4 + 3 layers),
the common case is more optimized (2 + 2 layers).
The average written closure data is also lower
since we can compact the data for special cases
which are quite frequent.
Some adjustment had to be made in the denoise an
tile classify shaders.
Pull Request: https://projects.blender.org/blender/blender/pulls/115541
Currently, in weight paint mode, there is an icon for
face and vertex selection mode, but there isn't one
for the default mode where the user can select a bone
in any tool by alt clicking.
This lack of indication might lead to confusion for the users
when they are not able to select a bone by
alt clicking during weight painting.
By adding a bone selection icon when there is a pose
mode armature, we can communicate to the user that:
1. they can select a bone while the bone selection icon is active.
(when they are not in face or vertex selection mode)
2. they have forgot to select an armature when entering
weight paint mode by not showing the bone selection
icon at all when there is no pose mode armature.
When the bone selection icon is inactive,
the user can't select a bone.
(alt clicking selects face and vertex mode's respective element)
When no armature is selected when entering weight paint mode,
the bone selection icon doesn't show up indicating that the user
has forgot to select an armature.
(The user is also unable to select a bone by alt clicking.)
## Selection tool for bone selection mode
Currently, while selection tools exist for face and vertex
selection mode, one doesn't exist for the default mode
(bone selection mode). As the default mode will be getting
a clear indicator that it will function as a bone selection mode,
I added a selection tool entry for the bone selection mode.
Face and vertex selection modes has the shortcut 1 and 2,
so it seemed natural to give bone selection mode the shortcut of 3.
Pull Request: https://projects.blender.org/blender/blender/pulls/115409
This PR includes the popup menu used to select a material pressing `U` key.
The menu is used in Draw, Sculpt and Vertex paint mode in GPv2 but this patch only includes Draw mode because other modes are not avaliable in GPv3 yet.
Related to #114203
Pull Request: https://projects.blender.org/blender/blender/pulls/114694
- New Operator: GREASE_PENCIL_OT_layer_hide
- New Operator: GREASE_PENCIL_OT_layer_reveal
- Added menus to Edit and Draw Modes
- Added Keymap via _template_items_hide_reveal_actions()
Note: Operator names were changed for consistency with other layers operators that use _layer_ on their names
Pull Request: https://projects.blender.org/blender/blender/pulls/114348