29 const Layer ¤t_layer);
38 PointerRNA &animated_id_ptr,
39 bool flush_to_original);
50 if (layer->influence <= 0.0f) {
56 animated_id_ptr, action, *layer, slot_handle, anim_eval_context);
65 last_result = layer_result;
80 const bool flush_to_original)
83 animated_id_ptr, action, slot_handle, anim_eval_context);
84 if (!evaluation_result) {
123 BLI_assert_msg(
ptr->owner_id,
"NLA support was not ported to the layered animation system");
130 const char *rna_path,
131 const int array_index,
150 if (!channelbag_for_slot) {
164 &animated_id_ptr, fcu->rna_path, fcu->array_index, &anim_rna))
169 "Cannot resolve RNA path %s[%d] on ID %s\n",
176 const float curval =
calculate_fcurve(&anim_rna, fcu, &offset_eval_context);
177 evaluation_result.
store(fcu->rna_path, fcu->array_index, curval, anim_rna);
180 return evaluation_result;
185 const bool flush_to_original)
187 for (
auto channel_result : evaluation_result.
items()) {
190 const float animated_value = anim_prop.
value;
195 if (flush_to_original) {
217 switch (strip.
type()) {
218 case Strip::Type::Keyframe: {
229 const Layer ¤t_layer)
237 for (
auto channel_result : current_result.
items()) {
292 if (!strip->contains_frame(anim_eval_context.
eval_time)) {
297 animated_id_ptr, owning_action, *strip, slot_handle, anim_eval_context);
302 const bool is_weak_result = strip->is_last_frame(anim_eval_context.
eval_time);
303 if (is_weak_result) {
305 last_weak_result = strip_result;
313 return last_weak_result;
Layered Action evaluation.
bool BKE_animsys_write_to_rna_path(struct PathResolvedRNA *anim_rna, float value, bool force_write=false)
bool BKE_animsys_rna_path_resolve(struct PointerRNA *ptr, const char *rna_path, int array_index, struct PathResolvedRNA *r_result)
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)
#define CLOG_DEBUG(clg_ref,...)
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
blender::Span< const Strip * > strips() 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)
decltype(::ActionSlot::handle) slot_handle_t
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)
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)
static int blend(const Tex *tex, const float texvec[3], TexResult *texres)