Blender  V3.3
Classes | Typedefs | Enumerations | Functions
pose_lib.c File Reference
#include <math.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_dlrbTree.h"
#include "BLI_string_utils.h"
#include "BLT_translation.h"
#include "DNA_anim_types.h"
#include "DNA_armature_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "BKE_action.h"
#include "BKE_animsys.h"
#include "BKE_armature.h"
#include "BKE_fcurve.h"
#include "BKE_idprop.h"
#include "BKE_lib_id.h"
#include "BKE_main.h"
#include "BKE_object.h"
#include "BKE_context.h"
#include "BKE_report.h"
#include "DEG_depsgraph.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_enum_types.h"
#include "RNA_prototypes.h"
#include "WM_api.h"
#include "WM_types.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "ED_anim_api.h"
#include "ED_armature.h"
#include "ED_keyframes_edit.h"
#include "ED_keyframes_keylist.h"
#include "ED_keyframing.h"
#include "ED_object.h"
#include "ED_screen.h"
#include "armature_intern.h"

Go to the source code of this file.

Classes

struct  tPoseLib_PreviewData
 
struct  tPoseLib_Backup
 

Typedefs

typedef struct tPoseLib_PreviewData tPoseLib_PreviewData
 
typedef struct tPoseLib_Backup tPoseLib_Backup
 

Enumerations

enum  {
  PL_PREVIEW_ERROR = -1 , PL_PREVIEW_RUNNING , PL_PREVIEW_CONFIRM , PL_PREVIEW_CANCEL ,
  PL_PREVIEW_RUNONCE
}
 
enum  { PL_PREVIEW_NOREDRAW = 0 , PL_PREVIEW_REDRAWALL , PL_PREVIEW_REDRAWHEADER }
 
enum  { PL_PREVIEW_FIRSTTIME = (1 << 0) , PL_PREVIEW_SHOWORIGINAL = (1 << 1) , PL_PREVIEW_ANY_BONE_SELECTED = (1 << 2) }
 

Functions

static void action_set_activemarker (void *UNUSED(a), void *UNUSED(b), void *UNUSED(c))
 
static int poselib_get_free_index (bAction *act)
 
static TimeMarkerposelib_get_active_pose (bAction *act)
 
static Objectget_poselib_object (bContext *C)
 
static bool has_poselib_pose_data_poll (bContext *C)
 
static bool has_poselib_pose_data_for_editing_poll (bContext *C)
 
static bActionposelib_init_new (Main *bmain, Object *ob)
 
static bActionposelib_validate (Main *bmain, Object *ob)
 
static int poselib_new_exec (bContext *C, wmOperator *UNUSED(op))
 
void POSELIB_OT_new (wmOperatorType *ot)
 
static int poselib_unlink_exec (bContext *C, wmOperator *UNUSED(op))
 
void POSELIB_OT_unlink (wmOperatorType *ot)
 
static int poselib_sanitize_exec (bContext *C, wmOperator *op)
 
void POSELIB_OT_action_sanitize (wmOperatorType *ot)
 
static bool poselib_add_poll (bContext *C)
 
static void poselib_add_menu_invoke__replacemenu (bContext *C, uiLayout *layout, void *UNUSED(arg))
 
static int poselib_add_menu_invoke (bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
 
static int poselib_add_exec (bContext *C, wmOperator *op)
 
void POSELIB_OT_pose_add (wmOperatorType *ot)
 
static const EnumPropertyItemposelib_stored_pose_itemf (bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), bool *r_free)
 
static int poselib_remove_exec (bContext *C, wmOperator *op)
 
void POSELIB_OT_pose_remove (wmOperatorType *ot)
 
static int poselib_rename_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
static int poselib_rename_exec (bContext *C, wmOperator *op)
 
void POSELIB_OT_pose_rename (wmOperatorType *ot)
 
static int poselib_move_exec (bContext *C, wmOperator *op)
 
void POSELIB_OT_pose_move (wmOperatorType *ot)
 
static void poselib_backup_posecopy (tPoseLib_PreviewData *pld)
 
static void poselib_backup_restore (tPoseLib_PreviewData *pld)
 
static void poselib_backup_free_data (tPoseLib_PreviewData *pld)
 
static void poselib_apply_pose (tPoseLib_PreviewData *pld, const AnimationEvalContext *anim_eval_context)
 
static void poselib_keytag_pose (bContext *C, Scene *scene, tPoseLib_PreviewData *pld)
 
