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).
This struct was defined in `BKE_fcurve.h` but only used in editor files.
The only function that used this struct in BKE was marked unused.
This commit removes the unused BKE function and moves the struct
to `ED_keyframes_edit.h`.
Pull Request: https://projects.blender.org/blender/blender/pulls/110527
Add an API for armature layer access. Instead of accessing `arm->layer`
and friends directly, the code now uses this API. This will make things
easier to replace by bone collections in the future.
The functions are named "bonecoll" (short for "bone collection"), as
that's the soon-to-be-introduced replacement for armature layers. This
API is the first step towards that replacement, and should help to
reduce the changes necessary when functional changes are committed.
This also creates a new module `source/blender/animrig` for Animation &
Rigging code. This will, for example, house the bone collection system
in the near future.
There is a bunch of code currently spread across blenkernel and editors
in a rather ad-hoc way; it is intended that at some point that code gets
moved into `animrig` as well (or at least the subset of that code where
such a move makes sense; brain still required).
Ref: #108941
No functional changes.
The file bmesh_opdefines.c was recently converted to bmesh_opdefines.cc,
but the manual builder was not updated accordingly.
Also, update some comments in the code which were still mentioning the C
version of this file.
Pull Request: https://projects.blender.org/blender/blender/pulls/110532
Exit the operator code if `DG_LOCK_WEIGHT` flag is set
for active vertex group to avoid painting over locked vertex
group. New function `BKE_object_defgroup_active_is_locked`
created to handle this.
Previously this function would return `PAINT_MODE_TEXTURE_2D`.
This would result `paint_space_stroke_enabled` to return true, when it
shouldn't for Grease Pencil .
In the Armature drawing code, split up `get_pchan_color()` into three
separate functions. It was basically one big `switch` with three
`case`s, and there were three calls of the function, each with its own
hard-coded parameter value, one for each `case`.
This now also makes it clear that two of those functions always write to
their return parameter, and thus copying a default color 'just in case'
is no longer necessary, reducing the parameter counts even more.
No functional changes.
Add a `UnifiedBonePtr::constflag()` function to grab the `constflag` from
the bone, so that it doesn't have to be passed as a separate parameter
to every drawing-related function.
No functional changes.
- Introduce `UnifiedBonePtr` to avoid having to pass `(EditBone *eBone,
pPoseChannel *pchan)` everywhere.
- Introduce `eArmatureDrawMode` and store that on the
`ArmatureDrawContext`, to avoid having to pass `bArmature *arm` and
then doing `arm->flag & ARM_POSEMODE` everywhere.
- Use the `eBone_Flag` type instead of `int`.
- Deprecate the `ARM_POSEMODE` armature flag. It is no longer necessary,
and also it was changing DNA data from the draw functions. The flag
was basically purely runtime-only, to pass some information to
lower-level drawing code, yet it was stored in DNA. It has been
replaced by the `eArmatureDrawMode` on the context.
Note that some comparisons `eBone != nullptr` (often using the implicit
conversion of pointer to boolean) have been replaced by a comparison to
`ctx->draw_mode`. This is used in cases where the pointer comparison was
actually indicative of the draw mode, and to help get the `else if
(draw_mode == ARM_DRAW_MODE_POSE)` symmetrical.
Disclaimer: this `UnifiedBonePtr` can probably be used in many other
places in Blender as well. We might move it somewhere else in the
future, but to keep things simple I just want to see how it behaves
locally first.
Pull Request: https://projects.blender.org/blender/blender/pulls/110424
The drawing code executed NLA mapping code
even though there were no tracks to be mapped.
Disabling this takes the `draw_fcurve` function
from ~1130μs to ~985μs (heavy example scene with dense data)
~13% faster
Of course this only applies when not using the NLA.
And the performance benefit is larger, the more curves are on screen
Pull Request: https://projects.blender.org/blender/blender/pulls/110306
Binding a key to weight-paint with mode set (invert/smooth for e.g.)
caused regular weight painting to reuse this setting.
Don't reuse paint "mode" between strokes.
This also allows the default to be removed from the key-map.
Status of selected bold, italics, underline, and small caps requires
that the curve have an editfont object. Not checking for this works
interactively but can cause errors in Python. This PR adds explicit
getters and setters that check for editfont.
Pull Request: https://projects.blender.org/blender/blender/pulls/110513