33#include "RNA_prototypes.hh"
131 if (adt !=
nullptr && adt->
action !=
nullptr &&
140 const bArmature *armature = id_cast<const bArmature *>(ob->
data);
147 auto autokey_pose_bones = [&](
FCurve * ,
const char *bone_name) {
160 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);
275 switch (event->
type) {
311 for (
const PointerRNA &ptr : selected_objects) {
312 Object *
object =
reinterpret_cast<Object *
>(ptr.owner_id);
313 if (!
object || !
object->pose) {
316 selected_pose_objects.
append(
object);
322 if (active_object && active_object->
pose && !selected_pose_objects.
contains(active_object)) {
323 selected_pose_objects.
append(active_object);
325 return selected_pose_objects;
347 "Asset not found: '%s'",
364 "Asset ('%s') is not an action data-block",
365 asset->get_name().c_str());
369 if (
asset->is_online_only()) {
372 "Pose '%s' needs downloading before it can be applied (check context menu)",
373 asset->get_name().c_str());
408 if (selected_pose_objects.
is_empty()) {
415 op->
customdata = pbd = MEM_new<PoseBlendData>(
"PoseLib Preview Data");
418 if (pbd->
act ==
nullptr) {
424 if (pbd->
act->wrap().slots().size() == 0) {
431 (
event && (
event->modifier &
KM_CTRL));
435 const bool is_interactive = (
event !=
nullptr);
441 pbd->
objects = selected_pose_objects;
453 if (is_interactive) {
457 op->
ptr, release_confirm_prop);
496 switch (pbd->
state) {
511 BLI_assert_msg(0,
"poselib_blend_cleanup: unexpected pose blend state");
530 if (pbd ==
nullptr) {
586 status.
item(
IFACE_(
"Show Original Pose"), ICON_EVENT_TAB);
589 status.
item(
IFACE_(
"Show Blended Pose"), ICON_EVENT_TAB);
599 return operator_result;
649 if (selected_pose_objects.
is_empty()) {
665 ot->
name =
"Apply Pose Asset";
666 ot->
idname =
"POSELIB_OT_apply_pose_asset";
667 ot->
description =
"Apply the given Pose Action to the rig";
685 "Amount that the pose is applied on top of the existing poses. A negative "
686 "value will subtract the pose instead of adding it",
693 "When enabled, applies the pose flipped over the X-axis");
703 ot->
name =
"Blend Pose Asset";
704 ot->
idname =
"POSELIB_OT_blend_pose_asset";
705 ot->
description =
"Blend the given Pose Action to the rig";
725 "Amount that the pose is applied on top of the existing poses. A "
726 "negative value will subtract the pose instead of adding it",
738 "When enabled, applies the pose flipped over the X-axis");
744 "Confirm on Release",
745 "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.
General operations, lookup, etc. for blender objects.
Read Blender memory allocation and freeing.
#define BLI_assert_msg(a, msg)
bool contains(const Key &key) const
constexpr bool is_empty() const
bool contains(const T &value) const
void append(const T &value)
void item(std::string text, int icon1, int icon2=0)
void item_bool(std::string text, bool inverted, int icon1, int icon2=0)
bool autokeyframe_cfra_can_key(const Scene *scene, ID *id)
StringRefNull get_rotation_mode_path(eRotationModes rotation_mode)
void pose_apply_action(Span< Object * > objects, Action &pose_action, const AnimationEvalContext *anim_eval_context, float blend_factor)
Vector< RNAPath > get_keyable_id_property_paths(const PointerRNA &ptr)
bool bone_is_selected(const bArmature *armature, const Bone *bone)
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, animrig::slot_handle_t slot_handle, FoundFCurveCallback callback)
AssetTempIDConsumer * temp_id_consumer_create(const asset_system::AssetRepresentation *asset)
void operator_asset_reference_props_register(StructRNA &srna)
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_apply_exec(bContext *C, wmOperator *op)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
bool ED_slider_modal(tSlider *slider, const wmEvent *event)
ScrArea * CTX_wm_area(const bContext *C)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
void ED_slider_init(tSlider *slider, const wmEvent *event)
Depsgraph * CTX_data_depsgraph_pointer(const bContext *C)
static bAction * poselib_action_to_blend(PoseBlendData *pbd)
class asset_system::AssetRepresentation * CTX_wm_asset(const bContext *C)
void BKE_pose_backup_restore(const struct PoseBackup *pbd)
void ED_slider_factor_set(tSlider *slider, float factor)
static void poselib_toggle_flipped(PoseBlendData *pbd)
static void poselib_blend_cleanup(bContext *C, wmOperator *op)
float ED_slider_factor_get(const tSlider *slider)
void WM_cursor_modal_set(wmWindow *win, int val)
static void poselib_blend_free(wmOperator *op)
static bAction * flip_pose(bContext *C, Span< Object * > objects, bAction *action)
static void poselib_blend_apply(bContext *C, wmOperator *op)
wmWindow * CTX_wm_window(const bContext *C)
static wmOperatorStatus poselib_blend_exit(bContext *C, wmOperator *op)
void void void void void BKE_action_flip_with_pose(bAction *act, Span< Object * > objects) ATTR_NONNULL(1)
static wmOperatorStatus poselib_blend_exec(bContext *C, wmOperator *op)
void POSELIB_OT_blend_pose_asset(wmOperatorType *ot)
AnimationEvalContext BKE_animsys_eval_context_construct(Depsgraph *depsgraph, float eval_time) ATTR_WARN_UNUSED_RESULT
tSlider * ED_slider_create(bContext *C)
bool RNA_property_boolean_get(PointerRNA *ptr, PropertyRNA *prop)
void WM_locked_interface_set(wmWindowManager *wm, bool lock)
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)
AnimData * BKE_animdata_from_id(const ID *id)
void ED_slider_allow_increments_set(tSlider *slider, bool value)
void DEG_id_tag_update(ID *id, unsigned int flags)
void BKE_report(ReportList *reports, eReportType type, const char *message)
static bool poselib_blend_poll(bContext *C)
wmWindowManager * CTX_wm_manager(const bContext *C)
static void poselib_keytag_pose(bContext *C, Scene *scene, PoseBlendData *pbd)
static wmOperatorStatus poselib_blend_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void WM_cursor_modal_restore(wmWindow *win)
static Vector< Object * > get_poselib_objects(bContext &C)
bool RNA_struct_property_is_set(PointerRNA *ptr, const char *identifier)
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
void ED_area_status_text(ScrArea *area, const char *str)
static void poselib_tempload_exit(PoseBlendData *pbd)
static void poselib_blend_set_factor(PoseBlendData *pbd, const float new_factor)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
void BKE_id_free(Main *bmain, void *idv)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
void RNA_float_set(PointerRNA *ptr, const char *name, float value)
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
struct PoseBackup * BKE_pose_backup_create_selected_bones(Span< Object * > objects, const struct bAction *action) ATTR_WARN_UNUSED_RESULT
static bool poselib_blend_init_data(bContext *C, wmOperator *op, const wmEvent *event)
void ED_slider_allow_overshoot_set(tSlider *slider, bool lower, bool upper)
static void poselib_blend_cancel(bContext *C, wmOperator *op)
wmEventHandler_Op * WM_event_add_modal_handler(bContext *C, wmOperator *op)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void ED_slider_factor_bounds_set(tSlider *slider, float factor_bound_lower, float factor_bound_upper)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
Main * CTX_data_main(const bContext *C)
void BKE_pose_backup_free(struct PoseBackup *pbd)
static wmOperatorStatus poselib_blend_handle_event(bContext *, wmOperator *op, const wmEvent *event)
void ED_slider_status_get(const tSlider *slider, WorkspaceStatus &status)
static wmOperatorStatus poselib_apply_invoke(bContext *C, wmOperator *op, const wmEvent *event)
Scene * CTX_data_scene(const bContext *C)
static bAction * poselib_blend_init_get_action(bContext *C, wmOperator *op)
static wmOperatorStatus poselib_blend_modal(bContext *C, wmOperator *op, const wmEvent *event)
std::string RNA_string_get(PointerRNA *ptr, const char *name)
ID * BKE_id_copy_ex(Main *bmain, const ID *id, ID **new_id_p, int flag)
bool CTX_data_selected_objects(const bContext *C, Vector< PointerRNA > *list)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
void WM_event_add_mousemove(wmWindow *win)
int WM_userdef_event_type_from_keymap_type(int kmitype)
bool CTX_wm_interface_locked(const bContext *C)
void POSELIB_OT_apply_pose_asset(wmOperatorType *ot)
bool BKE_id_is_editable(const Main *bmain, const ID *id)
static void poselib_backup_posecopy(PoseBlendData *pbd)
Object * CTX_data_active_object(const bContext *C)
void ED_workspace_status_text(bContext *C, const char *str)
float RNA_float_get(PointerRNA *ptr, const char *name)
bPoseChannel * BKE_pose_channel_find_name(const bPose *pose, const char *name)
bool RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop)
void ED_slider_destroy(bContext *C, tSlider *slider)
bool BKE_pose_backup_is_selection_relevant(const struct PoseBackup *pose_backup)
char headerstr[UI_MAX_DRAW_STR]
AssetTempIDConsumer * temp_id_consumer
struct blender::PoseBlendData::@202016276230060133034117207351337027212247257316 release_confirm_info
Vector< Object * > objects
wmOperatorStatus(*) exec(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
void(*) cancel(bContext *C, wmOperator *op)
bool(*) poll(bContext *C) ATTR_WARN_UNUSED_RESULT
wmOperatorStatus(*) invoke(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
wmOperatorStatus(*) modal(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports