25#include "RNA_prototypes.hh"
63 if (prop && ptr.
type == RNA_AnimData) {
90 *r_adt_id_owner = &ob->
id;
99 *r_adt_id_owner = &key->
id;
207 ID *adt_id_owner =
nullptr;
216 oldact = id_cast<bAction *>(oldptr.
owner_id);
219 if (ptr.
type == RNA_AnimData) {
223 else if (ptr.
type == RNA_SpaceDopeSheetEditor) {
229 oldact = adt ? adt->
action :
nullptr;
240 printf(
"WARNING: Failed to stash %s. It may already exist in the NLA stack though\n",
266 ot->
name =
"New Action";
267 ot->
idname =
"ACTION_OT_new";
296 if (!adt || !adt->
action) {
308 ID *adt_id_owner =
nullptr;
334 ot->
name =
"Push Down Action";
335 ot->
idname =
"ACTION_OT_push_down";
336 ot->
description =
"Push action down on to the NLA stack as a new strip";
354 ID *adt_id_owner =
nullptr;
378 ot->
name =
"Stash Action";
379 ot->
idname =
"ACTION_OT_stash";
380 ot->
description =
"Store this action in the NLA stack as a non-contributing strip for later use";
394 "Create a new action once the existing one has been safely stored");
442 ID *adt_id_owner =
nullptr;
446 if (adt->
action ==
nullptr) {
485 ot->
name =
"Stash Action";
486 ot->
idname =
"ACTION_OT_stash_and_create";
488 "Store this action in the NLA stack as a non-contributing strip for later use, and create a "
523 if (act->
id.
us == 1) {
526 "Action '%s' will not be saved, create Fake User or Stash in NLA Stack to retain",
541 for (nlt = adt->
nla_tracks.first(); nlt; nlt = nlt_next) {
542 nlt_next = nlt->
next;
544 if (strstr(nlt->
name,
DATA_(
"[Action Stash]"))) {
545 for (strip = nlt->
strips.first(); strip; strip = nstrip) {
546 nstrip = strip->
next;
548 if (strip->
act == act) {
552 if (nlt->
strips.first_ ==
nullptr) {
571 if (scene !=
nullptr) {
589 ID *animated_id =
nullptr;
597 return adt && adt->
action;
602 ID *animated_id =
nullptr;
629 ot->
name =
"Unlink Action";
630 ot->
idname =
"ACTION_OT_unlink";
631 ot->
description =
"Unlink this action from the active action slot (and/or exit Tweak Mode)";
643 "Clear Fake User and remove "
644 "copy stashed in this data-block's NLA stack");
Functions and classes to work with Actions.
Blender kernel action and pose functionality.
#define ID_IS_OVERRIDE_LIBRARY(_id)
Object is a sort of wrapper for general info.
bool unassign_action(ID &animated_id)
bool assign_action(bAction *action, ID &animated_id)
void context_active_but_prop_get_templateID(const bContext *C, PointerRNA *r_ptr, PropertyRNA **r_prop)
void WM_main_add_notifier(uint type, void *reference)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
PointerRNA RNA_property_pointer_get(PointerRNA *ptr, PropertyRNA *prop)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
static wmOperatorStatus action_unlink_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void RNA_property_update(bContext *C, PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_pointer_set(PointerRNA *ptr, PropertyRNA *prop, PointerRNA ptr_value, ReportList *reports)
bool ED_operator_nla_active(bContext *C)
PointerRNA RNA_id_pointer_create(ID *id)
static bool action_stash_create_poll(bContext *C)
static bool action_unlink_poll(bContext *C)
static wmOperatorStatus action_stash_create_exec(bContext *C, wmOperator *op)
bAction * BKE_action_add(Main *bmain, const char name[])
static wmOperatorStatus action_pushdown_exec(bContext *C, wmOperator *)
static wmOperatorStatus action_stash_exec(bContext *C, wmOperator *op)
void BKE_nla_tweakmode_exit(OwnedAnimData owned_adt)
static wmOperatorStatus action_unlink_exec(bContext *C, wmOperator *op)
bool ED_operator_action_active(bContext *C)
void ED_animedit_unlink_action(bContext *C, ID *id, AnimData *adt, bAction *act, ReportList *reports, bool force_delete)
void ACTION_OT_stash(wmOperatorType *ot)
void ACTION_OT_unlink(wmOperatorType *ot)
void DEG_id_tag_update_ex(Main *bmain, ID *id, unsigned int flags)
void BKE_report(ReportList *reports, eReportType type, const char *message)
static bool action_new_poll(bContext *C)
void BKE_nla_action_pushdown(OwnedAnimData owned_adt, bool is_liboverride)
static wmOperatorStatus action_new_exec(bContext *C, wmOperator *)
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
void ACTION_OT_stash_and_create(wmOperatorType *ot)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
void ACTION_OT_push_down(wmOperatorType *ot)
SpaceLink * CTX_wm_space_data(const bContext *C)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
Main * CTX_data_main(const bContext *C)
ID_Type GS(const char *name)
void BKE_nlatrack_remove_and_free(ListBaseT< NlaTrack > *tracks, NlaTrack *nlt, bool do_id_user)
bool RNA_property_editable(const PointerRNA *ptr, PropertyRNA *prop)
Scene * CTX_data_scene(const bContext *C)
AnimData * ED_actedit_animdata_from_context(const bContext *C, ID **r_adt_id_owner)
Key * BKE_key_from_object(Object *ob)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
static bool action_pushdown_poll(bContext *C)
bool BKE_id_is_editable(const Main *bmain, const ID *id)
ID * BKE_id_copy(Main *bmain, const ID *id)
Object * CTX_data_active_object(const bContext *C)
void ACTION_OT_new(wmOperatorType *ot)
bool BKE_nla_action_stash(OwnedAnimData owned_adt, bool is_liboverride)
static bAction * action_create_new(bContext *C, bAction *oldact)
void id_fake_user_clear(ID *id)
void BKE_nlastrip_remove_and_free(ListBaseT< NlaStrip > *strips, NlaStrip *strip, const bool do_id_user)
ListBaseT< NlaTrack > nla_tracks
ListBaseT< NlaStrip > strips
wmEventModifierFlag modifier
wmOperatorStatus(*) exec(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
bool(*) poll(bContext *C) ATTR_WARN_UNUSED_RESULT
wmOperatorStatus(*) invoke(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports