|
Blender V5.0
|
#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_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) |
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) |
Definition at line 111 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().
|
static |
Definition at line 198 of file action_data.cc.
References AnimData::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 150 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_new | ( | wmOperatorType * | ot | ) |
Definition at line 261 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 329 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 373 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 480 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 622 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 304 of file action_data.cc.
References AnimData::action, BKE_nla_action_pushdown(), C, CTX_data_main(), 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 287 of file action_data.cc.
References AnimData::action, ADT_NLA_EDIT_ON, C, 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 438 of file action_data.cc.
References AnimData::action, action_create_new(), blender::animrig::assign_action(), BKE_nla_action_stash(), BKE_report(), BKE_reportf(), C, ED_actedit_animdata_from_context(), ID_IS_OVERRIDE_LIBRARY, ID::name, NC_ANIMATION, ND_NLA_ACTCHANGE, OPERATOR_FINISHED, wmOperator::reports, RPT_ERROR, blender::animrig::unassign_action(), and WM_event_add_notifier().
Referenced by ACTION_OT_stash_and_create().
|
static |
Definition at line 405 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 350 of file action_data.cc.
References BKE_nla_action_stash(), BKE_report(), C, ED_actedit_animdata_from_context(), ID_IS_OVERRIDE_LIBRARY, NC_ANIMATION, ND_NLA_ACTCHANGE, OPERATOR_FINISHED, wmOperator::reports, RPT_ERROR, blender::animrig::unassign_action(), and WM_event_add_notifier().
Referenced by ACTION_OT_stash().
|
static |
Definition at line 598 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 614 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 585 of file action_data.cc.
References AnimData::action, BKE_id_is_editable(), C, CTX_data_main(), and ED_actedit_animdata_from_context().
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 53 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_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 510 of file action_data.cc.
References NlaStrip::act, 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(), 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_discrete(), RNA_property_pointer_set(), RNA_property_update(), RNA_struct_find_property(), RPT_WARNING, SCE_NLA_EDIT_ON, NlaTrack::strips, and ID::us.
Referenced by action_unlink_exec(), and nla_action_unlink_exec().