Switch from face pointers to indices, with the following benefits:
- Halve memory usage required for array (saves 16 MB with 1 million quads).
- Allow better code reuse with index-based utilities.
- Ease future replacement of `SubdivCCGFace` with mesh's face offsets.
- Allow future replacement of array with `Mesh::corner_to_face_map()`
- Potentially lower memory bandwidth required during multires evaluation
- Simplify retrieval of index in `BKE_subdiv_ccg_grid_to_face_index`.
For clarity, `gridfaces` was renamed to `grid_to_face_map`.
Pull Request: https://projects.blender.org/blender/blender/pulls/111078
This helps to document standard behavior, improves type
safety, reduces code duplication, and gets us closer to being
able to remove some of the older C math API.
The node add menu contains assets. The position of an asset in the menu
is determined by the catalog it's in. Submenus are generated automatically.
This works by having a context dependent menu (`NODE_MT_node_add_catalog_assets`).
The current catalog path is passed in as context. If the menu has submenus,
the sub-catalog paths are passed as context into those.
This generally works fine when using the menu. However, menu-search (F3)
does not support context dependent menus yet, so those menu entries are
just skipped. With this patch, the previously skipped context dependent menu
entries are also taken into account.
Note, when opening the search directly after opening Blender, the assets might
still be loading and therefor don't show up in the search.
Pull Request: https://projects.blender.org/blender/blender/pulls/111752
Library overrides crashed with on trying to access the interface root panel. The root panel should not be exposed through RNA, but also accessing its `position` property should be allowed.
Several fixes here:
- Fix `position` property getter when the item has no parent panel (i.e. the root panel).
- Avoid infinite loops in the greedy override comparison: exclude the loopback `parent` property.
- Don't return the root panel via the `parent` property in the first place, just return nullptr.
Pull Request: https://projects.blender.org/blender/blender/pulls/111755
Previously, a separate map was build that maps menu types
to their drawing info. This worked fine, but is incompatible
with context dependent menus (#111752).
Now, the menu parent tree is build eagerly which avoids the
need for the additional map. This also makes it easier to integrate
menus that use `menu_create_func`.
Generally the context store is owned by `uiBlock`. Other pointers
to the store (in `bContext` and other operator data) shouldn't change
it, so those variables are now const. One exception is the pointer in
`uiLayout`, but that has a clearly short lifetime, so that's okay.
Remove the need for `CTX_store_copy` and `CTX_store_free` by using
C++ copy constructors, unique pointers, and `std::optional`. A few types
are made non-trivial to support this.
This is a combination of two PRs from Ares Deveaux: #106521 and #106522
This adds a new operator that allows shearing keys
based on the position of the segment ends.
By pressing `D` while the operator is in modal you can
switch if the operator takes the left or the right segment end as a reference.
Co-authored-by: Ares Deveaux <aresdevo@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/111735
Essentially calls `BKE_lib_override_library_resync`, with either to
current ID as resync root for a partial resync, or the actual hierarchy
root for a complete resync of the whole hierarchy.
Goals of the refactor:
* Internal support for baking individual simulation zones (not exposed in the UI yet).
* More well-defined access to simulation data in geometry nodes. Especially, it
should be more obvious where data is modified. A similar approach should also
work for the Bake node.
Previously, there were a bunch of simulation specific properties in `GeoNodesModifierData`
and then the simulation input and output nodes would have to figure out what to do with that
data. Now, there is a new `GeoNodesSimulationParams` which controls the behavior of
simulation zones. Contrary to before, different simulation zones can now be handled
independently, even if that is not really used yet. `GeoNodesSimulationParams` has to be
subclassed by a user of the geometry nodes API. The subclass controls what each simulation
input and output node does. This some of the logic that was part of the node before, into
the modifier.
The way we store simulation data is "transposed". Previously, we stored zone data per
frame, but now we store frame data per zone. This allows different zones to be more
independent. Consequently, the way the simulation cache is accessed changed. I kept
things simpler for now, avoiding many of the methods we had before, and directly
accessing the data more often which is often simple enough. This change also makes
it theoretically possible to store baked data for separate zones independently.
A downside of this is, that existing baked data can't be read anymore. We don't really
have compatibility guarantees for this format yet, so it's ok. Users will have to bake again.
The bake folder for the modifier now contains an extra subfolder for every zone.
Drawing the cached/baked frames in the timeline is less straight forward now. Currently,
it just draws the state of one of the zones, which usually is identical to that of all other
zones. This will change in the future though, and then the timeline drawing also needs
some new UI work.
Pull Request: https://projects.blender.org/blender/blender/pulls/111623
Bone collection added by default along with the armature is not marked
as active. Visually this looks active but actually it's not (hover over the
properties like remove/move)
Also, when a new collection is added, mark that collection active.
Pull Request: https://projects.blender.org/blender/blender/pulls/111733
The factor property of the "Blend to Ease" operator
in the Graph Editor had the same name and description as the "Ease" operator.
This patch fixes it and makes the description more accurate
Pull Request: https://projects.blender.org/blender/blender/pulls/111745
Wrong default value was passed to `BLI_uniquename`.
This default value is used when string is empty after renaming.
the element.
How to reproduce:
- Add bone collection
- double click to rename
- Clear all characters, hit enter (you'll either notice bone collection
without name or just a suffix)
Pull Request: https://projects.blender.org/blender/blender/pulls/111723
This was just giving the shortcut to toggle, but not giving the actual
status ("ON"/"OFF").
This was especially confusing in the following scenario:
- Alt-drag a node (to detach links)
- try to drop on a link (with Alt still held down) was not working
because the modal keymap would have actually toggled auto-attach to OFF
Pull Request: https://projects.blender.org/blender/blender/pulls/111739
Two issues fixed here:
1. Mixup of "in" and "out" flags.
2. Missing node tree update tag to ensure group input nodes all have
the new socket so it can be hidden.
Pull Request: https://projects.blender.org/blender/blender/pulls/111707
Only the ID base tree element type doesn't yet use the polymorphic
tree element design yet, and this case is handled in an earlier branch
excluding this `else` block. So this would be dead code.
Add assert to protect from future changes breaking this assumption.
It's not immediately clear for new users that editing the
"File Browser" colors will also adjust the "Asset Browser".
Similar to how it's already the case for UV/Image Editor,
mention in the name of the panel other editors that share
the same color settings.
* Dope Sheet > Dope Sheet/Timeline
* File Browser > File/Asset Browser
* Graph Editor > Graph Editor/Drivers
The only exception is Node Editor because eventually it
will get too long.
Except of the ID base element type, all element types are ported to have
the new polymorphic tree element object now. So this design is the rule
now with just one exception, so simplify the sanity check logic to
reflect this.
Add three cached topology maps to `Mesh`, to avoid computations when
mesh data isn't changed. Choosing the right maps to cache is a bit
arbitrary, but generally we have to start somewhere. The limiting
factor is memory usage (all the new caches combined have a
comparable footprint to a UV map).
For now, the caches added are:
- Vertex to face corner
- Vertex to face
- Face corner to face
These caches are used in quite a few places already;
- Face corner normal calculation
- UV value merging
- Setting sharp edges from face angles
- Data transfer modifier
- Voxel remesh attribute remapping
- Sculpt mode painting
- Sculpt mode normal calculation
- Vertex paint mode
- Split edges geometry node
- Mesh topology geometry nodes
Caching topology maps means they don't have to be rebuilt every time
they're used. Meshes copied but without topology changes can share
the cache, further reducing re-computations. For example, FPS with a
large mesh using the "Corners of Vertex" node went from 1.8 to 2.3.
Entering sculpt mode is slightly faster too.
There is some obvious work for future commits:
- Use caches in attribute domain interpolation
- More multithreading of second phase of map building
- Update/build caches eagerly in some geometry nodes
Pull Request: https://projects.blender.org/blender/blender/pulls/107816
The sound equalizer is using the Audaspace FFT Convolver.
The blender part creates an array of descriptions of power per "band"
and orders the creation of Equalizer (ISound) in the Audaspace.
Modifier can be created on sound strips. It lets you define
amplification or attenuation over frequency range from 30Hz to 20 kHz.
The power is limited to -30 db - 30 db. This is done using curve
mapping widget.
Co-authored-by: menda <alguien@aqui.es>
Co-authored-by: Richard Antalik <richardantalik@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/105613
The loop was ignoring ` nu->pntsv` in this case, resulting in only the
first point of each row being used for snapping.
This commit also simplifies the code by removing the no-snap limitation
when the curve only has 1 point.
This limitation existed because the curve is not visible in this case.
But this is contradictory for when the curve has loose points (which
are also not visible).
Previously we'd just allocate extra space for additional data for the
deferred loading, and then do pointer arithmetic to access that data.
This is cryptic and not type safe.
Instead, use an internal type deriving from `PreviewImage`, and manage
that internally. This ensures type safety, while keeping this as
implementation detail (not visible outside of the preview image API) and
keeping internals easy to understand.
Some code did shallow copies of preview images, making ownership
unclear. That made things a bit tricky, but I've made support for
shallow copies explicit now and noted this in comments.
Regression from c3dfe1e204.
Above commit put a dummy dragable button over the filename (well, to
allow dragging). Enabling drag ripples down to the button ending up in
the `BUTTON_STATE_HIGHLIGHT` state [which is still good of course].
However, `ui_do_but_EXIT` will then return `WM_UI_HANDLER_BREAK` which
then results in the filebrowser operator being skipped.
`ui_do_but_EXIT` already had a special case for file-browser drag button
[which would return `WM_UI_HANDLER_CONTINUE` instead]. Formerly this was
just the icon, now it is the icon and filename label. So in order to fix
this, remove the explicit check for the `but->imb` which will then
include the dragable label button in the exception for returning
`WM_UI_HANDLER_CONTINUE`.
Fixes#111645.
Pull Request: https://projects.blender.org/blender/blender/pulls/111693
The asset shelf type would be removed, but there may still be an active
asset shelf (or previously active shelves) in memory that reference this
type. Now unset this reference so the shelf is not considered for
display anymore. This way the shelves storage is preserved (and saved to
files) and settings like the visible catalogs will be kept for when the
type becomes available again.