Reorganizes (and in some cases add missing operators to) all 'Select'
menus in all editors except 3D Viewport (done in a separate patch).
The goal of this change is to make menus as consistent as possible, and
to group & sort items according to a certain logic, which should be easy to
remember and users can always expect certain items to be always at same
place in every editor.
More details and images in the pull request.
Pull Request: https://projects.blender.org/blender/blender/pulls/121337
When moving keys in the Graph Editor animators
usually only want to move them on one axis.
While this is possible in a few ways (G+X, or G + Middle Mouse Button click),
we could default the behavior to always lock on an axis.
This was suggested by Dreamworks animators during the
Animation & Rigging module meeting.
https://devtalk.blender.org/t/2024-01-26-animation-rigging-module-meeting/33081#patch-review-decision-time-5
This PR adds an option with which the movement is
always locked to a single axis by default.
The option can be found in the Graph Editor under "View->Auto-Lock Axis".
The movement will then be restricted to the axis along
which you've moved the cursor the most.
You can still manually override the lock behavior by pressing `X` or `Y`.
I am piggybacking off the auto locking feature you get when pressing the middle mouse button.
When the new feature is enabled I call that at the start of the transformation.
Except when:
* only handles are selected
* the tweak mode has been started on a handle
This is to not snap handles, which is a behavior that has
been requested by the artists.
Pull Request: https://projects.blender.org/blender/blender/pulls/117669
View menu in animation and video editors are too
different from each other and unorganized.
Same operators appear in different places in different editors.
That makes navigating them harder, because for example
you expect framing operators at the bottom because they're
at the bottom in graph editor, but they're at the top in Sequencer
and 3D Viewport. It's important that ordering of operators
match as well as possible, so that users can expect certain
operators in certain places and dont spend time searching
for buttons in messy menus.
I tried to match ordering to 3D viewport menu
as much as possible, and also to use separators right,
so that grouping of items is logical and can be shareable between editors.
This grouping also looks better and makes navigation easier,
because it splits huge pile of toggles at the top of the menus
in smaller chunks and puts operators between them,
so they're esier to separate them in one glance.
Split off from #116492
Pull Request: https://projects.blender.org/blender/blender/pulls/117162
As discussed in #105407, it can be useful to support returning
a fallback value specified by the user instead of failing the driver
if a driver variable cannot resolve its RNA path. This especially
applies to context variables referencing custom properties, since
when the object with the driver is linked into another scene, the
custom property can easily not exist there.
This patch adds an optional fallback value setting to properties
based on RNA path (including ordinary Single Property variables
due to shared code and similarity). When enabled, RNA path lookup
failures (including invalid array index) cause the fallback value
to be used instead of marking the driver invalid.
A flag is added to track when this happens for UI use. It is
also exposed to python for lint type scripts.
When the fallback value is used, the input field containing
the property RNA path that failed to resolve is highlighted in red
(identically to the case without a fallback), and the driver
can be included in the With Errors filter of the Drivers editor.
However, the channel name is not underlined in red, because
the driver as a whole evaluates successfully.
Pull Request: https://projects.blender.org/blender/blender/pulls/110135
Combination of two operators by Ares Deveaux
#106524 and #106523
Introduces a new operator "Scale from Neighbor"
that scales selected keyframe segments from either
the left or right keyframe neighbor.
Pressing "D" during modal operation will switch
from which end of the segment the scaling happens.
This is useful to make a section of animation closer to a pose on either side.
Co-authored-by: Ares Deveaux <aresdevo@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/112387
This is a replacement for the workflow that uses
"Bake Curve" and "Unbake Curve" to quickly generate
dense key data.
Compared to the existing workflow it has the advantage
of allowing the user more control over the key types,
and distance between keys, as well as the frame range affected.
Operator options
* Range: the range that will be baked.
Defaults to the scene range or preview range.
* Step: Distance between keyframes.
Can be used to bake on 2s or even bake to subframes.
* Remove Existing Keys: Boolean option that
if enabled also removes keys outside the specified baking range
* Interpolation Type: Choose a interpolation mode used
for new keys e.g. Constant or Bezier
* Bake Modifiers: If enabled bakes the effect of the
modifier stack to keys and deletes the modifier stack.
If false, the code disables the modifiers before baking,
so the resulting keys will behave as if the modifiers didn't exist
The operator can be found in the Graph Editor under `Channel->Bake Channels`
Part of: #111050
Pull Request: https://projects.blender.org/blender/blender/pulls/111263
Noticed GRAPH_MT_channel_context_menu is unused (since
DOPESHEET_MT_channel_context_menu is used in both Dopesheet & Graph/
Drivers Editor).
This patch removes GRAPH_MT_channel_context_menu but adds the entries
which were in that menu (but not in DOPESHEET_MT_channel_context_menu)
back to the later.
Namely:
- Hide Selected Curves
- Hide Unselected Curves
- Reveal Curves
- (Delete Invalid Drivers -- if in Drivers Editor)
Pull Request: https://projects.blender.org/blender/blender/pulls/111384
This patch has been originally authored by Ares Deveaux #106520
I am just finishing it up.
This is a new operator for the Graph Editor.
It shifts the value of the keys in time,
while keeping the actual key positions in the same place.
It supports wrapping, so when offsetting beyond the range
of the F-Curve it will take values from the other end,
but offset in y-value so there is no jump.
This works best with dense key data.
Co-authored-by: Ares Deveaux <aresdevo@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/110540
This adds an operator `graph.select_key_handles` to the graph editor
that changes the selection of the different parts of a bezier keyframe. It
operates on all keys that are either themselves selected or have either of
their handles selected, and changes whether the key itself and/or its handles
are selected.
The operator has three options:
- `left_handle_action`
- `right_handle_action`
- `key_action`
Each of which can be set to:
- Select
- Deselect
- Keep (do nothing)
Co-authored-by: cgtinker <Denys.Hsu@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/111143
During the recent operator renames, the menu
entry for "Sound to Samples" was missed and
left as "graph.sound_bake"
This fixes it to be the correct "graph.sound_to_samples"
After Renaming "Bake Curve" to "Samples to Keys" in #111049,
the name of the `GRAPH_OT_sample` operator needed renaming.
That is because the word "sample" is now used to describe FCurve
data in an uneditable state.
Rename to `GRAPH_OT_bake_keys` since baking is the term
used in animation to describe the action of creating dense key data.
Pull Request: https://projects.blender.org/blender/blender/pulls/112148
Breaking change since the operator name changes.
Users have been confused about this for a long time.
The term "bake" in the context of animation usually means
to add keys at a given interval without changing the shape of the curve.
The fact that the curve isn't editable after baking was the main issue.
In order to stop the confusion the operator is renamed to "Keys to Samples"
to indicate that there is a conversion happening and that there are no keys afterwards.
The Un-Bake operator has also been changed to "Samples to Keys"
The operator description has been updated to mention that after the conversion
the data is no longer editable.
The "Bake Sound to F-Curves" has been renamed to "Create Samples from Sound"
Pull Request: https://projects.blender.org/blender/blender/pulls/111049
This patch has been originally authored by Ares Deveaux #106526
Scale the selected key segments to their average
Unlike just scaling using the transform tools, this scales to the average of each individual F-Curve segment.
Co-authored-by: Ares Deveaux <aresdevo@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/111744
Part of #91973
Moving the snapping code for the
* Graph Editor
* Action Editor
* and NLA editor
into the common system that lives on the scene.
This includes the Magnet icon for turning
snapping on and off.
The old settings translate to the new in the following way:
* `Frame Step` -> `Frame`
* `Second Step` -> `Second`
* `Nearest Frame` -> `Frame` + `Absolute Time Snap`
* `Nearest Second` -> `Second` + `Absolute Time Snap`
* `Nearest Marker` -> `Nearest Marker`
Since this moves the location of the snapping settings
from the editor to the scene, it changes the behavior.
Previously each editor could have different snapping
settings, where now they are all synced.
Pull Request: https://projects.blender.org/blender/blender/pulls/109015
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
Listing the "Blender Foundation" as copyright holder implied the Blender
Foundation holds copyright to files which may include work from many
developers.
While keeping copyright on headers makes sense for isolated libraries,
Blender's own code may be refactored or moved between files in a way
that makes the per file copyright holders less meaningful.
Copyright references to the "Blender Foundation" have been replaced with
"Blender Authors", with the exception of `./extern/` since these this
contains libraries which are more isolated, any changed to license
headers there can be handled on a case-by-case basis.
Some directories in `./intern/` have also been excluded:
- `./intern/cycles/` it's own `AUTHORS` file is planned.
- `./intern/opensubdiv/`.
An "AUTHORS" file has been added, using the chromium projects authors
file as a template.
Design task: #110784
Ref !110783.
This PR blends the selected keyframes to an ease-in or ease-out curve.
The difference to the existing ease slider is that this one blends,
while the other snaps to the ease curve
Co-authored-by: Ares Deveaux <aresdevo@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/110566
Implements the Butterworth Filter
(https://en.wikipedia.org/wiki/Butterworth_filter) for smoothing FCurves.
This filter is ideal for smoothing dense data, like motion capture recordings.
It has the advantage of keeping the shape of the curve
intact while reducing minimal fluctuations.
The disadvantage is the impulse response has a twang,
meaning extreme spikes cause fluctuations to either side.
The implementation is based on the GPL code found here:
https://exstrom.com/journal/sigproc/dsigproc.html
In order to avoid phase shifting, the filter is run forward and backward,
effectively doubling the filter order.
The Redo panel offers the following options
* Frequency Cutoff: 0-n value, where 0 means it cuts everything
so the curve will become straight, the max value is the Nyquist frequency
and depends on the frame rate and the "Samples per Frame" option
* Filter Order: Higher values mean the frequency cutoff is steeper
* Samples per Frame: Before the filter is applied, the curve is resampled
at this interval to avoid errors when there are uneven spaces between frames.
If the keys are on subframes, e.g. a 60fps file in a 30fps scene, increase this value to 2
* Blend: 0-1 value to blend between the original curve and the filter result
* Blend In/Out: The number of frames at the start and end for which
to blend between the filtered and unfiltered curve.
This can help reduce any resulting jumps in the animation at the selection border
The operator can be called from the Key menu. (Key->Smooth->Butterworth Smooth)
Pull Request: https://projects.blender.org/blender/blender/pulls/106952
Since the change in #106113 the Slider menu which was called with the D hotkey was no longer in any menu.
This made it really hard to discover.
Since there is now more than 1 menu popup, it needs more than 1 hotkey.
The idea is that the ALT key is used in combination with keys that are easy to reach with the left hand.
Right now it is ALT+S and ALT+D but if needed in the future it can be extended to f, w and e
Pull Request: https://projects.blender.org/blender/blender/pulls/107866
Rather than forcing the user to initiate a transform operation to edit the `Proportional Size`, allow editing of the `Proportional Size` through the UI.
The affected headers are:
- View 3D
- Dop Sheet
- Image Editor
- Graph Editor
- Mask Editor
Pull Request: https://projects.blender.org/blender/blender/pulls/107507
* remove "Keyframe" label from the Key menu
* "Jump To Keyframe" -> "Jump to Selected"
* added a new menu "Density" with Decimate, Sample and Clean operators
* removed the "Clean Channels" entry. It does the same as the "Clean" operator but also removes channels IF the remaining keys are at the default value. The feature is still available in the redo panel
* Split the slider operators out by functionality
* Move Euler filter to Channel menu
* Remove "Add F-Curve modifier" from Key menu (it already is in the Channel menu)
* Move Bake/Unbake Curve functions to Channel menu
* Move "Bake Sound to FCurves" to Channel menu
Pull Request: https://projects.blender.org/blender/blender/pulls/106113
Introduce a context manager that temporarily overrides a UILayout's
operator context.
Instead of writing this:
```py
default_op_context = layout.context
layout.context = 'OTHER_VALUE'
layout.do_stuff()
layout.context = default_op_context
```
you can now write this:
```py
from bl_ui_utils.layout import operator_context
with operator_context(layout, 'OTHER_VALUE'):
layout.do_stuff()
```
This is also exception-safe; it will always ensure the layout's operator
context is restored when the `with` body is exited, regardless of
whether that's done with an exception or regularly.
Idea in-the-hallway approved by @Sergey.
Add a Gaussian smoothing operator to supersede the current
smoothing operator in the graph editor.
Advantage over the current implementation:
* Supports modal operations
* Is independent of key density
* More options in the redo panel
* More predictable Impulse Response
Option in the redo panel to change
Filter Width: How far out on each side of a key the code checks
to average key values
Sigma: The shape of the bell curve, lower values make a sharper bell curve
reducing the smoothing effect.
Too High values will make the code behave like an average filter as the
curve in the -1/1 range will almost be flat.
On a technical note, the operator needs to store additional data when running in modal
to avoid allocating/deallocating data on every modal run.
For that reason the `tGraphSliderOp` struct has been extended with
`void *operator_data` and `void (*free_operator_data)(void *operator_data)`.
The former is the data and the latter is a function responsible for freeing that data.
Pull Request: https://projects.blender.org/blender/blender/pulls/105635
In most places where it appears in a menu, the operator would already
apply to all selected F-Curves. Now it is done consistently and explicitly
from all menu items. The default of the operator is now also set to 'all
selected', so that it also behaves like that when called from the operator
search menu.
Move two settings that were previously in the "View" menu of the Graph Editor into User Preferences.
It has been mentioned in the meeting by Luciano Muñoz Sessarego that it would be good to move that to the preferences so you can set it once and then forget about it.
The Settings moved are:
Only Selected Curve Keyframes
Use High Quality Display
Pull Request: https://projects.blender.org/blender/blender/pulls/104532
Before that patch, the slider operators for the Graph Editor are not easily accessible since they don't have a hotkey.
This adds the "d" hotkey for the already existing slider operator menu.
Using the popup menu means that your last used operator will always be under the cursor, so it's quick to access.
Pull Request #104530
This commit implements described in the #104573.
The goal is to fix the confusion of the submodule hashes change, which are not
ideal for any of the supported git-module configuration (they are either always
visible causing confusion, or silently staged and committed, also causing
confusion).
This commit replaces submodules with a checkout of addons and addons_contrib,
covered by the .gitignore, and locale and developer tools are moved to the
main repository.
This also changes the paths:
- /release/scripts are moved to the /scripts
- /source/tools are moved to the /tools
- /release/datafiles/locale is moved to /locale
This is done to avoid conflicts when using bisect, and also allow buildbot to
automatically "recover" wgen building older or newer branches/patches.
Running `make update` will initialize the local checkout to the changed
repository configuration.
Another aspect of the change is that the make update will support Github style
of remote organization (origin remote pointing to thy fork, upstream remote
pointing to the upstream blender/blender.git).
Pull Request #104755