53 "Assigning a slot that we know is suitable should work");
66 BLI_assert_msg(ok,
"Un-assigning an Action from an NLA strip should always work.");
101 const bool force_all,
102 const BitSpan successful_remaps)
107 int total_failed = 0;
108 for (
int i = 0; i < count; i++) {
109 const bool cur_index_evaluated =
ELEM(
index, i, -1) || force_all;
110 if (!cur_index_evaluated) {
115 if (successful_remaps[i]) {
125 if (total_failed == 0) {
135 "Could not insert %i keyframe(s) due to zero NLA influence, base value, or value "
136 "remapping failed: %s.%s for indices [%s]",
142 MEM_delete(str_failed_indices);
157 nla_context, &ptr, &prop, values,
index, anim_eval_context, force_all, successful_remaps);
159 reports, ptr, &prop,
index, values.
size(),
false, successful_remaps);
160 return successful_remaps;
172 if (fcu ==
nullptr) {
184 reports,
RPT_ERROR,
"No RNA pointer available to retrieve values for keyframing from");
188 if (prop ==
nullptr) {
196 "Could not insert keyframe, as RNA path is invalid for the given ID (ID = %s, "
199 fcu->rna_path().c_str());
224 float current_value = 0.0f;
226 current_value = values[
index];
230 if (!successful_remaps[
index]) {
238 fcu, {anim_eval_context->
eval_time, current_value}, settings, flag);
243 "Failed to insert keys on F-Curve with path '%s[%d]', ensure that it is not "
244 "locked or sampled, and try removing F-Modifiers",
245 fcu->rna_path().c_str(),
Functions to insert, delete or modify keyframes.
A dynamically sized string ADT.
#define UNUSED_VARS_NDEBUG(...)
#define BLI_assert_msg(a, msg)
constexpr int64_t size() const
MutableSpan< T > as_mutable_span()
Span< const Slot * > slots() const
const Slot * slot(int64_t index) const
Slot * slot_for_handle(slot_handle_t handle)
bool is_suitable_for(const ID &animated_id) const
static constexpr slot_handle_t unassigned
void unassign_action(NlaStrip &strip, ID &animated_id)
static void get_keyframe_values_create_reports(ReportList *reports, const PointerRNA &ptr, const PropertyRNA *prop, const int index, const int count, const bool force_all, const BitSpan successful_remaps)
ActionSlotAssignmentResult assign_action_slot_handle(NlaStrip &strip, slot_handle_t slot_handle, ID &animated_id)
bool assign_action(NlaStrip &strip, Action &action, ID &animated_id)
ActionSlotAssignmentResult assign_action_slot(NlaStrip &strip, Slot *slot_to_assign, ID &animated_id)
bool insert_keyframe_direct(ReportList *reports, PointerRNA ptr, PropertyRNA *prop, FCurve *fcu, const AnimationEvalContext *anim_eval_context, eBezTriple_KeyframeType keytype, NlaKeyframingContext *nla_context, eInsertKeyFlags flag)
static BitVector nla_map_keyframe_values_and_generate_reports(const MutableSpan< float > values, const int index, PointerRNA &ptr, PropertyRNA &prop, NlaKeyframingContext *nla_context, const AnimationEvalContext *anim_eval_context, ReportList *reports, bool *force_all)
decltype(blender::ActionSlot::handle) slot_handle_t
KeyframeSettings get_keyframe_settings(bool from_userprefs)
void update_autoflags_fcurve_direct(FCurve *fcu, PropertyType prop_type)
Vector< float > get_property_values(PointerRNA *ptr, PropertyRNA *prop, bool visual_key)
bool generic_assign_action(ID &animated_id, bAction *action_to_assign, bAction *&action_ptr_ref, slot_handle_t &slot_handle_ref, char *slot_identifier)
ActionSlotAssignmentResult generic_assign_action_slot(Slot *slot_to_assign, ID &animated_id, bAction *&action_ptr_ref, slot_handle_t &slot_handle_ref, char *slot_identifier)
SingleKeyingResult insert_vert_fcurve(FCurve *fcu, const float2 position, const KeyframeSettings &settings, eInsertKeyFlags flag)
Main Key-framing API call.
ActionSlotAssignmentResult
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
void BLI_dynstr_appendf(DynStr *__restrict ds, const char *__restrict format,...) ATTR_PRINTF_FORMAT(2
void BKE_animsys_nla_remap_keyframe_values(NlaKeyframingContext *context, PointerRNA *prop_ptr, PropertyRNA *prop, const MutableSpan< float > values, int index, const AnimationEvalContext *anim_eval_context, bool *r_force_all, BitVector<> &r_values_mask)
bool BKE_fcurve_is_keyframable(const FCurve &fcu)
void BLI_dynstr_free(DynStr *ds) ATTR_NONNULL()
PropertyType RNA_property_type(PropertyRNA *prop)
void BKE_report(ReportList *reports, eReportType type, const char *message)
char * BLI_dynstr_get_cstring(const DynStr *ds) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
DynStr * BLI_dynstr_new() ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
bool RNA_path_resolve_property(const PointerRNA *ptr, const char *path, PointerRNA *r_ptr, PropertyRNA **r_prop)
const char * RNA_property_ui_name(const PropertyRNA *prop, const PointerRNA *ptr)
int32_t action_slot_handle
char last_slot_identifier[258]
eBezTriple_KeyframeType keyframe_type