|
Blender V4.3
|
#include <cfloat>#include <cmath>#include <cstdlib>#include <cstring>#include "BLI_utildefines.h"#include "BLT_translation.hh"#include "DNA_anim_types.h"#include "DNA_key_types.h"#include "DNA_object_types.h"#include "DNA_scene_types.h"#include "RNA_access.hh"#include "RNA_define.hh"#include "RNA_prototypes.hh"#include "BKE_action.hh"#include "BKE_context.hh"#include "BKE_key.hh"#include "BKE_lib_id.hh"#include "BKE_nla.hh"#include "BKE_report.hh"#include "BKE_scene.hh"#include "ANIM_action.hh"#include "ED_anim_api.hh"#include "ED_screen.hh"#include "DEG_depsgraph.hh"#include "WM_api.hh"#include "WM_types.hh"#include "UI_interface.hh"#include "UI_interface_c.hh"#include "action_intern.hh"Go to the source code of this file.
Functions | |
Utilities | |
| AnimData * | ED_actedit_animdata_from_context (const bContext *C, ID **r_adt_id_owner) |
Create New Action | |
| static bAction * | action_create_new (bContext *C, bAction *oldact) |
| static void | actedit_change_action (bContext *C, bAction *act) |
New Action Operator | |
Criteria: 1) There must be an dope-sheet/action editor, and it must be in a mode which uses actions... OR The NLA Editor is active (i.e. Animation Data panel -> new action) 2) The associated AnimData block must not be in tweak-mode. | |
| static bool | action_new_poll (bContext *C) |
| static int | action_new_exec (bContext *C, wmOperator *) |
| void | ACTION_OT_new (wmOperatorType *ot) |
Action Push-Down Operator | |
Criteria: 1) There must be an dope-sheet/action editor, and it must be in a mode which uses actions. 2) There must be an action active. 3) The associated AnimData block must not be in tweak-mode. | |
| static bool | action_pushdown_poll (bContext *C) |
| static int | action_pushdown_exec (bContext *C, wmOperator *op) |
| void | ACTION_OT_push_down (wmOperatorType *ot) |
Action Stash Operator | |
| static int | action_stash_exec (bContext *C, wmOperator *op) |
| void | ACTION_OT_stash (wmOperatorType *ot) |
Action Stash & Create Operator | |
Criteria: 1) There must be an dope-sheet/action editor, and it must be in a mode which uses actions. 2) The associated AnimData block must not be in tweak-mode. | |
| static bool | action_stash_create_poll (bContext *C) |
| static int | action_stash_create_exec (bContext *C, wmOperator *op) |
| void | ACTION_OT_stash_and_create (wmOperatorType *ot) |
Action Unlink Operator | |
We use a custom unlink operator here, as there are some technicalities which need special care: 1) When in Tweak Mode, it shouldn't be possible to unlink the active action, or else, everything turns to custard. 2) If the Action doesn't have any other users, the user should at least get a warning that it is going to get lost. 3) We need a convenient way to exit Tweak Mode from the Action Editor | |
| void | ED_animedit_unlink_action (bContext *C, ID *id, AnimData *adt, bAction *act, ReportList *reports, bool force_delete) |
| static bool | action_unlink_poll (bContext *C) |
| static int | action_unlink_exec (bContext *C, wmOperator *op) |
| static int | action_unlink_invoke (bContext *C, wmOperator *op, const wmEvent *event) |
| void | ACTION_OT_unlink (wmOperatorType *ot) |
Action Browsing | |
| static NlaStrip * | action_layer_get_nlastrip (ListBase *strips, float ctime) |
| static void | action_layer_switch_strip (const OwnedAnimData owned_adt, NlaTrack *old_track, NlaStrip *old_strip, NlaTrack *nlt, NlaStrip *strip) |
One Layer Up Operator | |
| static bool | action_layer_next_poll (bContext *C) |
| static int | action_layer_next_exec (bContext *C, wmOperator *op) |
| void | ACTION_OT_layer_next (wmOperatorType *ot) |
One Layer Down Operator | |
| static bool | action_layer_prev_poll (bContext *C) |
| static int | action_layer_prev_exec (bContext *C, wmOperator *op) |
| void | ACTION_OT_layer_prev (wmOperatorType *ot) |
Definition at line 153 of file action_data.cc.
References CTX_wm_screen(), CTX_wm_space_data(), ptr, RNA_id_pointer_create(), RNA_pointer_create(), RNA_property_pointer_set(), RNA_property_update(), and RNA_struct_find_property().
Referenced by action_layer_next_exec(), action_layer_prev_exec(), action_stash_create_exec(), action_stash_exec(), and ED_animedit_unlink_action().
Definition at line 112 of file action_data.cc.
References BKE_action_add(), BKE_id_copy(), BLI_assert, CTX_data_main(), CTX_wm_area(), GS, bAction::id, ID_AC, ID_KE, ID_OB, id_us_min(), bAction::idroot, SpaceAction::mode, ID::name, SACTCONT_SHAPEKEY, SPACE_ACTION, and ID::us.
Referenced by action_new_exec(), and action_stash_create_exec().
Definition at line 771 of file action_data.cc.
References IN_RANGE_INCL, and LISTBASE_FOREACH.
Referenced by action_layer_next_exec(), and action_layer_prev_exec().
|
static |
Definition at line 886 of file action_data.cc.
References actedit_change_action(), AnimData::action, action_layer_get_nlastrip(), action_layer_switch_strip(), AnimData::actstrip, ADT_NLA_EVAL_OFF, ADT_NLA_SOLO_TRACK, BKE_nla_tweakmode_exit(), BKE_nlatrack_find_tweaked(), BKE_report(), BKE_scene_ctime_get(), CTX_data_scene(), ED_actedit_animdata_from_context(), AnimData::flag, NlaTrack::flag, NlaTrack::next, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::reports, RPT_ERROR, and NlaTrack::strips.
Referenced by ACTION_OT_layer_next().
|
static |
Definition at line 850 of file action_data.cc.
References ADT_NLA_EDIT_ON, ED_actedit_animdata_from_context(), ED_operator_action_active(), AnimData::flag, NlaTrack::flag, ListBase::last, AnimData::nla_tracks, and NLATRACK_DISABLED.
Referenced by ACTION_OT_layer_next().
|
static |
Definition at line 1002 of file action_data.cc.
References actedit_change_action(), AnimData::action, action_layer_get_nlastrip(), action_layer_switch_strip(), AnimData::actstrip, BKE_nlatrack_find_tweaked(), BKE_report(), BKE_scene_ctime_get(), CTX_data_scene(), ED_actedit_animdata_from_context(), ListBase::last, AnimData::nla_tracks, OPERATOR_CANCELLED, OPERATOR_FINISHED, NlaTrack::prev, wmOperator::reports, RPT_ERROR, and NlaTrack::strips.
Referenced by ACTION_OT_layer_prev().
|
static |
Definition at line 966 of file action_data.cc.
References ADT_NLA_EDIT_ON, ED_actedit_animdata_from_context(), ED_operator_action_active(), ListBase::first, AnimData::flag, NlaTrack::flag, AnimData::nla_tracks, and NLATRACK_DISABLED.
Referenced by ACTION_OT_layer_prev().
|
static |
Definition at line 794 of file action_data.cc.
References AnimData::actstrip, OwnedAnimData::adt, ADT_NLA_EVAL_OFF, ADT_NLA_SOLO_TRACK, BKE_nla_tweakmode_enter(), BKE_nla_tweakmode_exit(), BLI_assert, AnimData::flag, NlaStrip::flag, NlaTrack::flag, NLASTRIP_FLAG_ACTIVE, NLASTRIP_FLAG_SELECT, NLATRACK_ACTIVE, NLATRACK_SELECTED, and NLATRACK_SOLO.
Referenced by action_layer_next_exec(), and action_layer_prev_exec().
|
static |
Definition at line 232 of file action_data.cc.
References AnimData::action, SpaceAction::action, action_create_new(), BKE_nla_action_stash(), BLI_assert, PointerRNA::data, ED_actedit_animdata_from_context(), bAction::id, ID_IS_OVERRIDE_LIBRARY, NA_ADDED, ID::name, NC_ANIMATION, ND_KEYFRAME, OPERATOR_FINISHED, PointerRNA::owner_id, printf, ptr, RNA_id_pointer_create(), RNA_property_pointer_get(), RNA_property_pointer_set(), RNA_property_update(), PointerRNA::type, UI_context_active_but_prop_get_templateID(), and WM_event_add_notifier().
Referenced by ACTION_OT_new().
|
static |
Definition at line 184 of file action_data.cc.
References Key::adt, Object::adt, ADT_NLA_EDIT_ON, BKE_key_from_object(), CTX_data_active_object(), CTX_data_scene(), CTX_wm_space_data(), ED_operator_action_active(), ED_operator_nla_active(), AnimData::flag, SpaceAction::mode, ptr, RNA_property_editable(), SACTCONT_ACTION, SACTCONT_SHAPEKEY, SCE_NLA_EDIT_ON, and UI_context_active_but_prop_get_templateID().
Referenced by ACTION_OT_new().
| void ACTION_OT_layer_next | ( | wmOperatorType * | ot | ) |
Definition at line 944 of file action_data.cc.
References action_layer_next_exec(), action_layer_next_poll(), wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, and wmOperatorType::poll.
Referenced by action_operatortypes().
| void ACTION_OT_layer_prev | ( | wmOperatorType * | ot | ) |
Definition at line 1048 of file action_data.cc.
References action_layer_prev_exec(), action_layer_prev_poll(), wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, and wmOperatorType::poll.
Referenced by action_operatortypes().
| void ACTION_OT_new | ( | wmOperatorType * | ot | ) |
Definition at line 310 of file action_data.cc.
References action_new_exec(), action_new_poll(), wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, and wmOperatorType::poll.
Referenced by action_operatortypes().
| void ACTION_OT_push_down | ( | wmOperatorType * | ot | ) |
Definition at line 394 of file action_data.cc.
References action_pushdown_exec(), action_pushdown_poll(), wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, and wmOperatorType::poll.
Referenced by action_operatortypes().
| void ACTION_OT_stash | ( | wmOperatorType * | ot | ) |
Definition at line 453 of file action_data.cc.
References action_pushdown_poll(), action_stash_exec(), wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, wmOperatorType::prop, RNA_def_boolean(), and wmOperatorType::srna.
Referenced by action_operatortypes().
| void ACTION_OT_stash_and_create | ( | wmOperatorType * | ot | ) |
Definition at line 566 of file action_data.cc.
References action_stash_create_exec(), action_stash_create_poll(), wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, and wmOperatorType::poll.
Referenced by action_operatortypes().
| void ACTION_OT_unlink | ( | wmOperatorType * | ot | ) |
Definition at line 737 of file action_data.cc.
References action_unlink_exec(), action_unlink_invoke(), action_unlink_poll(), wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, PROP_SKIP_SAVE, RNA_def_boolean(), RNA_def_property_flag(), and wmOperatorType::srna.
Referenced by action_operatortypes().
|
static |
Definition at line 355 of file action_data.cc.
References AnimData::action, SpaceAction::action, BKE_nla_action_pushdown(), BKE_report(), CTX_data_main(), CTX_wm_space_data(), DEG_id_tag_update_ex(), ED_actedit_animdata_from_context(), blender::animrig::Action::has_keyframes(), bAction::id, ID_IS_OVERRIDE_LIBRARY, ID_RECALC_ANIMATION, NC_ANIMATION, ND_NLA_ACTCHANGE, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::reports, RPT_WARNING, AnimData::slot_handle, and WM_event_add_notifier().
Referenced by ACTION_OT_push_down().
|
static |
Definition at line 336 of file action_data.cc.
References SpaceAction::action, ADT_NLA_EDIT_ON, CTX_wm_space_data(), ED_actedit_animdata_from_context(), ED_operator_action_active(), and AnimData::flag.
Referenced by ACTION_OT_push_down(), and ACTION_OT_stash().
|
static |
Definition at line 518 of file action_data.cc.
References actedit_change_action(), AnimData::action, SpaceAction::action, action_create_new(), BKE_nla_action_stash(), BKE_report(), CTX_wm_space_data(), ED_actedit_animdata_from_context(), ID_IS_OVERRIDE_LIBRARY, NC_ANIMATION, ND_NLA_ACTCHANGE, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::reports, RPT_ERROR, RPT_WARNING, AnimData::slot_handle, and WM_event_add_notifier().
Referenced by ACTION_OT_stash_and_create().
|
static |
Definition at line 485 of file action_data.cc.
References ADT_NLA_EDIT_ON, CTX_data_scene(), CTX_wm_space_data(), ED_actedit_animdata_from_context(), ED_operator_action_active(), ELEM, AnimData::flag, SpaceAction::mode, SACTCONT_ACTION, SACTCONT_SHAPEKEY, and SCE_NLA_EDIT_ON.
Referenced by ACTION_OT_stash_and_create().
|
static |
Definition at line 415 of file action_data.cc.
References actedit_change_action(), AnimData::action, SpaceAction::action, BKE_nla_action_stash(), BKE_report(), CTX_wm_space_data(), ED_actedit_animdata_from_context(), ID_IS_OVERRIDE_LIBRARY, NC_ANIMATION, ND_NLA_ACTCHANGE, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::reports, RPT_ERROR, RPT_WARNING, AnimData::slot_handle, and WM_event_add_notifier().
Referenced by ACTION_OT_stash().
|
static |
Definition at line 713 of file action_data.cc.
References AnimData::action, ED_actedit_animdata_from_context(), ED_animedit_unlink_action(), NC_ANIMATION, ND_NLA_ACTCHANGE, OPERATOR_FINISHED, wmOperator::ptr, wmOperator::reports, RNA_boolean_get(), and WM_main_add_notifier().
Referenced by ACTION_OT_unlink(), and action_unlink_invoke().
|
static |
Definition at line 729 of file action_data.cc.
References action_unlink_exec(), KM_SHIFT, wmEvent::modifier, wmOperator::ptr, and RNA_boolean_set().
Referenced by ACTION_OT_unlink().
|
static |
Definition at line 683 of file action_data.cc.
References AnimData::action, SpaceAction::action, BKE_id_is_editable(), CTX_data_main(), CTX_wm_space_data(), ED_actedit_animdata_from_context(), and ED_operator_action_active().
Referenced by ACTION_OT_unlink().
Action Editor - Action Management. Helper function to find the active AnimData block from the Action Editor context.
Definition at line 54 of file action_data.cc.
References Key::adt, Object::adt, BKE_key_from_object(), CTX_data_active_object(), CTX_wm_space_data(), PointerRNA::data, Key::id, Object::id, SpaceAction::mode, PointerRNA::owner_id, ptr, RNA_property_editable(), SACTCONT_ACTION, SACTCONT_SHAPEKEY, SPACE_ACTION, SpaceLink::spacetype, PointerRNA::type, and UI_context_active_but_prop_get_templateID().
Referenced by action_layer_next_exec(), action_layer_next_poll(), action_layer_prev_exec(), action_layer_prev_poll(), action_main_region_draw(), action_new_exec(), action_pushdown_exec(), action_pushdown_poll(), action_stash_create_exec(), action_stash_create_poll(), action_stash_exec(), action_unlink_exec(), and action_unlink_poll().
| void ED_animedit_unlink_action | ( | bContext * | C, |
| ID * | id, | ||
| AnimData * | adt, | ||
| bAction * | act, | ||
| ReportList * | reports, | ||
| bool | force_delete ) |
Definition at line 596 of file action_data.cc.
References NlaStrip::act, actedit_change_action(), ADT_NLA_EDIT_ON, BKE_nla_tweakmode_exit(), BKE_nlastrip_remove_and_free(), BKE_nlatrack_remove_and_free(), BKE_reportf(), BLI_assert, CTX_data_scene(), CTX_wm_area(), DATA_, ListBase::first, AnimData::flag, bAction::id, id_fake_user_clear(), ID::name, NlaTrack::name, NlaStrip::next, NlaTrack::next, AnimData::nla_tracks, PointerRNA_NULL, ptr, RNA_pointer_create(), RNA_property_pointer_set(), RNA_property_update(), RNA_struct_find_property(), RPT_WARNING, SPACE_ACTION, NlaTrack::strips, and ID::us.
Referenced by action_unlink_exec(), and nla_action_unlink_exec().