33#include "RNA_prototypes.hh"
129 if (adt !=
nullptr && adt->
action !=
nullptr &&
146 auto autokey_pose_bones = [&](
FCurve * ,
const char *bone_name) {
159 if (keyed_pose_bones.
contains(pchan)) {
167 rna_paths.
append({
"location"});
170 rna_paths.
append({rotation_mode_path});
171 rna_paths.
append({
"scale"});
173 keyed_pose_bones.
add(pchan);
276 switch (event->
type) {
314 if (!
object || !object->
pose) {
317 selected_pose_objects.
append(
object);
323 if (active_object && active_object->
pose && !selected_pose_objects.
contains(active_object)) {
324 selected_pose_objects.
append(active_object);
326 return selected_pose_objects;
348 "Asset not found: '%s'",
365 "Asset ('%s') is not an action data-block",
366 asset->get_name().c_str());
401 if (selected_pose_objects.
is_empty()) {
408 op->
customdata = pbd = MEM_new<PoseBlendData>(
"PoseLib Preview Data");
411 if (pbd->
act ==
nullptr) {
417 if (pbd->
act->wrap().slots().size() == 0) {
424 (
event && (
event->modifier &
KM_CTRL));
428 const bool is_interactive = (
event !=
nullptr);
434 pbd->
objects = selected_pose_objects;
446 if (is_interactive) {
450 op->
ptr, release_confirm_prop);
474 for (
Object *ob : selected_pose_objects) {
501 switch (pbd->
state) {
516 BLI_assert_msg(0,
"poselib_blend_cleanup: unexpected pose blend state");
535 if (pbd ==
nullptr) {
591 status.item(
IFACE_(
"Show Original Pose"), ICON_EVENT_TAB);
594 status.item(
IFACE_(
"Show Blended Pose"), ICON_EVENT_TAB);
604 return operator_result;
654 if (selected_pose_objects.
is_empty()) {
670 ot->name =
"Apply Pose Asset";
671 ot->idname =
"POSELIB_OT_apply_pose_asset";
672 ot->description =
"Apply the given Pose Action to the rig";
690 "Amount that the pose is applied on top of the existing poses. A negative "
691 "value will subtract the pose instead of adding it",
698 "When enabled, applies the pose flipped over the X-axis");
708 ot->name =
"Blend Pose Asset";
709 ot->idname =
"POSELIB_OT_blend_pose_asset";
710 ot->description =
"Blend the given Pose Action to the rig";
730 "Amount that the pose is applied on top of the existing poses. A "
731 "negative value will subtract the pose instead of adding it",
743 "When enabled, applies the pose flipped over the X-axis");
749 "Confirm on Release",
750 "Always confirm operation when releasing button");
Functions and classes to work with Actions.
Functions for backward compatibility with the legacy Action API.
Functions to deal with Armatures.
Functions to insert, delete or modify keyframes.
Functionality to interact with keying sets.
Functions to work with animation poses.
Helper functions for animation to interact with the RNA system.
Main runtime representation of an asset.
Blender kernel action and pose functionality.
void void void void void BKE_action_flip_with_pose(bAction *act, blender::Span< Object * > objects) ATTR_NONNULL(1)
bPoseChannel * BKE_pose_channel_find_name(const bPose *pose, const char *name)
AnimData * BKE_animdata_from_id(const ID *id)
AnimationEvalContext BKE_animsys_eval_context_construct(struct Depsgraph *depsgraph, float eval_time) ATTR_WARN_UNUSED_RESULT
bool CTX_wm_interface_locked(const bContext *C)
ScrArea * CTX_wm_area(const bContext *C)
wmWindow * CTX_wm_window(const bContext *C)
Depsgraph * CTX_data_depsgraph_pointer(const bContext *C)
Object * CTX_data_active_object(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
class blender::asset_system::AssetRepresentation * CTX_wm_asset(const bContext *C)
bool CTX_data_selected_objects(const bContext *C, blender::Vector< PointerRNA > *list)
Main * CTX_data_main(const bContext *C)
wmWindowManager * CTX_wm_manager(const bContext *C)
bool BKE_id_is_editable(const Main *bmain, const ID *id)
void BKE_id_free(Main *bmain, void *idv)
ID * BKE_id_copy_ex(Main *bmain, const ID *id, ID **new_id_p, int flag)
General operations, lookup, etc. for blender objects.
struct PoseBackup * BKE_pose_backup_create_selected_bones(blender::Span< Object * > objects, const struct bAction *action) ATTR_WARN_UNUSED_RESULT
void BKE_pose_backup_restore(const struct PoseBackup *pbd)
bool BKE_pose_backup_is_selection_relevant(const struct PoseBackup *pose_backup)
void BKE_pose_backup_free(struct PoseBackup *pbd)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BKE_report(ReportList *reports, eReportType type, const char *message)
#define BLI_assert_msg(a, msg)
void DEG_id_tag_update(ID *id, unsigned int flags)
void ED_area_status_text(ScrArea *area, const char *str)
void ED_workspace_status_text(bContext *C, const char *str)
void ED_slider_init(tSlider *slider, const wmEvent *event)
void ED_slider_allow_overshoot_set(tSlider *slider, bool lower, bool upper)
void ED_slider_destroy(bContext *C, tSlider *slider)
void ED_slider_allow_increments_set(tSlider *slider, bool value)
tSlider * ED_slider_create(bContext *C)
bool ED_slider_modal(tSlider *slider, const wmEvent *event)
void ED_slider_status_get(const tSlider *slider, WorkspaceStatus &status)
void ED_slider_factor_bounds_set(tSlider *slider, float factor_bound_lower, float factor_bound_upper)
float ED_slider_factor_get(const tSlider *slider)
void ED_slider_factor_set(tSlider *slider, float factor)
Read Guarded memory(de)allocation.
BPy_StructRNA * depsgraph
bool contains(const Key &key) const
constexpr bool is_empty() const
bool contains(const T &value) const
void append(const T &value)
bool autokeyframe_cfra_can_key(const Scene *scene, ID *id)
Vector< RNAPath > get_keyable_id_property_paths(const PointerRNA &ptr)
bool bone_is_selected(const bArmature *armature, const Bone *bone)
void pose_apply_action(blender::Span< Object * > objects, Action &pose_action, const AnimationEvalContext *anim_eval_context, float blend_factor)
StringRef get_rotation_mode_path(eRotationModes rotation_mode)
Slot & get_best_pose_slot_for_id(const ID &id, Action &pose_data)
void autokeyframe_pose_channel(bContext *C, Scene *scene, Object *ob, bPoseChannel *pose_channel, Span< RNAPath > rna_paths, short targetless_ik)
void BKE_action_find_fcurves_with_bones(bAction *action, blender::animrig::slot_handle_t slot_handle, FoundFCurveCallback callback)
void operator_asset_reference_props_register(StructRNA &srna)
AssetTempIDConsumer * temp_id_consumer_create(const blender::asset_system::AssetRepresentation *asset)
const asset_system::AssetRepresentation * operator_asset_reference_props_get_asset_from_all_library(const bContext &C, PointerRNA &ptr, ReportList *reports)
ID * temp_id_consumer_ensure_local_id(AssetTempIDConsumer *consumer, ID_Type id_type, Main *bmain, ReportList *reports)
bool operator_asset_reference_props_is_set(PointerRNA &ptr)
void temp_id_consumer_free(AssetTempIDConsumer **consumer)
static wmOperatorStatus poselib_blend_exit(bContext *C, wmOperator *op)
static wmOperatorStatus poselib_blend_modal(bContext *C, wmOperator *op, const wmEvent *event)
static bAction * poselib_action_to_blend(PoseBlendData *pbd)
static wmOperatorStatus poselib_blend_handle_event(bContext *, wmOperator *op, const wmEvent *event)
static void poselib_blend_cleanup(bContext *C, wmOperator *op)
static bool poselib_blend_poll(bContext *C)
static void poselib_blend_cancel(bContext *C, wmOperator *op)
static wmOperatorStatus poselib_apply_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static void poselib_blend_apply(bContext *C, wmOperator *op)
void POSELIB_OT_apply_pose_asset(wmOperatorType *ot)
static wmOperatorStatus poselib_blend_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static bAction * poselib_blend_init_get_action(bContext *C, wmOperator *op)
static void poselib_tempload_exit(PoseBlendData *pbd)
static void poselib_backup_posecopy(PoseBlendData *pbd)
static void poselib_keytag_pose(bContext *C, Scene *scene, PoseBlendData *pbd)
static wmOperatorStatus poselib_apply_exec(bContext *C, wmOperator *op)
static void poselib_blend_free(wmOperator *op)
void POSELIB_OT_blend_pose_asset(wmOperatorType *ot)
static wmOperatorStatus poselib_blend_exec(bContext *C, wmOperator *op)
static void poselib_blend_set_factor(PoseBlendData *pbd, const float new_factor)
static blender::Vector< Object * > get_poselib_objects(bContext &C)
static bool poselib_blend_init_data(bContext *C, wmOperator *op, const wmEvent *event)
static bAction * flip_pose(bContext *C, blender::Span< Object * > objects, bAction *action)
static void poselib_toggle_flipped(PoseBlendData *pbd)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
bool RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop)
bool RNA_property_boolean_get(PointerRNA *ptr, PropertyRNA *prop)
float RNA_float_get(PointerRNA *ptr, const char *name)
std::string RNA_string_get(PointerRNA *ptr, const char *name)
void RNA_float_set(PointerRNA *ptr, const char *name, float value)
bool RNA_struct_property_is_set(PointerRNA *ptr, const char *identifier)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
PropertyRNA * RNA_def_float_factor(StructOrFunctionRNA *cont_, const char *identifier, const float default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
AssetTempIDConsumer * temp_id_consumer
char headerstr[UI_MAX_DRAW_STR]
blender::Vector< Object * > objects
struct PoseBlendData::@364151073147177316020310160004314352306037157112 release_confirm_info
struct ReportList * reports
void WM_cursor_modal_set(wmWindow *win, int val)
void WM_cursor_modal_restore(wmWindow *win)
int WM_userdef_event_type_from_keymap_type(int kmitype)
void WM_locked_interface_set(wmWindowManager *wm, bool lock)
wmEventHandler_Op * WM_event_add_modal_handler(bContext *C, wmOperator *op)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
void WM_event_add_mousemove(wmWindow *win)