25#include "RNA_prototypes.hh"
61 if (prop &&
ptr.type == &RNA_AnimData) {
66 *r_adt_id_owner =
ptr.owner_id;
88 *r_adt_id_owner = &ob->
id;
97 *r_adt_id_owner = &key->
id;
205 ID *adt_id_owner =
nullptr;
217 if (
ptr.type == &RNA_AnimData) {
219 adt_id_owner =
ptr.owner_id;
221 else if (
ptr.type == &RNA_SpaceDopeSheetEditor) {
238 printf(
"WARNING: Failed to stash %s. It may already exist in the NLA stack though\n",
264 ot->name =
"New Action";
265 ot->idname =
"ACTION_OT_new";
266 ot->description =
"Create new action";
294 if (!adt || !adt->
action) {
306 ID *adt_id_owner =
nullptr;
332 ot->name =
"Push Down Action";
333 ot->idname =
"ACTION_OT_push_down";
334 ot->description =
"Push action down on to the NLA stack as a new strip";
352 ID *adt_id_owner =
nullptr;
376 ot->name =
"Stash Action";
377 ot->idname =
"ACTION_OT_stash";
378 ot->description =
"Store this action in the NLA stack as a non-contributing strip for later use";
392 "Create a new action once the existing one has been safely stored");
440 ID *adt_id_owner =
nullptr;
444 if (adt->
action ==
nullptr) {
483 ot->name =
"Stash Action";
484 ot->idname =
"ACTION_OT_stash_and_create";
486 "Store this action in the NLA stack as a non-contributing strip for later use, and create a "
521 if (act->
id.
us == 1) {
524 "Action '%s' will not be saved, create Fake User or Stash in NLA Stack to retain",
540 nlt_next = nlt->
next;
542 if (strstr(nlt->
name,
DATA_(
"[Action Stash]"))) {
544 nstrip = strip->
next;
546 if (strip->
act == act) {
569 if (scene !=
nullptr) {
587 ID *animated_id =
nullptr;
595 return adt && adt->
action;
600 ID *animated_id =
nullptr;
627 ot->name =
"Unlink Action";
628 ot->idname =
"ACTION_OT_unlink";
629 ot->description =
"Unlink this action from the active action slot (and/or exit Tweak Mode)";
641 "Clear Fake User and remove "
642 "copy stashed in this data-block's NLA stack");
Functions and classes to work with Actions.
Blender kernel action and pose functionality.
bAction * BKE_action_add(Main *bmain, const char name[])
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)
bool BKE_nla_action_stash(OwnedAnimData owned_adt, bool is_liboverride)
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)
#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)
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)
AnimData * ED_actedit_animdata_from_context(const bContext *C, ID **r_adt_id_owner)
void ACTION_OT_push_down(wmOperatorType *ot)
static bAction * action_create_new(bContext *C, bAction *oldact)
static bool action_new_poll(bContext *C)
void ACTION_OT_unlink(wmOperatorType *ot)
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 wmOperatorStatus action_new_exec(bContext *C, wmOperator *)
void ACTION_OT_new(wmOperatorType *ot)
DEG_id_tag_update_ex(cb_data->bmain, cb_data->owner_id, ID_RECALC_TAG_FOR_UNDO|ID_RECALC_SYNC_TO_EVAL)
bool unassign_action(ID &animated_id)
bool assign_action(bAction *action, ID &animated_id)
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)