This patch adds support for the Factor and Percentage subtypes for
vector sockets. This is needed by the compositor, since it has some node
inputs that specify locations and sizes relative to image size, and
having factor and percentage subtypes for those improves the UX quite a
bit according to user feedback.
Pull Request: https://projects.blender.org/blender/blender/pulls/138805
* Removes `SculptSession` from being passed to the raycast callbacks,
it was only used to determine the existence of the `StrokeCache` and
has been replaced with a boolean.
* Use C++ math library where possible.
* Use const where possible.
* Moves most related `SCULPT_` prefixed methods into the corresponding
namespace.
* Renames `SCULPT_stroke_get_location` to `stroke_get_location_bvh`
to avoid potential collisions in the `sculpt_paint` namespace with
other editors & be more clear about the usage.
Pull Request: https://projects.blender.org/blender/blender/pulls/138796
This is similar to how the value is shown when hovering over a value.
It's useful when the name does not fit into the column width.
Requested by Simon.
This patch renames `seq1` and `seq2` to `input1` and `input2` in `Strip`
and `StripSelection` structs to consist with recent refactors in
#132179. It also renames other instances of `seq1` and `seq2` (e.g.
local variables) to `strip1` and `strip2` instead.
There is only one small breaking change to the Python API with
`strips.new_effect()` taking in the new names now. There should be
no other functional changes involved.
Pull Request: https://projects.blender.org/blender/blender/pulls/138296
When using the View Normal automasking mode, the per-vertex calculation
is not prohibitively expensive, unlike the topology and boundary modes.
Additionally, we do not populate the view normal values in the cache
when the brush stroke starts.
Pull Request: https://projects.blender.org/blender/blender/pulls/138906
When performing a raycast into the paint BVH inside Sculpt Mode, there
are two possible values for the cursor's normal: the current vertex's
normal, or a sampled average of the normals in the cursor radius.
The "Grab Silhouette" option of the Grab brush and the "Area Normal"
option of brush automasking both use an initial normal value to
determine a relative influence factor. However, this normal was only
ever using the active vertex normal, not the sampled normal, leading to
a stronger than normal falloff on areas of a mesh that have a high
variance between individual vertex normals.
To further complicate matters, the "Area Normal" setting uses the
sampled normal when the Mesh Filter tool is used, but sculpt brushes
behave as described above. This commit aligns the behavior across all
tool types.
To fix this, check for the existence of this sampled normal when
populating the initial value and use it if found.
Pull Request: https://projects.blender.org/blender/blender/pulls/137692
Currently, depending on whether or not a brush asset is part of a
library, the context menu shown for it changes significantly.
To better support local brush asset modifications, and make the UI more
consistent, this commit exposes the following operators:
* `brush.asset_edit_metadata`
* `brush.asset_load_preview`
* `brush.asset_save`
* `brush.asset_revert`
Of these four operators, the first two are allowed to execute, whereas
the latter two are always disabled on local assets via the corresponding
`poll` methods, as neither is applicable for this usecase.
Related to #138105
Pull Request: https://projects.blender.org/blender/blender/pulls/138376
"Origin to Geometry" was also affected
With very large meshes (report was about this failing for imported
terrain data), we lack precision in `BKE_mesh_center_median`.
First intuition was to just use doubles, but based on the work done
in !132759 to get a more numerically stable way to compute a mean,
we can use that instead.
So this PR moves `compute_sum` into `blender::array_utils`
and re-uses that for `BKE_mesh_center_median`
Pull Request: https://projects.blender.org/blender/blender/pulls/138813
Node groups are now hidden based on the "Show Hidden Files/Data-Blocks"
user preference, similar to how the ID selector search filters the
results based on the user preference.
Note that this PR does **not** change filtering behavior when the
setting is off and you search for a dot.
Pull Request: https://projects.blender.org/blender/blender/pulls/138878
The Node Editor Add menu has filters for not drawing asset catalogs in
the root level. This is done so that catalogs that share names with
built-in menus are appended to said menus.
There is no "Unassigned" built-in menu, just a root level asset menu for
unassigned assets. This menu does not currently have the behavior to
support appending catalogs to it, so assigning assets to a catalog named
"Unassigned" renders said assets unaccessible in the Add Menu.
This patch removes that filter as it was deemed better to just allow the
user to have a root level catalog menu named "Unassigned" instead of
mushing it with the menu for unassigned assets.
Pull Request: https://projects.blender.org/blender/blender/pulls/138874
Improve labels and UI consistency.
- Update color labels: Object, Wireframe, Background
- Rename 'Single' shading color to 'Custom'. Move to the end.
- Rename 'Viewport' color to 'Custom' for consistency.
- Fix alignment of Object Color item labels
Pull Request: https://projects.blender.org/blender/blender/pulls/137408
The current behavior for the Node Editor's Add menu is to list the
user's asset catalogs at the root level of the menu. However, an
exception is made if the catalog has the same name as a builtin menu.
In such case, the asset catalog is appended to that builtin menu,
instead of being drawn at the root level.
How this is currently implemented right now is to have a hard-coded set
of builtin menus in `add_menu_assets.cc`. Certain menus are missing from
this set, particularly newer ones, which may be an oversight during the
creation of these menus.
This patch adds those menus to that list, which are as follows:
- Input/Gizmo
- Input/Import
- Grease Pencil (and all its submenus)
- Texture (in Compositor Nodes)
Pull Request: https://projects.blender.org/blender/blender/pulls/138870
This PR intends to replace the current face corner normals calculation.
Compared to the existing code it has a few benefits:
- It's much easier to understand.
- It doesn't require edges, ideally helping to remove them from caches
and eventually to make them optional.
- It is completely multithreaded using the vert to face map, which is
already used for vertex normals and domain interpolation. The previous
code has a significant single threaded portion that scales with the
size of the mesh.
- Lower peak memory usage: It doesn't require a temporary edge to corner
map, the corner to face map, or a corner domain sized bit vector.
- The code sorting corners around a vertex should be easy to reuse.
- It's over twice as fast. On a test file with custom normals I observe
an overall FPS increase of 2.56x, from 37 to 95.
Pull Request: https://projects.blender.org/blender/blender/pulls/138013
The issue appears to have been that the same depsgraph is evaluated twice at the
same time. Once by the bake code in a background thread and once by gizmo
related event handler.
This patch fixes it by not running event handlers in locked regions. Generally,
accessing evaluated data while the interface is locked (and thus some baking is
usually going on), is not safe.
Pull Request: https://projects.blender.org/blender/blender/pulls/138806
Previously, the modifier name was used to identify it in a compute context or
viewer path. Using `ModifierData.persistent_uid` (which was only introduced
later) has two main benefits: * It is stable even when the modifier name
changes. * It's cheaper and easier to work with since it's just an integer
instead of a string.
Note: Pinned viewer nodes will need to be re-pinned after the change.
Pull Request: https://projects.blender.org/blender/blender/pulls/138864
The conversion from int to float is not supported natively
so it ends up happening beforehand on the CPU or as a
step before the vertex buffer can be used. It's better to just
upload floats in the first place.
Related to:
- 1e1ac2bb9b
- 617858e453
Pull Request: https://projects.blender.org/blender/blender/pulls/138855
Expand the natvis file (which VS IDE debugger uses to visualize custom
data types) to handle:
- blender::Map with pointer keys
- blender::Set with both regular and pointer keys
Pull Request: https://projects.blender.org/blender/blender/pulls/138866
Work around an issue with expanded menus that exists for a long time
already. I briefly tried fixing it, but does not seem straight forward unfortunately
without breaking stuff.
Also see the comment in `ui_item_enum_expand_exec`.
Storing the selection history complicated the selection functions,
especially for situations when functions were called indirectly &
multiple times.
Remove the argument in favor of explicit calls to store elements
in the selection history.
Needed to avoid even more complexity with UV sync-select: see #131642.
Some mice have an additional horizontal scroll wheel. This patch adds support
for receiving such events. By default it is used to scroll 2D editors left and right.
I originally developed this because I was missing it in the spreadsheet, but it
seems to be useful in many other editors too.
It's supported on Linux (Wayland), Windows and macos.
Pull Request: https://projects.blender.org/blender/blender/pulls/138758
Rework internals of how VSE caching is done. Primarily to make all the
caching logic more understandable from development point of view, but
also has several user visible implications (more details in the PR):
- Simpler and fewer caching UI options,
- Disk cache is gone (primary reason: proxies are kinda the same thing),
- VSE cache size set in preferences is actual size used for VSE caches
now (previously caching stopped as soon as whole Blender used that
much memory, even if some memory usage was not about VSE at all),
- Certain scenarios of cache invalidation are faster now.
Pull Request: https://projects.blender.org/blender/blender/pulls/137926
`BKE_object_defgroup_subset_from_select_type` does not consider locked
status of vertex group, ends up smoothing all vgroup when `deform pose bones`
is selected.
Pull Request: https://projects.blender.org/blender/blender/pulls/138435
Previously, the `UserData` and `LocalUserData` classes were only supposed to be
used by the lazy-function system. However, they are generic enough so that they
can also be used by the multi-function system. Therefore, this patch extracts
them into a separate header that can be used in both evaluation systems.
I'm doing this in preparation for being able to pass the geometry nodes logger
to multi-functions, to be able to report errors from there.
Pull Request: https://projects.blender.org/blender/blender/pulls/138861
Fill the missing gaps by going over the action data until we find the
corresponding FCurve in Layer < Slots > Channebags > FCurves.
Channelbads have their `_path` function already, so we can piggyback on
that, just adding the proper FCurve index to the mix.
Part of #137407
Pull Request: https://projects.blender.org/blender/blender/pulls/137956
Pass the new selection mode instead of setting the value in the
BMEditMesh, then calling set.
This makes it possible to compare with the current selection mode
(needed for UV sync select #131642).
These tests were hitting an assert about
invalid format. They were testing for this
legacy format we don't support anymore.
# Conflicts:
# source/blender/gpu/vulkan/tests/vk_data_conversion_test.cc
Caused by 617858e453.
These formats should use types aligned to 4 bytes. That's generally
required by modern GPUs. Uploading with these types also avoids
automatic conversion by the Vulkan backend which is something
we're hoping to remove fully.
In the end this PR removes a bunch of code related to supporting
the older single-byte formats.
Pull Request: https://projects.blender.org/blender/blender/pulls/138836
This merges the public `uiItemS` and `uiItemS_ex` functions into an
object oriented API (`uiLayout::separator`), matching the python API.
This reduces the difference between the C++ API with the python version,
its also helps while converting code from python to C++ code
(or vice-versa), making it almost seamless.
Part of: #117604
Pull Request: https://projects.blender.org/blender/blender/pulls/138826
Currently, there are two main annoying problems with columns widths in the
spreadsheet:
* The initial column width is often too small. This is especially noticeable
with the ID integer attribute.
* There is no way to change the column width.
This patch improves both of these aspects. The initial column width will now be
derived from the content of the spreadsheet. This initial width is then stored
in DNA to make it editable and to avoid having to recompute it on each redraw.
Furthermore, there is a new modal operator to change the width of a column.
Pull Request: https://projects.blender.org/blender/blender/pulls/138657
The old name `modifier_panel_end` was not great because:
* There is no corresponding `*_begin`.
* It sounds more magical then it really is (it just draws the error message).
* It doesn't even have to be at the end as is sometimes the case when there are subpanels.
Pull Request: https://projects.blender.org/blender/blender/pulls/138797
This unifies vertex and texture data formats
into a single base enum class.
`TextureFormat` and `VertexFormat` then mask
the invalid format for their respective usage.
Having a base enum allows casting between
`TextureFormat` and `VertexFormat` possible
(needed for Buffer Textures).
It also makes it easier to write and read data
to buffers/textures as each format will have an
associated host type.
These enum is generated from MACRO expansion.
This allow to centralize all information about
the formats in one place. This avoid duplicating
the list of enums for each backend.
This only creates the new enum. Porting older enums will
be done in other PRs.
Normalized integer CPU format are missing and waiting for #130640
Rel #130632
Pull Request: https://projects.blender.org/blender/blender/pulls/138069
Many of the upfront specialized variants
were not needed/ They are only used if
some scene render setting changes, which
we can detect upfront.
This is noticeable on OpenGL which doesn't support
specialization constant and has to do full shader
recompilation for each variants.
Pull Request: https://projects.blender.org/blender/blender/pulls/138589
No functional changes intended.
This just replaces all calls to `PBONE_VISIBLE` and `EBONE_VISIBLE`
with appropriate functions.
In the case of editbones it is just the function that the macro already contained.
For pose bones, a new function was added that mirrors what the macro had.
Using a function will make it easier to change how selection is queried in the future.
part of #138482
Pull Request: https://projects.blender.org/blender/blender/pulls/138819