27 #include "RNA_prototypes.h"
72 *r_adt_id_owner = &ob->
id;
81 *r_adt_id_owner = &key->
id;
223 else if (
ptr.
type == &RNA_SpaceDopeSheetEditor) {
246 if (
ptr.
type == &RNA_SpaceDopeSheetEditor) {
253 printf(
"WARNING: Failed to stash %s. It may already exist in the NLA stack though\n",
307 if (adt && saction->
action) {
361 ot->
name =
"Push Down Action";
363 ot->
description =
"Push action down on to the NLA stack as a new strip";
416 ot->
name =
"Stash Action";
418 ot->
description =
"Store this action in the NLA stack as a non-contributing strip for later use";
432 "Create a new action once the existing one has been safely stored");
524 ot->
name =
"Stash Action";
525 ot->
idname =
"ACTION_OT_stash_and_create";
527 "Store this action in the NLA stack as a non-contributing strip for later use, and create a "
561 if (act->
id.
us == 1) {
564 "Action '%s' will not be saved, create Fake User or Stash in NLA Stack to retain",
580 nlt_next = nlt->
next;
582 if (strstr(nlt->
name,
DATA_(
"[Action Stash]"))) {
583 for (strip = nlt->
strips.
first; strip; strip = nstrip) {
584 nstrip = strip->
next;
586 if (strip->
act == act) {
644 if (saction->
action && adt) {
681 ot->
name =
"Unlink Action";
683 ot->
description =
"Unlink this action from the active action slot (and/or exit Tweak Mode)";
695 "Clear Fake User and remove "
696 "copy stashed in this data-block's NLA stack");
711 for (strip = strips->
first; strip; strip = strip->
next) {
717 if ((ctime < strip->start) && (strip->
prev ==
NULL)) {
721 if ((ctime > strip->
end) && (strip->
next ==
NULL)) {
826 if (act_track ==
NULL) {
832 if (act_track->
next) {
836 for (nlt = act_track->
next; nlt; nlt = nlt->
next) {
876 ot->
idname =
"ACTION_OT_layer_next";
878 "Switch to editing action in animation layer above the current action in the NLA Stack";
938 op->
reports,
RPT_ERROR,
"Internal Error: Could not find Animation Data/NLA Stack to use");
948 nlt = act_track->
prev;
956 for (; nlt; nlt = nlt->
prev) {
974 ot->
name =
"Previous Layer";
975 ot->
idname =
"ACTION_OT_layer_prev";
977 "Switch to editing action in animation layer below the current action in the NLA Stack";
Blender kernel action and pose functionality.
bool action_has_motion(const struct bAction *act)
struct bAction * BKE_action_add(struct Main *bmain, const char name[])
struct ScrArea * CTX_wm_area(const bContext *C)
struct Scene * CTX_data_scene(const bContext *C)
struct Object * CTX_data_active_object(const bContext *C)
struct bScreen * CTX_wm_screen(const bContext *C)
struct SpaceLink * CTX_wm_space_data(const bContext *C)
struct Main * CTX_data_main(const bContext *C)
struct Key * BKE_key_from_object(struct Object *ob)
struct ID * BKE_id_copy(struct Main *bmain, const struct ID *id)
void id_us_min(struct ID *id)
void id_fake_user_clear(struct ID *id)
void BKE_nla_action_pushdown(struct AnimData *adt, bool is_liboverride)
bool BKE_nla_action_stash(struct AnimData *adt, bool is_liboverride)
bool BKE_nla_tweakmode_enter(struct AnimData *adt)
void BKE_nla_tweakmode_exit(struct AnimData *adt)
void BKE_nlastrip_free(ListBase *strips, struct NlaStrip *strip, bool do_id_user)
struct NlaTrack * BKE_nlatrack_find_tweaked(struct AnimData *adt)
void BKE_nlatrack_free(ListBase *tracks, struct 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 struct Scene *scene)
#define IN_RANGE_INCL(a, b, c)
void DEG_id_tag_update_ex(struct Main *bmain, struct ID *id, int flag)
#define ID_IS_OVERRIDE_LIBRARY(_id)
Object is a sort of wrapper for general info.
bool ED_operator_nla_active(struct bContext *C)
bool ED_operator_action_active(struct bContext *C)
void UI_context_active_but_prop_get_templateID(struct bContext *C, struct PointerRNA *r_ptr, struct PropertyRNA **r_prop)
static bool action_unlink_poll(bContext *C)
void ACTION_OT_layer_prev(wmOperatorType *ot)
void ACTION_OT_push_down(wmOperatorType *ot)
static bool action_new_poll(bContext *C)
static void actedit_change_action(bContext *C, bAction *act)
static bAction * action_create_new(bContext *C, bAction *oldact)
static int action_stash_exec(bContext *C, wmOperator *op)
void ACTION_OT_unlink(wmOperatorType *ot)
static bool action_layer_prev_poll(bContext *C)
AnimData * ED_actedit_animdata_from_context(const bContext *C, ID **r_adt_id_owner)
static bool action_stash_create_poll(bContext *C)
static int action_new_exec(bContext *C, wmOperator *UNUSED(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 int action_layer_next_exec(bContext *C, wmOperator *op)
void ACTION_OT_stash(wmOperatorType *ot)
static void action_layer_switch_strip(AnimData *adt, NlaTrack *old_track, NlaStrip *old_strip, NlaTrack *nlt, NlaStrip *strip)
static int action_unlink_exec(bContext *C, wmOperator *op)
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 NlaStrip * action_layer_get_nlastrip(ListBase *strips, float ctime)
static int action_unlink_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static void area(int d1, int d2, int e1, int e2, float weights[2])
void RNA_pointer_create(ID *id, StructRNA *type, void *data, PointerRNA *r_ptr)
void RNA_id_pointer_create(ID *id, PointerRNA *r_ptr)
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)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
void RNA_property_update(bContext *C, PointerRNA *ptr, PropertyRNA *prop)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports
void WM_main_add_notifier(unsigned int type, void *reference)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)