25#include "RNA_prototypes.hh"
62 if (prop &&
ptr.type == &RNA_AnimData) {
67 *r_adt_id_owner =
ptr.owner_id;
89 *r_adt_id_owner = &ob->
id;
98 *r_adt_id_owner = &key->
id;
226 ID *adt_id_owner =
nullptr;
238 if (
ptr.type == &RNA_AnimData) {
240 adt_id_owner =
ptr.owner_id;
242 else if (
ptr.type == &RNA_SpaceDopeSheetEditor) {
265 if (
ptr.type == &RNA_SpaceDopeSheetEditor) {
267 saction->
action =
nullptr;
272 printf(
"WARNING: Failed to stash %s. It may already exist in the NLA stack though\n",
300 ot->name =
"New Action";
301 ot->idname =
"ACTION_OT_new";
302 ot->description =
"Create new action";
332 if (!adt || !saction->
action) {
345 ID *adt_id_owner =
nullptr;
365 saction->
action =
nullptr;
376 ot->name =
"Push Down Action";
377 ot->idname =
"ACTION_OT_push_down";
378 ot->description =
"Push action down on to the NLA stack as a new strip";
397 ID *adt_id_owner =
nullptr;
409 saction->
action =
nullptr;
428 ot->name =
"Stash Action";
429 ot->idname =
"ACTION_OT_stash";
430 ot->description =
"Store this action in the NLA stack as a non-contributing strip for later use";
444 "Create a new action once the existing one has been safely stored");
493 ID *adt_id_owner =
nullptr;
497 if (saction->
action ==
nullptr) {
516 saction->
action =
nullptr;
534 ot->name =
"Stash Action";
535 ot->idname =
"ACTION_OT_stash_and_create";
537 "Store this action in the NLA stack as a non-contributing strip for later use, and create a "
573 if (act->
id.
us == 1) {
576 "Action '%s' will not be saved, create Fake User or Stash in NLA Stack to retain",
592 nlt_next = nlt->
next;
594 if (strstr(nlt->
name,
DATA_(
"[Action Stash]"))) {
596 nstrip = strip->
next;
598 if (strip->
act == act) {
621 if (scene !=
nullptr) {
645 ID *animated_id =
nullptr;
654 return adt->
action !=
nullptr;
663 if (saction->
action && adt) {
674 ID *animated_id =
nullptr;
701 ot->name =
"Unlink Action";
702 ot->idname =
"ACTION_OT_unlink";
703 ot->description =
"Unlink this action from the active action slot (and/or exit Tweak Mode)";
715 "Clear Fake User and remove "
716 "copy stashed in this data-block's NLA stack");
738 if ((ctime < strip->start) && (strip->prev ==
nullptr)) {
742 if ((ctime > strip->end) && (strip->next ==
nullptr)) {
847 ID *animated_id =
nullptr;
857 if (act_track ==
nullptr) {
863 if (act_track->
next) {
867 for (nlt = act_track->
next; nlt; nlt = nlt->
next) {
906 ot->name =
"Next Layer";
907 ot->idname =
"ACTION_OT_layer_next";
909 "Switch to editing action in animation layer above the current action in the NLA Stack";
963 ID *animated_id =
nullptr;
972 if (adt ==
nullptr) {
974 op->
reports,
RPT_ERROR,
"Internal Error: Could not find Animation Data/NLA Stack to use");
984 nlt = act_track->
prev;
992 for (; nlt; nlt = nlt->
prev) {
1010 ot->name =
"Previous Layer";
1011 ot->idname =
"ACTION_OT_layer_prev";
1013 "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)
Object is a sort of wrapper for general info.
bool ED_operator_action_active(bContext *C)
bool ED_operator_nla_active(bContext *C)
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 wmOperatorStatus action_stash_exec(bContext *C, wmOperator *op)
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)
static wmOperatorStatus action_layer_next_exec(bContext *C, wmOperator *op)
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)
void ACTION_OT_unlink(wmOperatorType *ot)
static bool action_layer_prev_poll(bContext *C)
static wmOperatorStatus action_unlink_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static bool action_stash_create_poll(bContext *C)
static wmOperatorStatus action_stash_create_exec(bContext *C, wmOperator *op)
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 wmOperatorStatus action_unlink_exec(bContext *C, wmOperator *op)
void ACTION_OT_stash(wmOperatorType *ot)
static wmOperatorStatus action_pushdown_exec(bContext *C, wmOperator *)
static NlaStrip * action_layer_get_nlastrip(ListBase *strips, float ctime)
static wmOperatorStatus action_new_exec(bContext *C, wmOperator *)
void ACTION_OT_new(wmOperatorType *ot)
void ACTION_OT_layer_next(wmOperatorType *ot)
static wmOperatorStatus action_layer_prev_exec(bContext *C, wmOperator *op)
static bool action_layer_next_poll(bContext *C)
#define ID_IS_OVERRIDE_LIBRARY(_id)
DEG_id_tag_update_ex(cb_data->bmain, cb_data->owner_id, ID_RECALC_TAG_FOR_UNDO|ID_RECALC_SYNC_TO_EVAL)
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)
const PointerRNA PointerRNA_NULL
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_discrete(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)
wmEventModifierFlag modifier
struct ReportList * reports
void WM_main_add_notifier(uint type, void *reference)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)