107 bool changed =
false;
136 }
while (changed != 0);
249 ot->
name =
"New Pose Library";
285 ot->
name =
"Unlink Pose Library";
322 for (ak = keys.first; ak; ak = ak->next) {
325 for (marker = act->
markers.
first; marker; marker = marker->next) {
326 if (
IS_EQ((
double)marker->frame, (
double)ak->cfra)) {
333 if (marker ==
NULL) {
337 BLI_snprintf(marker->name,
sizeof(marker->name),
"F%d Pose", (
int)ak->cfra);
339 marker->frame = (int)ak->cfra;
347 for (marker = act->
markers.
first; marker; marker = markern) {
348 markern = marker->next;
350 if (marker->flag != -1) {
372 ot->
name =
"Sanitize Pose Library Action";
373 ot->
idname =
"POSELIB_OT_action_sanitize";
374 ot->
description =
"Make action suitable for use as a Pose Library";
450 "POSELIB_OT_pose_add",
458 IFACE_(
"Add New (Current Frame)"),
460 "POSELIB_OT_pose_add",
498 for (marker = act->
markers.
first; marker; marker = marker->next) {
499 if (marker->frame == frame) {
500 BLI_strncpy(marker->name, name,
sizeof(marker->name));
504 if (marker ==
NULL) {
507 BLI_strncpy(marker->name, name,
sizeof(marker->name));
508 marker->frame = frame;
535 ot->
name =
"PoseLib Add Pose";
537 ot->
description =
"Add the current Pose to the active Pose Library";
548 RNA_def_int(
ot->
srna,
"frame", 1, 0, INT_MAX,
"Frame",
"Frame to store pose on", 0, INT_MAX);
574 for (marker = act->markers.first, i = 0; marker; marker = marker->next, i++) {
575 item_tmp.
identifier = item_tmp.name = marker->name;
576 item_tmp.icon = ICON_ARMATURE_DATA;
613 if (marker ==
NULL) {
619 for (fcu = act->
curves.
first; fcu; fcu = fcu->next) {
624 for (i = 0, bezt = fcu->bezt; i < fcu->totvert; i++, bezt++) {
626 if (
IS_EQF(bezt->
vec[1][0], (
float)marker->frame)) {
655 ot->
name =
"PoseLib Remove Pose";
656 ot->
idname =
"POSELIB_OT_pose_remove";
657 ot->
description =
"Remove nth pose from the active Pose Library";
688 if (marker ==
NULL) {
717 if (marker ==
NULL) {
726 BLI_strncpy(marker->name, newname,
sizeof(marker->name));
744 ot->
name =
"PoseLib Rename Pose";
745 ot->
idname =
"POSELIB_OT_pose_rename";
746 ot->
description =
"Rename specified pose from the active Pose Library";
760 ot->
srna,
"name",
"RenamedPose", 64,
"New Pose Name",
"New name for pose");
791 if (marker ==
NULL) {
819 {-1,
"UP", 0,
"Up",
""},
820 {1,
"DOWN", 0,
"Down",
""},
825 ot->
name =
"PoseLib Move Pose";
826 ot->
idname =
"POSELIB_OT_pose_move";
827 ot->
description =
"Move the pose up or down in the active Pose Library";
848 "Direction to move the chosen pose towards");
941 bool selected =
false;
1051 ked.
f1 = ((
float)frame) - 0.5f;
1052 ked.
f2 = ((
float)frame) + 0.5f;
1054 anim_eval_context, frame);
1068 if (!any_bone_selected) {
1172 if (index >= 0 && index <
sizeof(tempstr) - 1) {
1173 memcpy(&tempstr[0], &pld->
searchstr[0], index);
1174 tempstr[index] =
'|';
1175 memcpy(&tempstr[index + 1], &pld->
searchstr[index], (
sizeof(tempstr) - 1) - index);
1186 TIP_(
"PoseLib Previewing Pose: Filter - [%s] | "
1187 "Current Pose - \"%s\""),
1196 TIP_(
"PoseLib Previewing Pose: \"%s\""),
1268 for (ld = ldc; ld && step; ld = ldn, step--) {
1273 for (ld = ldc; ld && step; ld = ldn, step++) {
1295 for (marker = pld->
marker; marker && step; marker =
next, step--) {
1300 for (marker = pld->
marker; marker && step; marker =
next, step++) {
1316 switch (event_type) {
1323 for (i = index; i <=
len; i++) {
1342 for (i = index; i <
len; i++) {
1361 for (i =
len; i > index; i--) {
1386 printf(
"PoseLib: skipping event with type '%s' and val %d\n",
1400 switch (event->
type) {
1450 switch (event->
type) {
1624 if (pose_index == -1) {
1627 else if (pose_index == -2) {
1649 if (pose_index > -2) {
1709 act->active_marker =
BLI_findindex(&act->markers, marker) + 1;
1737 int exit_state = pld->
state;
1833 ot->
name =
"PoseLib Browse Poses";
1834 ot->
idname =
"POSELIB_OT_browse_interactive";
1856 "Index of the pose to apply (-2 for no change to pose, -1 for poselib active pose)",
1869 "Amount that the pose is applied on top of the existing poses",
1878 ot->
name =
"Apply Pose Library Pose";
1879 ot->
idname =
"POSELIB_OT_apply_pose";
1880 ot->
description =
"Apply specified Pose Library pose to the rig";
1898 "Index of the pose to apply (-2 for no change to pose, -1 for poselib active pose)",
typedef float(TangentPoint)[2]
Blender kernel action and pose functionality.
struct bPoseChannel * BKE_pose_channel_find_name(const struct bPose *pose, const char *name)
struct bAction * BKE_action_add(struct Main *bmain, const char name[])
AnimationEvalContext BKE_animsys_eval_context_construct(struct Depsgraph *depsgraph, float eval_time)
void animsys_evaluate_action_group(struct PointerRNA *ptr, struct bAction *act, struct bActionGroup *agrp, const struct AnimationEvalContext *anim_eval_context)
AnimationEvalContext BKE_animsys_eval_context_construct_at(const AnimationEvalContext *anim_eval_context, float eval_time)
struct ScrArea * CTX_wm_area(const bContext *C)
struct Scene * CTX_data_scene(const bContext *C)
struct Object * CTX_data_active_object(const bContext *C)
struct Depsgraph * CTX_data_depsgraph_pointer(const bContext *C)
struct Main * CTX_data_main(const bContext *C)
void IDP_FreeProperty(struct IDProperty *prop)
void IDP_SyncGroupValues(struct IDProperty *dest, const struct IDProperty *src) ATTR_NONNULL()
struct IDProperty * IDP_CopyProperty(const struct IDProperty *prop) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void id_us_min(struct ID *id)
General operations, lookup, etc. for blender objects.
struct Object * BKE_object_pose_armature_get(struct Object *ob)
void BKE_report(ReportList *reports, ReportType type, const char *message)
void BKE_reportf(ReportList *reports, ReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BLI_dlrbTree_init(DLRBT_Tree *tree)
void BLI_dlrbTree_free(DLRBT_Tree *tree)
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
#define LISTBASE_FOREACH(type, var, list)
void BLI_freelinkN(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void void void bool BLI_listbase_link_move(ListBase *listbase, void *vlink, int step) ATTR_NONNULL()
int BLI_findindex(const struct ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
char * BLI_strcasestr(const char *s, const char *find) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
size_t BLI_snprintf(char *__restrict dst, size_t maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, const size_t maxncpy) ATTR_NONNULL()
bool BLI_uniquename(struct ListBase *list, void *vlink, const char *defname, char delim, int name_offset, size_t len)
struct Depsgraph Depsgraph
void DEG_id_tag_update(struct ID *id, int flag)
@ ID_RECALC_COPY_ON_WRITE
#define ID_IS_LINKED(_id)
Object is a sort of wrapper for general info.
short(* KeyframeEditFunc)(KeyframeEditData *ked, struct BezTriple *bezt)
#define IS_AUTOKEY_MODE(scene, mode)
#define ANIM_KS_WHOLE_CHARACTER_ID
#define ANIM_KS_WHOLE_CHARACTER_SELECTED_ID
struct Object * ED_object_context(const struct bContext *C)
bool ED_operator_posemode(struct bContext *C)
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.
void uiLayoutSetOperatorContext(uiLayout *layout, int opcontext)
void uiItemIntO(uiLayout *layout, const char *name, int icon, const char *opname, const char *propname, int value)
struct uiLayout * UI_popup_menu_layout(uiPopupMenu *pup)
void uiItemFullO_ptr(uiLayout *layout, struct wmOperatorType *ot, const char *name, int icon, struct IDProperty *properties, int context, int flag, struct PointerRNA *r_opptr)
void UI_popup_menu_end(struct bContext *C, struct uiPopupMenu *pup)
void uiItemMenuF(uiLayout *layout, const char *name, int icon, uiMenuCreateFunc func, void *arg)
uiPopupMenu * UI_popup_menu_begin(struct bContext *C, const char *title, int icon) ATTR_NONNULL()
const Depsgraph * depsgraph
void action_to_keylist(AnimData *adt, bAction *act, DLRBT_Tree *keys, int saction_flag)
short ANIM_animchanneldata_keyframes_loop(KeyframeEditData *ked, bDopeSheet *ads, void *data, int keytype, KeyframeEditFunc key_ok, KeyframeEditFunc key_cb, FcuEditFunc fcu_cb)
KeyframeEditFunc ANIM_editkeyframes_ok(short mode)
void delete_fcurve_key(FCurve *fcu, int index, bool do_recalc)
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)
KeyingSet * ANIM_builtin_keyingset_get_named(KeyingSet *prevKS, const char name[])
void ANIM_relative_keyingset_add_source(ListBase *dsources, ID *id, StructRNA *srna, void *data)
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
static void area(int d1, int d2, int e1, int e2, float weights[2])
static int poselib_preview_exec(bContext *C, wmOperator *op)
static int poselib_new_exec(bContext *C, wmOperator *UNUSED(op))
static int poselib_rename_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static void poselib_keytag_pose(bContext *C, Scene *scene, tPoseLib_PreviewData *pld)
static int poselib_move_exec(bContext *C, wmOperator *op)
void POSELIB_OT_pose_rename(wmOperatorType *ot)
static bool poselib_add_poll(bContext *C)
static void action_set_activemarker(void *UNUSED(a), void *UNUSED(b), void *UNUSED(c))
void POSELIB_OT_pose_remove(wmOperatorType *ot)
void POSELIB_OT_pose_add(wmOperatorType *ot)
struct tPoseLib_PreviewData tPoseLib_PreviewData
static void poselib_preview_cancel(bContext *C, wmOperator *op)
static Object * get_poselib_object(bContext *C)
static int poselib_preview_exit(bContext *C, wmOperator *op)
static int poselib_sanitize_exec(bContext *C, wmOperator *op)
static bAction * poselib_init_new(Main *bmain, Object *ob)
static void poselib_preview_init_data(bContext *C, wmOperator *op)
static void poselib_add_menu_invoke__replacemenu(bContext *C, uiLayout *layout, void *UNUSED(arg))
static int poselib_add_exec(bContext *C, wmOperator *op)
static int poselib_add_menu_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
@ PL_PREVIEW_REDRAWHEADER
void POSELIB_OT_apply_pose(wmOperatorType *ot)
static bool has_poselib_pose_data_poll(bContext *C)
void POSELIB_OT_new(wmOperatorType *ot)
static void poselib_apply_pose(tPoseLib_PreviewData *pld, const AnimationEvalContext *anim_eval_context)
static int poselib_rename_exec(bContext *C, wmOperator *op)
void POSELIB_OT_unlink(wmOperatorType *ot)
static int poselib_preview_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
static void poselib_preview_handle_search(tPoseLib_PreviewData *pld, ushort event_type, char ascii)
@ PL_PREVIEW_SHOWORIGINAL
@ PL_PREVIEW_ANY_BONE_SELECTED
static int poselib_unlink_exec(bContext *C, wmOperator *UNUSED(op))
void POSELIB_OT_pose_move(wmOperatorType *ot)
static int poselib_get_free_index(bAction *act)
void POSELIB_OT_browse_interactive(wmOperatorType *ot)
static int poselib_preview_modal(bContext *C, wmOperator *op, const wmEvent *event)
static void poselib_preview_apply(bContext *C, wmOperator *op)
void POSELIB_OT_action_sanitize(wmOperatorType *ot)
static int poselib_preview_handle_event(bContext *UNUSED(C), wmOperator *op, const wmEvent *event)
static const EnumPropertyItem * poselib_stored_pose_itemf(bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), bool *r_free)
static void poselib_backup_posecopy(tPoseLib_PreviewData *pld)
static TimeMarker * poselib_get_active_pose(bAction *act)
static bool has_poselib_pose_data_for_editing_poll(bContext *C)
static int poselib_remove_exec(bContext *C, wmOperator *op)
static void poselib_backup_restore(tPoseLib_PreviewData *pld)
static void poselib_backup_free_data(tPoseLib_PreviewData *pld)
struct tPoseLib_Backup tPoseLib_Backup
static bAction * poselib_validate(Main *bmain, Object *ob)
static void poselib_preview_cleanup(bContext *C, wmOperator *op)
static void poselib_preview_get_next(tPoseLib_PreviewData *pld, int step)
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
void RNA_id_pointer_create(ID *id, PointerRNA *r_ptr)
bool RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop)
void RNA_int_set(PointerRNA *ptr, const char *name, int value)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
void RNA_string_get(PointerRNA *ptr, const char *name, char *value)
int RNA_int_get(PointerRNA *ptr, const char *name)
int RNA_property_enum_get(PointerRNA *ptr, PropertyRNA *prop)
void RNA_enum_set(PointerRNA *ptr, const char *name, int value)
int RNA_enum_get(PointerRNA *ptr, const char *name)
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_enum_item_end(EnumPropertyItem **items, int *totitem)
void RNA_enum_item_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item)
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, int maxlen, const char *ui_name, const char *ui_description)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, int default_value, int hardmin, int hardmax, const char *ui_name, const char *ui_description, int softmin, int softmax)
void RNA_def_enum_funcs(PropertyRNA *prop, EnumPropertyItemFunc itemfunc)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
const EnumPropertyItem DummyRNA_NULL_items[]
struct bActionGroup * next
struct tPoseLib_Backup * next
struct tPoseLib_Backup * prev
char headerstr[UI_MAX_DRAW_STR]
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
struct wmOperatorType * type
__forceinline ssef low(const avxf &a)
__forceinline ssef high(const avxf &a)
wmEventHandler_Op * WM_event_add_modal_handler(bContext *C, wmOperator *op)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
const char * WM_key_event_string(const short type, const bool compact)
wmOperatorType * WM_operatortype_find(const char *idname, bool quiet)
int WM_operator_props_popup_confirm(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
int WM_menu_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))