25#include "RNA_prototypes.hh"
62 if (prop &&
ptr.
type == &RNA_AnimData) {
89 *r_adt_id_owner = &ob->
id;
98 *r_adt_id_owner = &key->
id;
239 ID *adt_id_owner =
nullptr;
251 if (
ptr.
type == &RNA_AnimData) {
255 else if (
ptr.
type == &RNA_SpaceDopeSheetEditor) {
278 if (
ptr.
type == &RNA_SpaceDopeSheetEditor) {
280 saction->
action =
nullptr;
285 printf(
"WARNING: Failed to stash %s. It may already exist in the NLA stack though\n",
345 if (!adt || !saction->
action) {
358 ID *adt_id_owner =
nullptr;
386 saction->
action =
nullptr;
397 ot->
name =
"Push Down Action";
399 ot->
description =
"Push action down on to the NLA stack as a new strip";
418 ID *adt_id_owner =
nullptr;
437 saction->
action =
nullptr;
456 ot->
name =
"Stash Action";
458 ot->
description =
"Store this action in the NLA stack as a non-contributing strip for later use";
472 "Create a new action once the existing one has been safely stored");
521 ID *adt_id_owner =
nullptr;
525 if (saction->
action ==
nullptr) {
551 saction->
action =
nullptr;
569 ot->
name =
"Stash Action";
570 ot->
idname =
"ACTION_OT_stash_and_create";
572 "Store this action in the NLA stack as a non-contributing strip for later use, and create a "
608 if (act->
id.
us == 1) {
611 "Action '%s' will not be saved, create Fake User or Stash in NLA Stack to retain",
627 nlt_next = nlt->
next;
629 if (strstr(nlt->
name,
DATA_(
"[Action Stash]"))) {
631 nstrip = strip->
next;
633 if (strip->
act == act) {
656 if (scene !=
nullptr) {
657 scene->flag &= ~SCE_NLA_EDIT_ON;
686 ID *animated_id =
nullptr;
695 return adt->
action !=
nullptr;
704 if (saction->
action && adt) {
715 ID *animated_id =
nullptr;
742 ot->
name =
"Unlink Action";
744 ot->
description =
"Unlink this action from the active action slot (and/or exit Tweak Mode)";
756 "Clear Fake User and remove "
757 "copy stashed in this data-block's NLA stack");
779 if ((ctime < strip->start) && (strip->prev ==
nullptr)) {
783 if ((ctime > strip->end) && (strip->next ==
nullptr)) {
821 old_track->
flag &= ~NLATRACK_SOLO;
829 adt->
flag &= ~ADT_NLA_EVAL_OFF;
888 ID *animated_id =
nullptr;
898 if (act_track ==
nullptr) {
904 if (act_track->
next) {
908 for (nlt = act_track->
next; nlt; nlt = nlt->
next) {
928 act_track->
flag &= ~NLATRACK_SOLO;
929 adt->
flag &= ~ADT_NLA_SOLO_TRACK;
948 ot->
idname =
"ACTION_OT_layer_next";
950 "Switch to editing action in animation layer above the current action in the NLA Stack";
1004 ID *animated_id =
nullptr;
1013 if (adt ==
nullptr) {
1015 op->
reports,
RPT_ERROR,
"Internal Error: Could not find Animation Data/NLA Stack to use");
1025 nlt = act_track->
prev;
1033 for (; nlt; nlt = nlt->
prev) {
1051 ot->
name =
"Previous Layer";
1052 ot->
idname =
"ACTION_OT_layer_prev";
1054 "Switch to editing action in animation layer below the current action in the NLA Stack";
Functions and classes to work with Actions.
Blender kernel action and pose functionality.
bAction * BKE_action_add(Main *bmain, const char name[])
bScreen * CTX_wm_screen(const bContext *C)
ScrArea * CTX_wm_area(const bContext *C)
Object * CTX_data_active_object(const bContext *C)
SpaceLink * CTX_wm_space_data(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
Main * CTX_data_main(const bContext *C)
Key * BKE_key_from_object(Object *ob)
bool BKE_id_is_editable(const Main *bmain, const ID *id)
void id_fake_user_clear(ID *id)
ID * BKE_id_copy(Main *bmain, const ID *id)
void BKE_nlastrip_remove_and_free(ListBase *strips, NlaStrip *strip, const bool do_id_user)
void BKE_nla_action_pushdown(OwnedAnimData owned_adt, bool is_liboverride)
void BKE_nla_tweakmode_exit(OwnedAnimData owned_adt)
NlaTrack * BKE_nlatrack_find_tweaked(AnimData *adt)
bool BKE_nla_action_stash(OwnedAnimData owned_adt, bool is_liboverride)
bool BKE_nla_tweakmode_enter(OwnedAnimData owned_adt)
void BKE_nlatrack_remove_and_free(ListBase *tracks, NlaTrack *nlt, bool do_id_user)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BKE_report(ReportList *reports, eReportType type, const char *message)
float BKE_scene_ctime_get(const Scene *scene)
#define LISTBASE_FOREACH(type, var, list)
#define IN_RANGE_INCL(a, b, c)
void DEG_id_tag_update_ex(Main *bmain, ID *id, unsigned int flags)
#define ID_IS_OVERRIDE_LIBRARY(_id)
Object is a sort of wrapper for general info.
bool ED_operator_action_active(bContext *C)
bool ED_operator_nla_active(bContext *C)
constexpr PointerRNA PointerRNA_NULL
void UI_context_active_but_prop_get_templateID(const bContext *C, PointerRNA *r_ptr, PropertyRNA **r_prop)
static bool action_unlink_poll(bContext *C)
static void action_layer_switch_strip(const OwnedAnimData owned_adt, NlaTrack *old_track, NlaStrip *old_strip, NlaTrack *nlt, NlaStrip *strip)
AnimData * ED_actedit_animdata_from_context(const bContext *C, ID **r_adt_id_owner)
void ACTION_OT_layer_prev(wmOperatorType *ot)
void ACTION_OT_push_down(wmOperatorType *ot)
static bAction * action_create_new(bContext *C, bAction *oldact)
static bool action_new_poll(bContext *C)
static void actedit_change_action(bContext *C, bAction *act)
static int action_stash_exec(bContext *C, wmOperator *op)
void ACTION_OT_unlink(wmOperatorType *ot)
static bool action_layer_prev_poll(bContext *C)
static bool action_stash_create_poll(bContext *C)
void ED_animedit_unlink_action(bContext *C, ID *id, AnimData *adt, bAction *act, ReportList *reports, bool force_delete)
static bool action_pushdown_poll(bContext *C)
void ACTION_OT_stash_and_create(wmOperatorType *ot)
static int action_layer_next_exec(bContext *C, wmOperator *op)
static int action_new_exec(bContext *C, wmOperator *)
void ACTION_OT_stash(wmOperatorType *ot)
static int action_unlink_exec(bContext *C, wmOperator *op)
static NlaStrip * action_layer_get_nlastrip(ListBase *strips, float ctime)
static int action_stash_create_exec(bContext *C, wmOperator *op)
void ACTION_OT_new(wmOperatorType *ot)
void ACTION_OT_layer_next(wmOperatorType *ot)
static int action_pushdown_exec(bContext *C, wmOperator *op)
static int action_layer_prev_exec(bContext *C, wmOperator *op)
static bool action_layer_next_poll(bContext *C)
static int action_unlink_invoke(bContext *C, wmOperator *op, const wmEvent *event)
bool has_keyframes(slot_handle_t action_slot_handle) const ATTR_WARN_UNUSED_RESULT
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
void RNA_property_pointer_set(PointerRNA *ptr, PropertyRNA *prop, PointerRNA ptr_value, ReportList *reports)
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
PointerRNA RNA_property_pointer_get(PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_update(bContext *C, PointerRNA *ptr, PropertyRNA *prop)
bool RNA_property_editable(const PointerRNA *ptr, PropertyRNA *prop)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
PointerRNA RNA_pointer_create(ID *id, StructRNA *type, void *data)
PointerRNA RNA_id_pointer_create(ID *id)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
bool(* poll)(bContext *C) ATTR_WARN_UNUSED_RESULT
int(* invoke)(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
int(* exec)(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports
void WM_main_add_notifier(uint type, void *reference)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)