41 #include "RNA_prototypes.h"
122 }
while (changed != 0);
235 ot->
name =
"New Legacy Pose Library";
238 "Deprecated, will be removed in Blender 3.3. "
239 "Add New Legacy Pose Library to active Object";
273 ot->
name =
"Unlink Legacy Pose Library";
276 "Deprecated, will be removed in Blender 3.3. "
277 "Remove Legacy Pose Library from active Object";
313 for (marker = act->
markers.
first; marker; marker = marker->next) {
314 if (
IS_EQ((
double)marker->frame, (
double)ak->cfra)) {
321 if (marker ==
NULL) {
325 BLI_snprintf(marker->name,
sizeof(marker->name),
"F%d Pose", (
int)ak->cfra);
327 marker->frame = (int)ak->cfra;
335 for (marker = act->
markers.
first; marker; marker = markern) {
336 markern = marker->next;
338 if (marker->flag != -1) {
360 ot->
name =
"Sanitize Legacy Pose Library Action";
361 ot->
idname =
"POSELIB_OT_action_sanitize";
363 "Deprecated, will be removed in Blender 3.3. "
364 "Make action suitable for use as a Legacy Pose Library";
440 "POSELIB_OT_pose_add",
448 IFACE_(
"Add New (Current Frame)"),
450 "POSELIB_OT_pose_add",
488 for (marker = act->
markers.
first; marker; marker = marker->next) {
489 if (marker->frame == frame) {
490 BLI_strncpy(marker->name, name,
sizeof(marker->name));
494 if (marker ==
NULL) {
497 BLI_strncpy(marker->name, name,
sizeof(marker->name));
498 marker->frame = frame;
525 ot->
name =
"Legacy PoseLib Add Pose";
528 "Deprecated, will be removed in Blender 3.3. "
529 "Add the current Pose to the active Legacy Pose Library";
540 RNA_def_int(
ot->
srna,
"frame", 1, 0, INT_MAX,
"Frame",
"Frame to store pose on", 0, INT_MAX);
566 for (marker = act->markers.first, i = 0; marker; marker = marker->next, i++) {
567 item_tmp.
identifier = item_tmp.name = marker->name;
568 item_tmp.icon = ICON_ARMATURE_DATA;
605 if (marker ==
NULL) {
611 for (fcu = act->
curves.
first; fcu; fcu = fcu->next) {
616 for (i = 0, bezt = fcu->bezt; i < fcu->totvert; i++, bezt++) {
618 if (
IS_EQF(bezt->
vec[1][0], (
float)marker->frame)) {
648 ot->
name =
"Legacy PoseLib Remove Pose";
649 ot->
idname =
"POSELIB_OT_pose_remove";
651 "Deprecated, will be removed in Blender 3.3. "
652 "Remove nth pose from the active Legacy Pose Library";
683 if (marker ==
NULL) {
712 if (marker ==
NULL) {
721 BLI_strncpy(marker->name, newname,
sizeof(marker->name));
739 ot->
name =
"Legacy PoseLib Rename Pose";
740 ot->
idname =
"POSELIB_OT_pose_rename";
742 "Deprecated, will be removed in Blender 3.3. "
743 "Rename specified pose from the active Legacy Pose Library";
757 ot->
srna,
"name",
"RenamedPose", 64,
"New Pose Name",
"New name for pose");
788 if (marker ==
NULL) {
816 {-1,
"UP", 0,
"Up",
""},
817 {1,
"DOWN", 0,
"Down",
""},
822 ot->
name =
"Legacy PoseLib Move Pose";
823 ot->
idname =
"POSELIB_OT_pose_move";
825 "Deprecated, will be removed in Blender 3.3. "
826 "Move the pose up or down in the active Legacy Pose Library";
847 "Direction to move the chosen pose towards");
940 bool selected =
false;
1050 ked.
f1 = ((
float)frame) - 0.5f;
1051 ked.
f2 = ((
float)frame) + 0.5f;
1053 anim_eval_context, frame);
1067 if (!any_bone_selected) {
1171 if (index >= 0 && index <
sizeof(tempstr) - 1) {
1172 memcpy(&tempstr[0], &pld->
searchstr[0], index);
1173 tempstr[index] =
'|';
1174 memcpy(&tempstr[index + 1], &pld->
searchstr[index], (
sizeof(tempstr) - 1) - index);
1185 TIP_(
"PoseLib Previewing Pose: Filter - [%s] | "
1186 "Current Pose - \"%s\""),
1195 TIP_(
"PoseLib Previewing Pose: \"%s\""),
1267 for (ld = ldc; ld && step; ld = ldn, step--) {
1272 for (ld = ldc; ld && step; ld = ldn, step++) {
1294 for (marker = pld->
marker; marker && step; marker =
next, step--) {
1299 for (marker = pld->
marker; marker && step; marker =
next, step++) {
1315 switch (event_type) {
1322 for (i = index; i <=
len; i++) {
1341 for (i = index; i <
len; i++) {
1360 for (i =
len; i > index; i--) {
1385 printf(
"PoseLib: skipping event with type '%s' and val %d\n",
1399 switch (event->
type) {
1449 switch (event->
type) {
1623 if (pose_index == -1) {
1626 else if (pose_index == -2) {
1648 if (pose_index > -2) {
1708 act->active_marker =
BLI_findindex(&act->markers, marker) + 1;
1736 int exit_state = pld->
state;
1832 ot->
name =
"Legacy PoseLib Browse Poses";
1833 ot->
idname =
"POSELIB_OT_browse_interactive";
1835 "Deprecated, will be removed in Blender 3.3. "
1836 "Interactively browse Legacy Pose Library poses in 3D-View";
1857 "Index of the pose to apply (-2 for no change to pose, -1 for poselib active pose)",
1870 "Amount that the pose is applied on top of the existing poses",
1879 ot->
name =
"Apply Legacy Pose Library Pose";
1880 ot->
idname =
"POSELIB_OT_apply_pose";
1882 "Deprecated, will be removed in Blender 3.3. "
1883 "Apply specified Legacy Pose Library pose to the rig";
1901 "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)
bool BKE_pose_is_layer_visible(const struct bArmature *arm, const struct bPoseChannel *pchan)
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 BKE_fcurve_handles_recalc(struct FCurve *fcu)
void BKE_fcurve_delete_key(struct FCurve *fcu, int index)
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()
bool BKE_id_is_editable(const struct Main *bmain, const struct ID *id)
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_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BKE_report(ReportList *reports, eReportType type, const char *message)
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()
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
size_t BLI_snprintf(char *__restrict dst, size_t maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
bool BLI_uniquename(struct ListBase *list, void *vlink, const char *defname, char delim, int name_offset, size_t name_len)
struct Depsgraph Depsgraph
void DEG_id_tag_update(struct ID *id, int flag)
@ ID_RECALC_COPY_ON_WRITE
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.
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value NORMAL
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, wmOperatorCallContext 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)
void uiLayoutSetOperatorContext(uiLayout *layout, wmOperatorCallContext opcontext)
uiPopupMenu * UI_popup_menu_begin(struct bContext *C, const char *title, int icon) ATTR_NONNULL()
__forceinline ssef low(const avxf &a)
__forceinline ssef high(const avxf &a)
const Depsgraph * depsgraph
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)
AnimKeylist * ED_keylist_create()
void ED_keylist_free(AnimKeylist *keylist)
void action_to_keylist(AnimData *adt, bAction *act, AnimKeylist *keylist, const int saction_flag)
const struct ListBase * ED_keylist_listbase(const AnimKeylist *keylist)
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 const pxr::TfToken b("b", pxr::TfToken::Immortal)
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))
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)
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)
@ PL_PREVIEW_REDRAWHEADER
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)
@ PL_PREVIEW_SHOWORIGINAL
@ PL_PREVIEW_ANY_BONE_SELECTED
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
char WM_event_utf8_to_ascii(const struct wmEvent *event)
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))