The new/experimental, layered `Animation` data-block is merged with the existing `bAction` data-block. The `Animation` data-block is considerably newer than `bAction`, so the supporting code that was written for it is also more modern. When moving that code into `bAction`, I chose to keep the modernity where possible, and thus some of the old code has been updated as well. Things like preferring references over pointers. The `Animation` data-block is now gone from DNA, the main database, etc. As this was still an experimental feature, there is no versioning code to convert any of that to Actions. The DNA struct `bAction` now has a C++ wrapper `animrig::Action`, that can be obtained via `some_action->wrap()`. `animrig::Action` has functions `is_empty()`, `is_action_legacy()`, and `is_action_layered()`. They **all** return `true` when the Action is empty, as in that case none of the data that makes an action either 'legacy' or 'layered' is there. The 'animation filtering' code (for showing things in the dope sheet, graph editor, etc) that I wrote for `Animation` is intentionally kept around. These types now target 'layered actions' and the already-existing ones 'legacy actions'. A future PR may merge these two together, but given how much work it was to add something new there, I'd rather wait until the dust has settled on this commit. There are plenty of variables (and some comments) named `anim` or `animation` that now are of type `animrig::Action`. I haven't renamed them all, to keep the noise level low in this commit (it's already big enough). This can be done in a followup, non-functional PR. Related task: #121355 Pull Request: https://projects.blender.org/blender/blender/pulls/121357
36 lines
968 B
C++
36 lines
968 B
C++
/* SPDX-FileCopyrightText: 2023 Blender Developers
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
/** \file
|
|
* \ingroup animrig
|
|
*
|
|
* \brief Animation data-block evaluation.
|
|
*/
|
|
#pragma once
|
|
|
|
#include "DNA_anim_types.h"
|
|
|
|
#include "ANIM_action.hh"
|
|
|
|
struct AnimationEvalContext;
|
|
struct PointerRNA;
|
|
|
|
namespace blender::animrig {
|
|
|
|
/**
|
|
* Top level animation evaluation function.
|
|
*
|
|
* Animate the given ID, using the animation data-block and the given binding.
|
|
*
|
|
* \param flush_to_original: when true, look up the original data-block (assuming
|
|
* the given one is an evaluated copy) and update that too.
|
|
*/
|
|
void evaluate_and_apply_animation(PointerRNA &animated_id_ptr,
|
|
Action &animation,
|
|
binding_handle_t binding_handle,
|
|
const AnimationEvalContext &anim_eval_context,
|
|
bool flush_to_original);
|
|
|
|
} // namespace blender::animrig
|