|
Blender V4.5
|
#include <cfloat>#include <cstdlib>#include <cstring>#include "BLI_listbase.h"#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 wmOperatorStatus | 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 wmOperatorStatus | action_pushdown_exec (bContext *C, wmOperator *) |
| void | ACTION_OT_push_down (wmOperatorType *ot) |
Action Stash Operator | |
| static wmOperatorStatus | 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 wmOperatorStatus | 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 wmOperatorStatus | action_unlink_exec (bContext *C, wmOperator *op) |
| static wmOperatorStatus | 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 wmOperatorStatus | 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 wmOperatorStatus | action_layer_prev_exec (bContext *C, wmOperator *op) |
| void | ACTION_OT_layer_prev (wmOperatorType *ot) |
Definition at line 140 of file action_data.cc.
References C, CTX_wm_screen(), CTX_wm_space_data(), bScreen::id, ptr, RNA_id_pointer_create(), RNA_pointer_create_discrete(), 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, C, CTX_data_main(), DATA_, GS, bAction::id, ID_AC, id_us_min(), ID::name, and ID::us.
Referenced by action_new_exec(), and action_stash_create_exec().
Definition at line 730 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 845 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(), C, CTX_data_scene(), ED_actedit_animdata_from_context(), AnimData::flag, NlaTrack::flag, NlaTrack::next, NLATRACK_SOLO, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::reports, RPT_ERROR, and NlaTrack::strips.
Referenced by ACTION_OT_layer_next().
|
static |
Definition at line 809 of file action_data.cc.
References ADT_NLA_EDIT_ON, C, 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 961 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(), C, 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 925 of file action_data.cc.
References ADT_NLA_EDIT_ON, C, 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 753 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 219 of file action_data.cc.
References AnimData::action, SpaceAction::action, action_create_new(), BKE_nla_action_stash(), BLI_assert, C, 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(), UI_context_active_but_prop_get_templateID(), and WM_event_add_notifier().
Referenced by ACTION_OT_new().
|
static |
Definition at line 171 of file action_data.cc.
References Key::adt, Object::adt, ADT_NLA_EDIT_ON, BKE_key_from_object(), C, CTX_data_active_object(), CTX_data_scene(), CTX_wm_space_data(), ED_operator_action_active(), ED_operator_nla_active(), AnimData::flag, Scene::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 903 of file action_data.cc.
References action_layer_next_exec(), action_layer_next_poll(), OPTYPE_REGISTER, OPTYPE_UNDO, and ot.
Referenced by action_operatortypes().
| void ACTION_OT_layer_prev | ( | wmOperatorType * | ot | ) |
Definition at line 1007 of file action_data.cc.
References action_layer_prev_exec(), action_layer_prev_poll(), OPTYPE_REGISTER, OPTYPE_UNDO, and ot.
Referenced by action_operatortypes().
| void ACTION_OT_new | ( | wmOperatorType * | ot | ) |
Definition at line 297 of file action_data.cc.
References action_new_exec(), action_new_poll(), OPTYPE_REGISTER, OPTYPE_UNDO, and ot.
Referenced by action_operatortypes().
| void ACTION_OT_push_down | ( | wmOperatorType * | ot | ) |
Definition at line 373 of file action_data.cc.
References action_pushdown_exec(), action_pushdown_poll(), OPTYPE_REGISTER, OPTYPE_UNDO, and ot.
Referenced by action_operatortypes().
| void ACTION_OT_stash | ( | wmOperatorType * | ot | ) |
Definition at line 425 of file action_data.cc.
References action_pushdown_poll(), action_stash_exec(), OPTYPE_REGISTER, OPTYPE_UNDO, ot, and RNA_def_boolean().
Referenced by action_operatortypes().
| void ACTION_OT_stash_and_create | ( | wmOperatorType * | ot | ) |
Definition at line 531 of file action_data.cc.
References action_stash_create_exec(), action_stash_create_poll(), OPTYPE_REGISTER, OPTYPE_UNDO, and ot.
Referenced by action_operatortypes().
| void ACTION_OT_unlink | ( | wmOperatorType * | ot | ) |
Definition at line 696 of file action_data.cc.
References action_unlink_exec(), action_unlink_invoke(), action_unlink_poll(), OPTYPE_REGISTER, OPTYPE_UNDO, ot, PROP_SKIP_SAVE, RNA_def_boolean(), and RNA_def_property_flag().
Referenced by action_operatortypes().
|
static |
Definition at line 342 of file action_data.cc.
References AnimData::action, SpaceAction::action, BKE_nla_action_pushdown(), C, CTX_data_main(), CTX_wm_space_data(), DEG_id_tag_update_ex(), ED_actedit_animdata_from_context(), bAction::id, ID_IS_OVERRIDE_LIBRARY, ID_RECALC_ANIMATION, NC_ANIMATION, ND_NLA_ACTCHANGE, OPERATOR_FINISHED, and WM_event_add_notifier().
Referenced by ACTION_OT_push_down().
|
static |
Definition at line 323 of file action_data.cc.
References SpaceAction::action, ADT_NLA_EDIT_ON, C, 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 490 of file action_data.cc.
References actedit_change_action(), SpaceAction::action, action_create_new(), BKE_nla_action_stash(), BKE_report(), C, CTX_wm_space_data(), ED_actedit_animdata_from_context(), ID_IS_OVERRIDE_LIBRARY, NC_ANIMATION, ND_NLA_ACTCHANGE, OPERATOR_FINISHED, wmOperator::reports, RPT_ERROR, and WM_event_add_notifier().
Referenced by ACTION_OT_stash_and_create().
|
static |
Definition at line 457 of file action_data.cc.
References ADT_NLA_EDIT_ON, C, CTX_data_scene(), CTX_wm_space_data(), ED_actedit_animdata_from_context(), ED_operator_action_active(), ELEM, AnimData::flag, Scene::flag, SpaceAction::mode, SACTCONT_ACTION, SACTCONT_SHAPEKEY, and SCE_NLA_EDIT_ON.
Referenced by ACTION_OT_stash_and_create().
|
static |
Definition at line 394 of file action_data.cc.
References actedit_change_action(), SpaceAction::action, BKE_nla_action_stash(), BKE_report(), C, CTX_wm_space_data(), ED_actedit_animdata_from_context(), ID_IS_OVERRIDE_LIBRARY, NC_ANIMATION, ND_NLA_ACTCHANGE, OPERATOR_FINISHED, wmOperator::reports, RPT_ERROR, and WM_event_add_notifier().
Referenced by ACTION_OT_stash().
|
static |
Definition at line 672 of file action_data.cc.
References AnimData::action, C, 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 688 of file action_data.cc.
References action_unlink_exec(), C, KM_SHIFT, wmEvent::modifier, wmOperator::ptr, and RNA_boolean_set().
Referenced by ACTION_OT_unlink().
|
static |
Definition at line 642 of file action_data.cc.
References AnimData::action, SpaceAction::action, BKE_id_is_editable(), C, 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(), C, CTX_data_active_object(), CTX_wm_space_data(), Key::id, Object::id, SpaceAction::mode, ptr, RNA_property_editable(), SACTCONT_ACTION, SACTCONT_SHAPEKEY, SPACE_ACTION, SpaceLink::spacetype, 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 561 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, C, 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, reports, RNA_pointer_create_discrete(), RNA_property_pointer_set(), RNA_property_update(), RNA_struct_find_property(), RPT_WARNING, SCE_NLA_EDIT_ON, SPACE_ACTION, ScrArea::spacetype, NlaTrack::strips, and ID::us.
Referenced by action_unlink_exec(), and nla_action_unlink_exec().