Currently, `columnselect_action_keys` gets "raw" non-NLA-mapped keyframe
data via `ANIM_fcurve_keyframes_loop` with the `bezt_to_cfraelem` callback,
so the list of `CfraElem` contains frames in "local" FCurve space.
Later, this would be (rightfully) NLA-unmapped to "local/strip" time, because
this is what `ANIM_editkeyframes_ok(BEZT_OK_FRAME)` expects, it also only
compares "raw" `BezTriple` data.
But this only makes sense if we would store "global/scene" frame data in
`CfraElem` `cfra` already.
This is what we now do, let `bezt_to_cfraelem` perform the NLATIME_CONVERT_MAP
Pull Request: https://projects.blender.org/blender/blender/pulls/138937
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
This converts the public `uiItemO` function to an object oriented
API (`uiLayout::op`).
Also this rearranges `idname` paramether, since this the only one
required, and to make format similar to `uiItemFullO`
Note: One of the benefits of moving from a public function to class
method is to reduce API usage difference between C++ and Python. In
Python this method is called `UILayout::operator`, however `operator`
is a reserved keyword in C++.
Part of: #117604
Pull Request: https://projects.blender.org/blender/blender/pulls/138776
This converts the public `uiItemR` function to an object oriented
API (`uiLayout::prop`), 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/138617
Expand the already-existing safety margin to correct for the implosion
scenario, by a factor of 100x. That way it doesn't zoom in too much,
and makes it easy for an animator to zoom out again if necessary.
Pull Request: https://projects.blender.org/blender/blender/pulls/138235
This converts the public `uiItemL` function to an object oriented
API (`uiLayout::label`), 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/138608
Symptoms were drivers still being active while others seemingly
disabled. Indices in the RNA path up to the `ANIM_remove_driver` call
are correct, so it is not entirely clear to me why this goes wrong, but
forcing an update by tagging animation resolves the issue.
NOTE from @dr.sybren : Without this fix, the old copy-for-evaluation
is still there, which still has the driver (because it's a copy)
NOTE: seems we are not handling ND_FCURVES_ORDER anywhere?
Pull Request: https://projects.blender.org/blender/blender/pulls/138490
This converts the public `uiLayoutSplit` function to an object oriented
API (`uiLayout::split`), 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.
`uiLayout::split` now returns an `uiLayout` reference instead of a pointer.
New calls to this method should use references too.
Pull Request: https://projects.blender.org/blender/blender/pulls/138361
This converts the public `uiLayoutBox` function to an object oriented
API (`uiLayout::box`), 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.
`uiLayout::box` now returns an `uiLayout` reference instead of a pointer.
New calls to this method should use references too.
Pull Request: https://projects.blender.org/blender/blender/pulls/138334
This converts the public `uiLayoutColumn` function to an object oriented
API (`uiLayout::column`), 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.
`uiLayout::column` now returns an `uiLayout` reference instead of a pointer.
New calls to this method should use references too.
Pull Request: https://projects.blender.org/blender/blender/pulls/138034
This converts the public `uiLayoutRow` function to an object oriented
API (`uiLayout::row`), 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.
`uiLayout::row` now returns an `uiLayout` reference instead of a pointer.
New calls to this method should use references too.
Part of: #117604
Pull Request: https://projects.blender.org/blender/blender/pulls/137979
This merges the `GRAPH_OT_keyframe_jump` operator into the more generic
`SCREEN_OT_keyframe_jump` operator. (the former introduced with #108549)
The functionality of both operators is retained by running
a `switch/case` based on the editor type.
Doing so, we can filter out the Dope Sheet as well which fixes#93944
The `GRAPH_OT_keyframe_jump` is preserved, but when it is called,
it generates a warning stating it should not be used anymore.
It then calls directly into the `SCREEN_OT_keyframe_jump` to
ensure functionality doesn't drift apart.
Fixes#136176Fixes#93944
Pull Request: https://projects.blender.org/blender/blender/pulls/137542
No functional changes intended.
This patch extracts functionality to get all `bAnimListElem`
that are editable in the Graph Editor
into a separate function so it can be re-used by other operators.
This makes it easy to ensure the same data is retrieved and
filter flags can't go out of sync.
Extracted from #135913
Part of: #135794
Pull Request: https://projects.blender.org/blender/blender/pulls/137142
Remove the checks for region size in operator_markers_region_active as
that interferes too much. The only thing really interfering with
playhead movement when the area gets too narrow is MARKER_OT_select. So
this PR adds a new poll function for that in particular. That allows a
lot of simplification.
Pull Request: https://projects.blender.org/blender/blender/pulls/137399
When Timeline (and similar editors) is reduced to a just the height of
two headers you can still change the play head. Except if you have any
markers and then marker selection operator interferes. This PR sets a
minimum area height for marker operations. This minimum differs if you
hide the header.
Pull Request: https://projects.blender.org/blender/blender/pulls/137312
When multiple F-Curves have the `FCURVE_ACTIVE` flag set, only one of them
was drawn in the graph editor.
Only one F-Curve should be marked with this flag, but that's not something
the datamodel enforces. Because of that, it apparently is possible to get
into a situation where multiple F-Curves are marked as such. They are now
all drawn properly.
Pull Request: https://projects.blender.org/blender/blender/pulls/137102
Use enum types for event modifier and types,
`wmEventModifierFlag` & `wmEventType` respectively.
This helps with readability and avoids unintended mixing with other
types. To quiet GCC's `-Wswitch` warnings many `default` cases needed
to be added to switch statements on event types.
Ref !136759
Fix an issue where copy-paste of keyframes was broken when action groups
are collapsed. It was caused by the `ANIMFILTER_LIST_VISIBLE` filter
flag; removing it (as it was before the bug-introducing commit) resolved
the problem.
Pull Request: https://projects.blender.org/blender/blender/pulls/136768
Part of incoming refactors in interface layout c++ code, this enables
forward declaring this enum type. Enum is renamed as `EmbossType` and
moved to `blender::ui` namespace. No user visible changes expected.
Pull Request: https://projects.blender.org/blender/blender/pulls/136725
In the animation & armature editors, replace calls to
`WM_global_report()` with `BKE_report`, to ensure that the reports go to
the appropriate report list (and giving callers control over this).
There's one `WM_global_report()` call left, in
`ED_armature_bone_rename()`. That doesn't have a `ReportList` available,
so I left it as-is for now.
Pull Request: https://projects.blender.org/blender/blender/pulls/136261
Callbacks: exec invoke & modal now use a typed enum wmOperatorStatus.
This helps avoid mistakes returning incompatible booleans or other
values which don't make sense for operators to return.
It also makes it more obvious functions in the WM API are intended
to be used to calculate return values for operator callbacks.
Operator enums have been moved into DNA_windowmanager_enums.h
so this can be used in other headers without loading other includes
indirectly.
No functional changes expected.
Ref !136227
WM_report was originally added for special cases however new code
has been using this in operators for example, where reports should be
sent to the operator via BKE_report, so the caller can handle,
and so Python can catch the errors.
Rename the functions to make them less easily confused with BKE_report
and add a code-comment on why their use should be avoided.
Move the code dealing with converting float3 to GPU normals
out of the vertex format header into a separate header. Use a
proper C++ namespace and remove duplication by only using
the more recently added C++ templated conversions.
Most of the diff comes from the removal of the indirect includes
from GPU_vertex_format.hh. A lot of files ended up mistakenly
depending on that.
Pull Request: https://projects.blender.org/blender/blender/pulls/134873
This reverts commit afec64739a.
The commit introduces a regression where opening the Asset Browser opens
the File Browser instead, same for other editor sub-types, see
blender/blender#134630.
blender/blender!134642 proposes a different solution and reverts this,
which I prefer too. Better to the revert separately from trying a
different fix for the initial bug, makes reviewing easier too.
And replace nullptr arguments for tooltips in UI button
creation functions with std::nullopt. Though the distinction
between "no tooltip" and "empty tooltip" doesn't seem to exist,
it seems safer to keep the distinction since it existed with null before.
This implements the memorization of the previous state of a space's
subtype for those that have multiple modes. Introduces an optional
space_subtype_prev_get callback, implemented for SPACE_ACTION,
SPACE_FILE, SPACE_GRAPH, SPACE_IMAGE and SPACE_NODE. This means we
can always return to the previous mode.
Pull Request: https://projects.blender.org/blender/blender/pulls/133846
Copy-paste of keyframes is now slot-aware. See [1] for the design.
[1]: https://developer.blender.org/docs/features/animation/tools/action-editor-copy-paste/
In short:
- Copy-paste still works broadly as it used to. Only the visible
F-Curves are pasted into.
- Slot identifiers matter when copying from multiple slots. When
copying from one slot, they don't.
- Selection of channels (either F-Curves or Slots) determines where
keys get pasted into.
- Pasting will either copy from the slot with the same identifier
(when identifiers matter), or paste whatever was copied (when they
do not).
- If both F-Curves and slots are selected, only the selected F-Curves
get pasted into, and slots without any selected F-Curves are ignored
(i.e. target is only defined by selected F-Curves, or only by
selected slots, never by a mixture).
Fixes#129690
Pull Request: https://projects.blender.org/blender/blender/pulls/133979
The box/lasso select code called `evaluate_fcurve()` to evaluate the
driver F-Curve, which is not meant for drivers. It now calls
`evaluate_fcurve_only_curve()`, which is meant for this purpose (only
evaluates the F-Curve part of the F-Curve, and ignore the driver).
Pull Request: https://projects.blender.org/blender/blender/pulls/134042
When displaying keymaps on the Status Bar we prefer to show Confirm and
then Cancel. We have a few places where these are reversed
accidentally. This just makes these consistent with the rest.
Pull Request: https://projects.blender.org/blender/blender/pulls/133947
Refactor the keyframe copy-paste code to prepare for supporting action slots.
This is a non-functional change, as the slots are stored but otherwise completely ignored. This way the refactor to the new data structure can be reviewed & tested before actually changing the behaviour.
Related: #129690
Pull Request: https://projects.blender.org/blender/blender/pulls/133497
The issue was that the range for the time offset operator
was so large, that the 0.1 increment seemingly had no effect.
The solution is to add functionality to the slider to specify the increment step.
Since the time offset operator deals in frames it made sense to snap to whole numbers.
Also fixes#132187
For that the increment step has been chosen to allow for 10 steps in the slider range.
Pull Request: https://projects.blender.org/blender/blender/pulls/132554
This caused build errors on the docs builder, I can't seem to reproduce
locally, so revert for now and have another look at some point in the
future.
Sadly as these changes usually go, this took 5c515e26bb and
2f0fc7fc9f with it as well.
Pull Request: https://projects.blender.org/blender/blender/pulls/132559