Use a context structure for both parameters and results of the rna
diffing functions, instead of 10+ individual parameters.
Also switch to C++ features like `std::string` and `std::optional`
instead of handling manually buffers and allocated C-style strings.
This commit also makes some minor cleanups, add some documentation, and
removes a few small parts of code that have been detected as
redundant/useless.
No behavioral nor performance changes are expected with this commit.
Implementation of column-based operators : "Columns on selected keys", "Column on current frame", and "Columns on selected markers" for grease pencil frames in the dopesheet.
Pull Request: https://projects.blender.org/blender/blender/pulls/110523
No user visible change expected.
Right-clicking a view item is supposed to activate it and display the
context menu. However, nested buttons could "swallow" the right click
event. Ensure the view item is still activated.
No functional changes
Extracting code into two new functions in the dopesheet draw code
to improve readability and reduce variable scopes.
in addition to the extraction two if checks were negated to reduce indentation.
the diff makes it look a bit convoluted, but it's just copy paste into functions
Pull Request: https://projects.blender.org/blender/blender/pulls/110290
Some regions have a fixed size or the size is determined by the layout
somehow, and so the regions should allow hiding/unhiding via the resize
operator, but the size shouldn't be modified. When the region was just
unhidden, it would still use a size based on the mouse position for one
mouse move event. Ensure the size isn't modified, as requested.
No user visible changes expected.
This is needed for the asset shelf (#104831), so that the user can
resize the asset shelf region, but it's ensured to always be snapped to
a multiple of the row height (which can change over redraws).
Before this, `RGN_FLAG_DYNAMIC_SIZE` would have to be set so that
regions can control their own size in the `ARegionType::layout()`
callback. But this would also disable resizing the region by the user.
Tagging regions as being dynamically sized and disabling user resizing
are now two separate options/flags.
Included changes:
- Rename `RGN_FLAG_PREFSIZE_OR_HIDDEN` to `RGN_FLAG_NO_USER_RESIZE` and
make that generally disable user resizing like `RGN_FLAG_DYNAMIC_SIZE`
used to, so that it can be used for more than just the properties
editor tabs region.
- Ensure regions that relied on the previous `RGN_FLAG_DYNAMIC_SIZE`
behavior that disallowed user resizing have the
`RGN_FLAG_NO_USER_RESIZE` flag set too now.
- Versioning to ensure the previous point for old files.
- Update comments.
This commit adds modifier support for Grease Pencil 3.
The `BKE_grease_pencil_data_update` function evaluates the modifiers by
first creating a `GeometrySet` from the grease pencil data,
then evaluating the modifiers, and finally reading the
resulting `GreasePencilComponent` component and assigning
the evaluated object data.
Pull Request: https://projects.blender.org/blender/blender/pulls/110500
Dynamic topology drawing can now use the smooth status saved in each
edge. Because of that, the "Smooth Shading" draw option is unnecessary
and just adds confusion because of inconsistency between dynamic
topology drawing and other modes.
Fixes#109191
Pull Request: https://projects.blender.org/blender/blender/pulls/110548
In Walk Navigation mode with gravity enabled, the jump height is
often inappropriate for the scene that you are viewing. This is a small
feature that lets you change the jump height in modal walk navigation
as you go, i.e. if there are varying elevation changes across the scene.
Pressing '.' increases and ',' decreases the jump height (because these keys
are the same for most layouts).
Pull Request: https://projects.blender.org/blender/blender/pulls/109827
The issue was caused by recent C++ transition: the header file is
shared between CPU and GPU. The Metal defines __cplusplus so it is
not enough to check for it to use C linking as it is not a valid
syntax for shaders.
Pull Request: https://projects.blender.org/blender/blender/pulls/110570
Context is needed to import and instantiate assets correctly. Previously
the context was stored as "evil" pointer in the drag data. Since
77794b1a7b, context is passed to the dragging callbacks doing the asset
import, so the context doesn't need to be stored that way anymore and
can simply be passed to the import function.
This change is needed for PAINT_OT_weight_sample_group to be accessed
from a menu.
Otherwise using the OPTYPE_DEPENDS_ON_CURSOR flag causes both the
initial activation and the selected vertex group to prompt the user
to select a region.
Similar to 79115c5c56, but for multires sculpting. Improves
the PBVH build time for a 16 million vert multires sculpt by about 100ms
(from 470ms to 370ms). That itself is just a small portion of the time
spent entering sculpt mode though.
At least on GCC on Linux, it appears std::function has noticeable
overhead compared to blender::FunctionRef. That makes some
sense, as the latter generally handles less, and the performance
difference is mentioned in the function ref header as well.
To test performance, I measured the timing of the first data
upload (`BKE_pbvh_draw_cb`) after entering sculpt mode. For
meshes, I observed a 30% improvement, from 1.7s to 1.3s.
For multires, I observed a change from 290ms to 263ms.
The change should apply to regular draw updates while sculpting,
but that's harder to measure.
This is also cleaner semantically, since the callbacks aren't meant
to own any data, they are just lambdas that capture by reference.
Reduces the average runtime of building mesh PBVH nodes from 4.2 to
3.3 seconds in a basic test with a 16 million face grid on my hardware.
This is probably mainly because of improved inlining with C++
templates. It also makes the code easier to understand.
When entering sculpt mode (or another mode that uses PBVH), the
bounds of each triangle are calculated serially. Doing this in parallel
is simple, and about 10x faster (568 to 56 ms) on a Ryzen 7950x.
One thing to point out is that `PBVH::nodes` is now stored in a `Vector`
which replaces the manual amortized growth. That requires explicitly
setting the defaults of PBVHNode fields for default initialization.
Similar to f0b53777c8
revert Outliner: Port grease pencil effect elements to new tree-element code design
This is causing compile errors which I can’t fix right now. Reverting until resolved.
## Overview
Much like node groups, or a VSE clip, when we duplicate we actually want a _linked_ duplicate. This PR updates the NLA key board for Duplicate linked to `Shift + D`, and Duplicate to `Alt + D`.
Additionally, update Tool tips to reflect duplicate vs linked duplicate.
Pull Request: https://projects.blender.org/blender/blender/pulls/110316
In case a blend file opening fails (in the context of library content
listing, e.g. for linking or appending), the File Browser would just
show an emtpy window.
With the new comnpatibility policy, this will now become a fairly common
situation, which requires giving proper explanations to the user.
This commit re-uses and extends the system used to display errors
messages from the Asset browser.
Part of #109151 (PR !110109).
This implements the main aspects of changes to blendfile compatibility
as designed in #109151:
* Blender files which file minversion is newer than current Blender
executable won't be loaded at all.
* Blender files which file version is newer than current Blender will
triger systematic warning to user:
* In the status info bar (lower right corner in default UI).
* When attempting to save (overwrite) them.
This means that the file minversion becomes a hard limit, and not a
soft, warning-only as it used to be. Further more, forward compatibility
warning is now systematic (instead of depending on file minversion),
and more visible for users.
See also https://wiki.blender.org/wiki/Process/Compatibility_Handling
for details over the new policy.
Technically:
* Opening any file with a minversion newer than current Blender file one
now triggers an early abort, with an error message reported to the user.
This is handled by a new utils called from `blo_decode_and_check`.
* Any file newer than current Blender version sets a new
`has_forward_compatibility_issues` flag in Main struct at read time.
* Status bar info area is turned into a template, which uses this flag
to display special warning UI and tooltip when set.
* A new confirmation popup appears when user tries to save (overwrite)
such a 'newer' blendfile, stating potential loos of data, and
proposing by default to 'save as' instead.
* The 'quit unsaved' popup has also been updated to 'save as' instead of
'save' when the edited file is has potential forward compitibility
issues.
Part of #109151 (PR !110109).
Since in rare cases there may be needs to expose file subversion here,
the following format was defined:
<major>.<minor> (sub <subversion>)
Part of #109151 (PR !110109).