33 #include "RNA_prototypes.h"
152 TIP_(
"PoseLib blending: \"%s\" at %3.0f%%"),
158 C,
TIP_(
"Tab: show original pose; Horizontal mouse movement: change blend percentage"));
199 const float range = 300 *
U.pixelsize;
204 const float new_factor = (
event->xy[0] - pbd->
area->
v1->
vec.
x) / ((
float)pbd->
area->
winx);
233 switch (event->
type) {
289 bool asset_handle_valid;
335 if (action ==
NULL) {
365 release_confirm_prop);
398 switch (pbd->
state) {
412 BLI_assert_msg(0,
"poselib_blend_cleanup: unexpected pose blend state");
493 return operator_result;
528 bool asset_handle_valid;
533 return (asset_library_ref !=
NULL) && asset_handle_valid &&
552 ot->
name =
"Apply Pose Asset";
553 ot->
idname =
"POSELIB_OT_apply_pose_asset";
570 "Amount that the pose is applied on top of the existing poses",
577 "When enabled, applies the pose flipped over the X-axis");
585 ot->
name =
"Blend Pose Asset";
586 ot->
idname =
"POSELIB_OT_blend_pose_asset";
606 "Amount that the pose is applied on top of the existing poses",
618 "When enabled, applies the pose flipped over the X-axis");
622 "Confirm on Release",
623 "Always confirm operation when releasing button");
Blender kernel action and pose functionality.
struct bPoseChannel * BKE_pose_channel_find_name(const struct bPose *pose, const char *name)
void BKE_action_flip_with_pose(struct bAction *act, struct Object *ob_arm)
struct AnimData * BKE_animdata_from_id(const struct ID *id)
AnimationEvalContext BKE_animsys_eval_context_construct(struct Depsgraph *depsgraph, float eval_time)
#define PBONE_SELECTED(arm, bone)
void BKE_pose_apply_action_blend(struct Object *ob, struct bAction *action, struct AnimationEvalContext *anim_eval_context, float blend_factor)
struct ScrArea * CTX_wm_area(const bContext *C)
struct Scene * CTX_data_scene(const bContext *C)
bool CTX_wm_interface_locked(const bContext *C)
const struct AssetLibraryReference * CTX_wm_asset_library_ref(const bContext *C)
struct wmWindowManager * CTX_wm_manager(const bContext *C)
struct Object * CTX_data_active_object(const bContext *C)
struct AssetHandle CTX_wm_asset_handle(const bContext *C, bool *r_is_valid)
struct Depsgraph * CTX_data_depsgraph_pointer(const bContext *C)
struct Main * CTX_data_main(const bContext *C)
struct wmWindow * CTX_wm_window(const bContext *C)
struct ID * BKE_id_copy_ex(struct Main *bmain, const struct ID *id, struct ID **r_newid, int flag)
bool BKE_id_is_editable(const struct Main *bmain, const struct ID *id)
void BKE_id_free(struct Main *bmain, void *idv)
General operations, lookup, etc. for blender objects.
struct Object * BKE_object_pose_armature_get(struct Object *ob)
void BKE_report(ReportList *reports, eReportType type, const char *message)
#define BLI_assert_msg(a, msg)
#define LISTBASE_FOREACH(type, var, list)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
MINLINE void copy_v2_v2_int(int r[2], const int a[2])
size_t BLI_snprintf(char *__restrict dst, size_t maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
struct Depsgraph Depsgraph
void DEG_id_tag_update(struct ID *id, int flag)
ID_Type ED_asset_handle_get_id_type(const struct AssetHandle *asset)
void ED_asset_temp_id_consumer_free(AssetTempIDConsumer **consumer)
AssetTempIDConsumer * ED_asset_temp_id_consumer_create(const struct AssetHandle *handle)
struct AssetTempIDConsumer AssetTempIDConsumer
struct ID * ED_asset_temp_id_consumer_ensure_local_id(AssetTempIDConsumer *consumer, const struct bContext *C, const struct AssetLibraryReference *asset_library_ref, ID_Type id_type, struct Main *bmain, struct ReportList *reports)
#define ANIM_KS_WHOLE_CHARACTER_ID
void ED_area_status_text(ScrArea *area, const char *str)
void ED_workspace_status_text(struct bContext *C, const char *str)
Read Guarded memory(de)allocation.
const Depsgraph * depsgraph
bool autokeyframe_cfra_can_key(const Scene *scene, ID *id)
int ANIM_apply_keyingset(bContext *C, ListBase *dsources, bAction *act, KeyingSet *ks, short mode, float cfra)
KeyingSet * ANIM_get_keyingset_for_autokeying(const Scene *scene, const char *transformKSName)
void ANIM_relative_keyingset_add_source(ListBase *dsources, ID *id, StructRNA *srna, void *data)
void *(* MEM_callocN)(size_t len, const char *str)
void ED_pose_backup_free(PoseBackup *pbd)
bool ED_pose_backup_is_selection_relevant(const struct PoseBackup *pose_backup)
PoseBackup * ED_pose_backup_create_selected_bones(const Object *ob, const bAction *action)
void ED_pose_backup_restore(const PoseBackup *pbd)
static bool poselib_asset_in_context(bContext *C)
static int poselib_blend_exit(bContext *C, wmOperator *op)
static void poselib_blend_cleanup(bContext *C, wmOperator *op)
static int poselib_blend_modal(bContext *C, wmOperator *op, const wmEvent *event)
static Object * get_poselib_object(bContext *C)
static bool poselib_blend_poll(bContext *C)
static void poselib_blend_cancel(bContext *C, wmOperator *op)
static void poselib_blend_apply(bContext *C, wmOperator *op)
void POSELIB_OT_apply_pose_asset(wmOperatorType *ot)
static void poselib_blend_cursor_update(bContext *C, wmOperator *op)
static void poselib_slide_mouse_update_blendfactor(PoseBlendData *pbd, const wmEvent *event)
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 bAction * poselib_blend_init_get_action(bContext *C, wmOperator *op)
struct PoseBlendData PoseBlendData
static void poselib_blend_free(wmOperator *op)
static bAction * flip_pose(bContext *C, Object *ob, bAction *action)
void POSELIB_OT_blend_pose_asset(wmOperatorType *ot)
static void poselib_blend_set_factor(PoseBlendData *pbd, const float new_factor)
static bool poselib_blend_init_data(bContext *C, wmOperator *op, const wmEvent *event)
static int poselib_blend_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static int poselib_blend_exec(bContext *C, wmOperator *op)
static int poselib_blend_handle_event(bContext *UNUSED(C), wmOperator *op, const wmEvent *event)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
bool RNA_property_boolean_get(PointerRNA *ptr, PropertyRNA *prop)
float RNA_float_get(PointerRNA *ptr, const char *name)
void RNA_float_set(PointerRNA *ptr, const char *name, float value)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_float_factor(StructOrFunctionRNA *cont_, const char *identifier, float default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
AssetTempIDConsumer * temp_id_consumer
struct PoseBlendData::@329 release_confirm_info
char headerstr[UI_MAX_DRAW_STR]
struct PoseBackup * pose_backup
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
int(* modal)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
void(* cancel)(struct bContext *, struct wmOperator *)
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports
void WM_cursor_grab_enable(wmWindow *win, int wrap, bool hide, int bounds[4])
void WM_cursor_grab_disable(wmWindow *win, const int mouse_ungrab_xy[2])
int WM_userdef_event_type_from_keymap_type(int kmitype)
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_set_locked_interface(wmWindowManager *wm, bool lock)
void WM_event_add_mousemove(wmWindow *win)