static void poselib_preview_apply (bContext *C, wmOperator *op)
 
static void poselib_preview_get_next (tPoseLib_PreviewData *pld, int step)
 
static void poselib_preview_handle_search (tPoseLib_PreviewData *pld, ushort event_type, char ascii)
 
static int poselib_preview_handle_event (bContext *UNUSED(C), wmOperator *op, const wmEvent *event)
 
static void poselib_preview_init_data (bContext *C, wmOperator *op)
 
static void poselib_preview_cleanup (bContext *C, wmOperator *op)
 
static int poselib_preview_exit (bContext *C, wmOperator *op)
 
static void poselib_preview_cancel (bContext *C, wmOperator *op)
 
static int poselib_preview_modal (bContext *C, wmOperator *op, const wmEvent *event)
 
static int poselib_preview_invoke (bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
 
static int poselib_preview_exec (bContext *C, wmOperator *op)
 
void POSELIB_OT_browse_interactive (wmOperatorType *ot)
 
void POSELIB_OT_apply_pose (wmOperatorType *ot)
 

Typedef Documentation

◆ tPoseLib_Backup

◆ tPoseLib_PreviewData

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
PL_PREVIEW_ERROR 
PL_PREVIEW_RUNNING 
PL_PREVIEW_CONFIRM 
PL_PREVIEW_CANCEL 
PL_PREVIEW_RUNONCE 

Definition at line 901 of file pose_lib.c.

◆ anonymous enum

anonymous enum
Enumerator
PL_PREVIEW_NOREDRAW 
PL_PREVIEW_REDRAWALL 
PL_PREVIEW_REDRAWHEADER 

Definition at line 910 of file pose_lib.c.

◆ anonymous enum

anonymous enum
Enumerator
PL_PREVIEW_FIRSTTIME 
PL_PREVIEW_SHOWORIGINAL 
PL_PREVIEW_ANY_BONE_SELECTED 

Definition at line 917 of file pose_lib.c.

Function Documentation

◆ action_set_activemarker()

static void action_set_activemarker ( void UNUSEDa,
void UNUSEDb,
void UNUSED
)
static

Definition at line 61 of file pose_lib.c.

Referenced by poselib_preview_cleanup().

◆ get_poselib_object()

static Object* get_poselib_object ( bContext C)
static

◆ has_poselib_pose_data_for_editing_poll()

static bool has_poselib_pose_data_for_editing_poll ( bContext C)
static

◆ has_poselib_pose_data_poll()

static bool has_poselib_pose_data_poll ( bContext C)
static

◆ poselib_add_exec()

static int poselib_add_exec ( bContext C,
wmOperator op 
)
static

◆ poselib_add_menu_invoke()

static int poselib_add_menu_invoke ( bContext C,
wmOperator op,
const wmEvent UNUSEDevent 
)
static

◆ poselib_add_menu_invoke__replacemenu()

static void poselib_add_menu_invoke__replacemenu ( bContext C,
uiLayout layout,
void UNUSEDarg 
)
static

◆ poselib_add_poll()

static bool poselib_add_poll ( bContext C)
static

◆ poselib_apply_pose()

static void poselib_apply_pose ( tPoseLib_PreviewData pld,
const AnimationEvalContext anim_eval_context 
)
static

◆ poselib_backup_free_data()

static void poselib_backup_free_data ( tPoseLib_PreviewData pld)
static

◆ poselib_backup_posecopy()

static void poselib_backup_posecopy ( tPoseLib_PreviewData pld)
static

◆ poselib_backup_restore()

static void poselib_backup_restore ( tPoseLib_PreviewData pld)
static

◆ poselib_get_active_pose()

static TimeMarker* poselib_get_active_pose ( bAction act)
static

Definition at line 134 of file pose_lib.c.

References bAction::active_marker, BLI_findlink(), bAction::markers, and NULL.

Referenced by poselib_preview_init_data().

◆ poselib_get_free_index()

static int poselib_get_free_index ( bAction act)
static

Pose-Library Tool for Blender

Overview: This tool allows animators to store a set of frequently used poses to dump into the active action to help in "budget" productions to quickly block out new actions. It acts as a kind of "glorified clipboard for poses", allowing for naming of poses.

Features:

  • Pose-libs are simply normal Actions.
  • Each "pose" is simply a set of key-frames that occur on a particular frame.
    • A set of TimeMarker that belong to each Action, help 'label' where a 'pose' can be found in the Action.
  • The Scroll-wheel or PageUp/Down buttons when used in a special mode or after pressing/holding [a modifier] key, cycles through the poses available for the active pose's pose-lib, allowing the animator to preview what action best suits that pose.

Definition at line 89 of file pose_lib.c.

References ELEM, ListBase::first, TimeMarker::frame, high(), low(), bAction::markers, TimeMarker::next, and NULL.

Referenced by poselib_add_menu_invoke().

◆ poselib_init_new()

static bAction* poselib_init_new ( Main bmain,
Object ob 
)
static

◆ poselib_keytag_pose()

static void poselib_keytag_pose ( bContext C,
Scene scene,
tPoseLib_PreviewData pld 
)
static

◆ poselib_move_exec()

static int poselib_move_exec ( bContext C,
wmOperator op 
)
static

◆ poselib_new_exec()

static int poselib_new_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ POSELIB_OT_action_sanitize()

void POSELIB_OT_action_sanitize ( wmOperatorType ot)

◆ POSELIB_OT_apply_pose()

void POSELIB_OT_apply_pose ( wmOperatorType ot)

◆ POSELIB_OT_browse_interactive()

void POSELIB_OT_browse_interactive ( wmOperatorType ot)

◆ POSELIB_OT_new()

void POSELIB_OT_new ( wmOperatorType ot)

◆ POSELIB_OT_pose_add()

void POSELIB_OT_pose_add ( wmOperatorType ot)

◆ POSELIB_OT_pose_move()

void POSELIB_OT_pose_move ( wmOperatorType ot)

◆ POSELIB_OT_pose_remove()

void POSELIB_OT_pose_remove ( wmOperatorType ot)

◆ POSELIB_OT_pose_rename()

void POSELIB_OT_pose_rename ( wmOperatorType ot)

◆ POSELIB_OT_unlink()

void POSELIB_OT_unlink ( wmOperatorType ot)

◆ poselib_preview_apply()

static void poselib_preview_apply ( bContext C,
wmOperator op 
)
static

◆ poselib_preview_cancel()

static void poselib_preview_cancel ( bContext C,
wmOperator op 
)
static

Definition at line 1748 of file pose_lib.c.

References C, and poselib_preview_exit().

Referenced by POSELIB_OT_browse_interactive().

◆ poselib_preview_cleanup()

static void poselib_preview_cleanup ( bContext C,
wmOperator op 
)
static

◆ poselib_preview_exec()

static int poselib_preview_exec ( bContext C,
wmOperator op 
)
static

◆ poselib_preview_exit()

static int poselib_preview_exit ( bContext C,
wmOperator op 
)
static

◆ poselib_preview_get_next()

static void poselib_preview_get_next ( tPoseLib_PreviewData pld,
int  step 
)
static

◆ poselib_preview_handle_event()

static int poselib_preview_handle_event ( bContext UNUSEDC,
wmOperator op,
const wmEvent event 
)
static

◆ poselib_preview_handle_search()

static void poselib_preview_handle_search ( tPoseLib_PreviewData pld,
ushort  event_type,
char  ascii 
)
static

◆ poselib_preview_init_data()

static void poselib_preview_init_data ( bContext C,
wmOperator op 
)
static

◆ poselib_preview_invoke()

static int poselib_preview_invoke ( bContext C,
wmOperator op,
const wmEvent UNUSEDevent 
)
static

◆ poselib_preview_modal()

static int poselib_preview_modal ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ poselib_remove_exec()

static int poselib_remove_exec ( bContext C,
wmOperator op 
)
static

◆ poselib_rename_exec()

static int poselib_rename_exec ( bContext C,
wmOperator op 
)
static

◆ poselib_rename_invoke()

static int poselib_rename_invoke ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ poselib_sanitize_exec()

static int poselib_sanitize_exec ( bContext C,
wmOperator op 
)
static

◆ poselib_stored_pose_itemf()

static const EnumPropertyItem* poselib_stored_pose_itemf ( bContext C,
PointerRNA UNUSEDptr,
PropertyRNA UNUSEDprop,
bool r_free 
)
static

◆ poselib_unlink_exec()

static int poselib_unlink_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ poselib_validate()

static bAction* poselib_validate ( Main bmain,
Object ob 
)
static

Definition at line 199 of file pose_lib.c.

References ELEM, NULL, Object::pose, Object::poselib, and poselib_init_new().

Referenced by poselib_add_exec().