This adds an overlay to the animation editors to visualize the current scene strip
in and out points in the scene timeline when the `Sync Scene Time` option in
the sequencer is used.
* Adds an overlay toggle + panel to the dopesheet.
* Adds a new theme setting (for the overlay) under
`Common` > `Animation` > `Scene Strip Range`.
* Adds the overlay drawing to the dopesheet.
Pull Request: https://projects.blender.org/blender/blender/pulls/146165
This adds versioning code that replaces any timeline with a
dopesheet where the footer is shown, AND it removes the
timeline from the menu options.
If the area is too small to show both, the footer and the
header then only the footer is shown.
This assumes that users created the small timeline
just for the playback controls
Any uses of `SACTCONT_TIMELINE` (except for versioning) have been removed.
part of #145577
Pull Request: https://projects.blender.org/blender/blender/pulls/147058
Rename the menu item "Footer" in Animation/VSE to "Playback Controls".
This only affects the menu item label under `View`, in the following editors:
* Dope Sheet
* Graph Editor
* NLA Editor
* Sequencer
The name "footer" has issues:
* It's not descriptive of what it does/contains.
* It can be moved to the top, so no longer a footer.
* When used in other editors, it may contain different things so it
is unexpected what to find in it.
See PR for screenshots.
Pull Request: https://projects.blender.org/blender/blender/pulls/146727
Other code that needs to operate on "the Action that's shown in the
Dope Sheet" now accesses the newly-added
`bAnimContext::active_action`, which is now also used by
`context.active_action`. I've also added
`bAnimContext::active_action_user` in case the ID that is animated by
this Action is needed. That's either the active `Object` or the active
`Key`, again depending on the mode of the Dope Sheet editor.
The active Action can also be obtained via
`ANIM_active_action_from_area(scene, view_layer, area)`. This is a
faster method than the usual `ANIM_animdata_get_context(C, &ac)` and
it doesn't need the entire `bContext`.
The "Stash Action" and "Push Down Action" to the NLA were also
implemented by writing to `SpaceAction::action` via RNA. They now use
`ANIM_animdata_get_context()` to get the active action owner ID, and a
direct call to `blender::animrig::assign_action()` instead.
The remaining use of `SpaceAction::action` was for display &
manipulation of Scene/Action markers. This required some work to get
addressed, as there was quite a bit of spaghetti and duplicate logic
to churn through. More can be improved there, but I had to limit the
time I spent on this.
Python code that was still using `context.space_data.action` to find
the currently-showing Action has been migrated to
`context.active_action`.
Related: #119626
Pull Request: https://projects.blender.org/blender/blender/pulls/145672
The recently introduced feature of playhead snapping (#137278)
added a popover menu for snap targets.
This used text to indicate the contents of said popover.
In order to bring it in line with the other snapping menu, this PR adds
icons to indicate the enabled state of snapping.
Part of #135794
Pull Request: https://projects.blender.org/blender/blender/pulls/139271
You could basically not interact with the animation (except for
keyframes in the main region), channels region was totally empty, NLA
could not be used, ...
It is not something users will animate a lot, but we should still have
animation editors in mind when adding a new object type.
Just missing from cc31d7bb49
Pull Request: https://projects.blender.org/blender/blender/pulls/141449
Add a footer region which contains essentially the playback and frame
range buttons from the Timeline Editor, to the following editors:
- Dope Sheet
- Graph
- NLA
- Sequencer
Available in the View menu in each editor, hidden by default.
The motivation is to provide a convenient way to access these
often used controls, and in the near future adjust these footers
to add more playback functionality related to each editor.
See PR for details and screenshots.
Pull Request: https://projects.blender.org/blender/blender/pulls/135697
This patch adds snapping options for the playhead to all animation editors.
The options can be modified through a new dropdown in the editor header.
All editors will show all those options, and they are shared,
so toggling the option in on editor will change it for all other editors too.
Some options are not working/relevant in some editors for example
Strips in the Dope Sheet. However for consistency the option is still shown.
This is a separate menu from the transform snapping menu because
you can toggle the snapping for transform and playhead separately.
Putting it in the existing snapping transform menu would imply that it can
be turned off with the magnet which is not the case.
Playhead snapping is explicitly disabled for the drivers editor
because there is no playhead to drag around.
Snapping to Frame/Second intervals takes the scene start as a starting point.
That means you can snap to the n-th second of the animation even though
it might not start at frame 1. The preview range is NOT taken into account
by design since the use case is working on a sub-section of the animation
in which case the snap target should not change.
Snapping is toggled by pressing CTRL as indicated by the status bar.
Snapping to Frames/Seconds is absolute, meaning no matter
how far away your cursor it will snap to the closest snap point.
All others only snap to things if they are close to the cursor in pixel values.
When mixing those two behaviors, it prefers relative snapping.
If no point is close enough to snap relative,
it will fall back to absolute snapping.
Based on the prototype #135913
Part of #135794
Pull Request: https://projects.blender.org/blender/blender/pulls/137278
The name `id_root` was not descriptive, and was just a hold-over from the
equivalent (now deprecated) property on the Action itself. `target_id_type`
is more clear, reflecting that this is the type of ID the Slot is intended
to animate.
This PR also renames the corresponding `id_root_icon` to
`target_id_type_icon`.
Note that this PR updates the GLTF import/export core addon to adhere to
these name changes as well.
Pull Request: https://projects.blender.org/blender/blender/pulls/133164
The Action Editor was already getting crowded, but has become even
moreso with the addition of the new Slot selector. Part of this clutter
is due to the NLA-related buttons:
- The up/down track switching buttons.
- The Push Down button.
- The Stash button.
The latter two are currently still useful, but don't need to be directly
on the header itself. This PR moves them to the header's Action menu.
The up/down buttons have several issues:
- They are conceptually confusing: you cannot visually see what's
happening or which track you're on without an NLA editor open anyway,
so somewhere in the NLA Editor would be a better place for them.
- Their functionality is broken, and it seems has been for a long time:
you can go down in the track stack, but often can't go back up,
despite the existence of the up button. It doesn't appear that anyone
has reported this cripplingly broken behavior, which strongly suggests
that very few people (if anyone) is using or relying on these buttons.
- They don't make any sense when you have more than one strip on a track
anyway (which strip do you go into tweak mode on?).
For all these reasons, this PR simply removes the up/down buttons.
- Wrap the closing parenthesis onto it's own line
which makes assignments to the return value
read better.
- Reduce right-shift with multi-line function calls.
`AnimData`, NLA strips, and action constraints all have an
`action_slots` field in RNA. The purpose of this field is to list
the slots of the currently assigned action (if any) that are suitable
for the relevant ID.
However, this is not clear from the naming. In particular, given that
there is another field `action_slot` that represents the currently
assigned slot, the name `action_slots` could be easily misinterpreted
as a way to assign multiple slots at once, which is not possible.
To help clarify its actual purpose and meaning, this PR renames the
field to `action_suitable_slots`.
As a bonus, this also ends up decluttering the Python autocomplete when
looking for things related to `action_slot`.
Ref: #130892
Pull Request: https://projects.blender.org/blender/blender/pulls/130754
This commit takes the 'Slotted Actions' out of the experimental phase.
As a result:
- All newly created Actions will be slotted Actions.
- Legacy Actions loaded from disk will be versioned to slotted Actions.
- The new Python API for slots, layers, strips, and channel bags is
available.
- The legacy Python API for accessing F-Curves and Action Groups is
still available, and will operate on the F-Curves/Groups for the first
slot only.
- Creating an Action by keying (via the UI, operators, or the
`rna_struct.keyframe_insert` function) will try and share Actions
between related data-blocks. See !126655 for more info about this.
- Assigning an Action to a data-block will auto-assign a suitable Action
Slot. The logic for this is described below. However, There are cases
where this does _not_ automatically assign a slot, and thus the Action
will effectively _not_ animate the data-block. Effort has been spent
to make Action selection work both reliably for Blender users as well
as keep the behaviour the same for Python scripts. Where these two
goals did not converge, reliability and understandability for users
was prioritised.
Auto-selection of the Action Slot upon assigning the Action works as
follows. The first rule to find a slot wins.
1. The data-block remembers the slot name that was last assigned. If the
newly assigned Action has a slot with that name, it is chosen.
2. If the Action has a slot with the same name as the data-block, it is
chosen.
3. If the Action has only one slot, and it has never been assigned to
anything, it is chosen.
4. If the Action is assigned to an NLA strip or an Action constraint,
and the Action has a single slot, and that slot has a suitable ID
type, it is chosen.
This last step is what I was referring to with "Where these two goals
did not converge, reliability and understandability for users was
prioritised." For regular Action assignments (like via the Action
selectors in the Properties editor) this rule doesn't apply, even though
with legacy Actions the final state ("it is animated by this Action")
differs from the final state with slotted Actions ("it has no slot so is
not animated"). This is done to support the following workflow:
- Create an Action by animating Cube.
- In order to animate Suzanne with that same Action, assign the Action
to Suzanne.
- Start keying Suzanne. This auto-creates and auto-assigns a new slot
for Suzanne.
If rule 4. above would apply in this case, the 2nd step would
automatically select the Cube slot for Suzanne as well, which would
immediately overwrite Suzanne's properties with the Cube animation.
Technically, this commit:
- removes the `WITH_ANIM_BAKLAVA` build flag,
- removes the `use_animation_baklava` experimental flag in preferences,
- updates the code to properly deal with the fact that empty Actions are
now always considered slotted/layered Actions (instead of that relying
on the user preference).
Note that 'slotted Actions' and 'layered Actions' are the exact same
thing, just focusing on different aspects (slot & layers) of the new
data model.
The "Baklava phase 1" assumptions are still asserted. This means that:
- an Action can have zero or one layer,
- that layer can have zero or one strip,
- that strip must be of type 'keyframe' and be infinite with zero
offset.
The code to handle legacy Actions is NOT removed in this commit. It will
be removed later. For now it's likely better to keep it around as
reference to the old behaviour in order to aid in some inevitable
bugfixing.
Ref: #120406
In the Action editor header, change the "Show All Slots" filter to
become "Only Show Slot of Active Object". The default state remains
"off".
This means that any new/upgraded Action editor will show all slots in
the Action by default. I think this is a good idea, especially since
cb6ed12ef1 makes related data-blocks share
the same Action, and thus the Action will have a mixture of Object and
non-Object animation. I suspect that it'll help in understanding the new
functionality of slotted Actions when they are most visible, i.e. when
the multiple slots are all shown.
Since slotted Actions are so new, I don't think we need to add
versioning code to accomodate this change.
Pull Request: https://projects.blender.org/blender/blender/pulls/129011
Removes many of the operators, panels, and menus used exclusively by Grease Pencil v2 that are no longer needed in v3.
No functional changes are expected.
Some operators are still used by the annotations system and have to be kept around. These may be renamed in future.
Pull Request: https://projects.blender.org/blender/blender/pulls/128521
This adds an operator that splits all slots of the action on the active object,
into separate actions.
The newly created actions will be named `slot_name+Action`.
All users of those slots will be reassigned to this new action.
The exploded action will not be deleted, but will end up with 0 users
unless a fake user is set.
------
For the review, does that operator name make sense?
Pull Request: https://projects.blender.org/blender/blender/pulls/128251
This adds an operator that moves slots of slot channels selected in
the channel box to a new action.
All slots are moved together into that new action instead of
moving them into separate actions.
I think that's more reasonable because that way the "move slots into separate actions" is
still possible by selecting the slots one by one.
The "explode action" operator that does just that can be a separate operator.
The new action is named after the slot for the case when only one slot is moved.
When multiple slots are moved, the name "CombinedAction" is used.
This also adds a menu entry "Action" to the action editor.
Pull Request: https://projects.blender.org/blender/blender/pulls/128171
Anim: Show Action Slot type in panel + change type icon RNA wrapper name
This PR combines two changes, both necessary to properly show the
Action Slot ID type in the GUI:
1. Expose the slot's ID type as an RNA enum property `id_root`, in the
same way that the DNA `Action::idtype` is exposed as
`Action.id_root` in RNA. The only differences are that this
property is read-only on slots (it is supposed to be correct, and
if it's not, I'd prefer a bug report over people working around
this), and that the default value is named differently (`ANY` on
Actions, `UNSPECIFIED` on Slots). The latter is done to clarify
that this is not a situation that will last for long; as soon as
the slot is assigned to any ID, it will be locked to that ID type.
2. Rename the RNA property `ActionSlot.idtype_icon` to
`ActionSlot.id_root_icon` to be consistent with the above.
And of course the type is drawn in the Slot properties panel in the
Action editor. This now replaces the icon in the slot name (in the
same panel), so that it's clearer that that is the slot name, and not
an object/material/whatevertype name.
When an NLA strip is in tweak mode, the Action editor no longer allows
switching the assigned slot. This is now consistent with it also not
allowing switching of the Action.
The slot used by the NLA strip can be changed in the NLA strip
properties panel of the NLA editor, in the same way that the Action
itself can be changed there.
The new Action selector (51fd355c01) avoids the need to use
`space_data.action` in the dope sheet (that attribute was a bit of a
hack; the new Action selector was made to avoid that). It failed to take
the dope sheet's shape key mode into account properly, though. This is
now fixed.
Pull Request: https://projects.blender.org/blender/blender/pulls/127177
Add two new operators, `anim.slot_new_for_id` and
`anim.slot_unassign_from_id`. These are used in the Action editor and
the Animation panels in the Properties editor, to respectively create a
new Action Slot for an ID and to unassign whatever slot is currently
assigned to that ID.
The latter operator also replaces the C++ operator
`anim.slot_unassign_object`, which was specifically made for the
Dopesheet header. The Python ones are generic enough to be used there
too.
Pull Request: https://projects.blender.org/blender/blender/pulls/126943
Add new operator `anim.slot_new_for_object`, which creates a new action
slot for the active object. Since this slot is created on the action
used by the object, it requires that this action exists and is a
layered/slotted action (which by definition includes empty actions).
Pull Request: https://projects.blender.org/blender/blender/pulls/126934
Hide the Action Slot selector in the Action editor behind the experimental
flag. Not only shouldn't it be shown, but also it uses an API that's only
available in experimental builds.
Add an Action Slot selector to the Action editor's header, next to the
Action selector. The selector shows all slots in the action that are
suitable for animating objects (as the Action editor itself is limited
to showing the Action of the active object).
This also considerably simplifies the 'Animation Debug' panel, as some
debugging code has been removed, as well as the display of any animation
layers. The latter can be reintroduced (if necessary) when multi-layer
animation support is added. Most importantly, it removes the
WindowManager property that was used as a hack to assign layered Actions
to objects.
API change: the RNA property `AnimData.slot` is now a pointer property
that reflects the actual slot (it used to be an enum property).
Some small changes to the UI code were necessary to make the selector
show the slot's display name (and not their internal name).
Pull Request: https://projects.blender.org/blender/blender/pulls/125416
Add the concept of 'active slot' within an Action. This allows
clicking on a slot in the Action editor, to select it and mark it as
'active'.
Note that this does _not_ add support for action slots in
`ANIM_set_active_channel()`, as that function doesn't get enough info
to do that, and refactoring it is not on my wishlist.
RNA property `action.slots.active` can be used to access and set the
active slot in Python. `slot.active` can be used to query the slot's
active state, and is read-only (so that there is one way to set the
active slot).
A panel in the Action editor shows info about the active slot. This
panel is just a minimal UI that shows the name and an icon
representing the idtype of the active slot.
Pull Request: https://projects.blender.org/blender/blender/pulls/124422
Rename 'Binding' to 'Slot'. The old term was causing all kind of
confusion, and 'slot' was considered to be a better term for the
intended functionality.
This commit breaks existing blend files that were using the new layered
Action for their animation. The animation data will be lost due to the
rename, as there is no versioning code or DNA renaming logic. At this
time the new system is still marked as experimental, so shouldn't be
used for anything serious anyway.
Pull Request: https://projects.blender.org/blender/blender/pulls/124170