18using namespace internal;
25 const EvaluationResult ¤t_result,
26 const Layer ¤t_layer);
36 bool flush_to_original);
47 if (layer->influence <= 0.0f) {
53 animated_id_ptr, action, *layer, slot_handle, anim_eval_context);
62 last_result = layer_result;
77 const bool flush_to_original)
80 animated_id_ptr, action, slot_handle, anim_eval_context);
81 if (!evaluation_result) {
120 const char *rna_path,
121 const int array_index,
140 if (!channelbag_for_slot) {
154 &animated_id_ptr, fcu->rna_path, fcu->array_index, &anim_rna))
156 printf(
"Cannot resolve RNA path %s[%d] on ID %s\n",
163 const float curval =
calculate_fcurve(&anim_rna, fcu, &offset_eval_context);
164 evaluation_result.
store(fcu->rna_path, fcu->array_index, curval, anim_rna);
167 return evaluation_result;
172 const bool flush_to_original)
174 for (
auto channel_result : evaluation_result.
items()) {
177 const float animated_value = anim_prop.
value;
182 if (flush_to_original) {
204 switch (strip.
type()) {
205 case Strip::Type::Keyframe: {
216 const Layer ¤t_layer)
224 for (
auto channel_result : current_result.
items()) {
278 for (
Strip *strip : layer.strips()) {
279 if (!strip->contains_frame(anim_eval_context.
eval_time)) {
284 animated_id_ptr, owning_action, *strip, slot_handle, anim_eval_context);
289 const bool is_weak_result = strip->is_last_frame(anim_eval_context.
eval_time);
290 if (is_weak_result) {
292 last_weak_result = strip_result;
300 return last_weak_result;
Layered Action evaluation.
bool BKE_animsys_rna_path_resolve(struct PointerRNA *ptr, const char *rna_path, int array_index, struct PathResolvedRNA *r_result)
bool BKE_animsys_write_to_rna_path(struct PathResolvedRNA *anim_rna, float value)
bool BKE_fcurve_is_empty(const FCurve *fcu)
float calculate_fcurve(PathResolvedRNA *anim_rna, FCurve *fcu, const AnimationEvalContext *anim_eval_context)
#define BLI_assert_msg(a, msg)
constexpr const char * c_str() const
blender::Span< const Layer * > layers() const
blender::Span< const FCurve * > fcurves() const
void store(const StringRefNull rna_path, const int array_index, const float value, const PathResolvedRNA &prop_rna)
EvaluationMap::ItemIterator items() const
const ChannelBag * channelbag_for_slot(const Slot &slot) const
const T & data(const Action &owning_action) const
EvaluationResult evaluate_layer(PointerRNA &animated_id_ptr, Action &owning_action, Layer &layer, const slot_handle_t slot_handle, const AnimationEvalContext &anim_eval_context)
static void animsys_write_orig_anim_rna(PointerRNA *ptr, const char *rna_path, const int array_index, const float value)
void evaluate_and_apply_action(PointerRNA &animated_id_ptr, Action &action, slot_handle_t slot_handle, const AnimationEvalContext &anim_eval_context, bool flush_to_original)
static bool is_fcurve_evaluatable(const FCurve *fcu)
EvaluationResult evaluate_action(PointerRNA &animated_id_ptr, Action &action, slot_handle_t slot_handle, const AnimationEvalContext &anim_eval_context)
static void animsys_construct_orig_pointer_rna(const PointerRNA *ptr, PointerRNA *ptr_orig)
EvaluationResult blend_layer_results(const EvaluationResult &last_result, const EvaluationResult ¤t_result, const Layer ¤t_layer)
void apply_evaluation_result(const EvaluationResult &evaluation_result, PointerRNA &animated_id_ptr, bool flush_to_original)
static EvaluationResult evaluate_keyframe_data(PointerRNA &animated_id_ptr, StripKeyframeData &strip_data, const slot_handle_t slot_handle, const AnimationEvalContext &offset_eval_context)
decltype(::ActionSlot::handle) slot_handle_t
static EvaluationResult evaluate_strip(PointerRNA &animated_id_ptr, Action &owning_action, Strip &strip, const slot_handle_t slot_handle, const AnimationEvalContext &anim_eval_context)
T interpolate(const T &a, const T &b, const FactorT &t)