Blender  V2.93
Classes | Typedefs | Enumerations | Functions | Variables
pose_slide.c File Reference
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_dlrbTree.h"
#include "BLI_math.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_fcurve.h"
#include "BKE_nla.h"
#include "BKE_context.h"
#include "BKE_layer.h"
#include "BKE_object.h"
#include "BKE_report.h"
#include "BKE_unit.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "WM_api.h"
#include "WM_types.h"
#include "UI_interface.h"
#include "ED_armature.h"
#include "ED_keyframes_draw.h"
#include "ED_markers.h"
#include "ED_numinput.h"
#include "ED_screen.h"
#include "armature_intern.h"

Go to the source code of this file.

Classes

struct  tPoseSlideOp
 
struct  tPoseSlideObject
 
union  tPosePropagate_ModeData
 

Typedefs

typedef struct tPoseSlideOp tPoseSlideOp
 
typedef struct tPoseSlideObject tPoseSlideObject
 
typedef enum ePoseSlide_Modes ePoseSlide_Modes
 
typedef enum ePoseSlide_Channels ePoseSlide_Channels
 
typedef enum ePoseSlide_AxisLock ePoseSlide_AxisLock
 
typedef enum ePosePropagate_Termination ePosePropagate_Termination
 
typedef union tPosePropagate_ModeData tPosePropagate_ModeData
 

Enumerations

enum  ePoseSlide_Modes {
  POSESLIDE_PUSH = 0 , POSESLIDE_RELAX , POSESLIDE_BREAKDOWN , POSESLIDE_PUSH_REST ,
  POSESLIDE_RELAX_REST
}
 
enum  ePoseSlide_Channels {
  PS_TFM_ALL = 0 , PS_TFM_LOC , PS_TFM_ROT , PS_TFM_SIZE ,
  PS_TFM_BBONE_SHAPE , PS_TFM_PROPS
}
 
enum  ePoseSlide_AxisLock { PS_LOCK_X = (1 << 0) , PS_LOCK_Y = (1 << 1) , PS_LOCK_Z = (1 << 2) }
 
enum  ePosePropagate_Termination {
  POSE_PROPAGATE_SMART_HOLDS = 0 , POSE_PROPAGATE_LAST_KEY , POSE_PROPAGATE_NEXT_KEY , POSE_PROPAGATE_BEFORE_FRAME ,
  POSE_PROPAGATE_BEFORE_END , POSE_PROPAGATE_SELECTED_KEYS , POSE_PROPAGATE_SELECTED_MARKERS
}
 

Functions

static int pose_slide_init (bContext *C, wmOperator *op, ePoseSlide_Modes mode)
 
static void pose_slide_exit (wmOperator *op)
 
static void pose_slide_refresh (bContext *C, tPoseSlideOp *pso)
 
static bool pose_frame_range_from_object_get (tPoseSlideOp *pso, Object *ob, float *prevFrameF, float *nextFrameF)
 
static void pose_slide_apply_val (tPoseSlideOp *pso, FCurve *fcu, Object *ob, float *val)
 
static void pose_slide_apply_vec3 (tPoseSlideOp *pso, tPChanFCurveLink *pfl, float vec[3], const char propName[])
 
static void pose_slide_apply_props (tPoseSlideOp *pso, tPChanFCurveLink *pfl, const char prop_prefix[])
 
static void pose_slide_apply_quat (tPoseSlideOp *pso, tPChanFCurveLink *pfl)
 
static void pose_slide_rest_pose_apply_vec3 (tPoseSlideOp *pso, float vec[3], float default_value)
 
static void pose_slide_rest_pose_apply_other_rot (tPoseSlideOp *pso, float vec[4], bool quat)
 
static void pose_slide_rest_pose_apply (bContext *C, tPoseSlideOp *pso)
 
static void pose_slide_apply (bContext *C, tPoseSlideOp *pso)
 
static void pose_slide_autoKeyframe (bContext *C, tPoseSlideOp *pso)
 
static void pose_slide_reset (tPoseSlideOp *pso)
 
static void pose_slide_draw_status (tPoseSlideOp *pso)
 
static int pose_slide_invoke_common (bContext *C, wmOperator *op, tPoseSlideOp *pso)
 
static void pose_slide_mouse_update_percentage (tPoseSlideOp *pso, wmOperator *op, const wmEvent *event)
 
static void pose_slide_toggle_channels_mode (wmOperator *op, tPoseSlideOp *pso, ePoseSlide_Channels channel)
 
static bool pose_slide_toggle_axis_locks (wmOperator *op, tPoseSlideOp *pso, ePoseSlide_AxisLock axis)
 
static int pose_slide_modal (bContext *C, wmOperator *op, const wmEvent *event)
 
static void pose_slide_cancel (bContext *UNUSED(C), wmOperator *op)
 
static int pose_slide_exec_common (bContext *C, wmOperator *op, tPoseSlideOp *pso)
 
static void pose_slide_opdef_properties (wmOperatorType *ot)
 
static int pose_slide_push_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
static int pose_slide_push_exec (bContext *C, wmOperator *op)
 
void POSE_OT_push (wmOperatorType *ot)
 
static int pose_slide_relax_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
static int pose_slide_relax_exec (bContext *C, wmOperator *op)
 
void POSE_OT_relax (wmOperatorType *ot)
 
static int pose_slide_push_rest_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
static int pose_slide_push_rest_exec (bContext *C, wmOperator *op)
 
void POSE_OT_push_rest (wmOperatorType *ot)
 
static int pose_slide_relax_rest_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
static int pose_slide_relax_rest_exec (bContext *C, wmOperator *op)
 
void POSE_OT_relax_rest (wmOperatorType *ot)
 
static int pose_slide_breakdown_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
static int pose_slide_breakdown_exec (bContext *C, wmOperator *op)
 
void POSE_OT_breakdown (wmOperatorType *ot)
 
static float pose_propagate_get_boneHoldEndFrame (tPChanFCurveLink *pfl, float startFrame)
 
static bool pose_propagate_get_refVal (Object *ob, FCurve *fcu, float *value)
 
static void pose_propagate_fcurve (wmOperator *op, Object *ob, FCurve *fcu, float startFrame, tPosePropagate_ModeData modeData)
 
static int pose_propagate_exec (bContext *C, wmOperator *op)
 
void POSE_OT_propagate (wmOperatorType *ot)
 

Variables

static const EnumPropertyItem prop_channels_types []
 
static const EnumPropertyItem prop_axis_lock_types []
 

Typedef Documentation

◆ ePosePropagate_Termination

◆ ePoseSlide_AxisLock

◆ ePoseSlide_Channels

◆ ePoseSlide_Modes

◆ tPosePropagate_ModeData

◆ tPoseSlideObject

◆ tPoseSlideOp

typedef struct tPoseSlideOp tPoseSlideOp

Enumeration Type Documentation

◆ ePosePropagate_Termination

Enumerator
POSE_PROPAGATE_SMART_HOLDS 
POSE_PROPAGATE_LAST_KEY 
POSE_PROPAGATE_NEXT_KEY 
POSE_PROPAGATE_BEFORE_FRAME 
POSE_PROPAGATE_BEFORE_END 
POSE_PROPAGATE_SELECTED_KEYS 
POSE_PROPAGATE_SELECTED_MARKERS 

Definition at line 1598 of file pose_slide.c.

◆ ePoseSlide_AxisLock

Enumerator
PS_LOCK_X 
PS_LOCK_Y 
PS_LOCK_Z 

Definition at line 172 of file pose_slide.c.

◆ ePoseSlide_Channels

Enumerator
PS_TFM_ALL 
PS_TFM_LOC 
PS_TFM_ROT 
PS_TFM_SIZE 
PS_TFM_BBONE_SHAPE 
PS_TFM_PROPS 

Definition at line 144 of file pose_slide.c.

◆ ePoseSlide_Modes

Enumerator
POSESLIDE_PUSH 
POSESLIDE_RELAX 
POSESLIDE_BREAKDOWN 
POSESLIDE_PUSH_REST 
POSESLIDE_RELAX_REST 

Definition at line 135 of file pose_slide.c.

Function Documentation

◆ pose_frame_range_from_object_get()

static bool pose_frame_range_from_object_get ( tPoseSlideOp pso,
Object ob,
float prevFrameF,
float nextFrameF 
)
static

Although this lookup is not ideal, we won't be dealing with a lot of objects at a given time. But if it comes to that we can instead store prev/next frame in the tPChanFCurveLink.

Definition at line 307 of file pose_slide.c.

References tPoseSlideObject::nextFrameF, tPoseSlideObject::ob, tPoseSlideOp::ob_data_array, tPoseSlideOp::objects_len, and tPoseSlideObject::prevFrameF.

Referenced by pose_slide_apply_quat(), and pose_slide_apply_val().

◆ POSE_OT_breakdown()

void POSE_OT_breakdown ( wmOperatorType ot)

◆ POSE_OT_propagate()

void POSE_OT_propagate ( wmOperatorType ot)

◆ POSE_OT_push()

void POSE_OT_push ( wmOperatorType ot)

◆ POSE_OT_push_rest()

void POSE_OT_push_rest ( wmOperatorType ot)

◆ POSE_OT_relax()

void POSE_OT_relax ( wmOperatorType ot)

◆ POSE_OT_relax_rest()

void POSE_OT_relax_rest ( wmOperatorType ot)

◆ pose_propagate_exec()

static int pose_propagate_exec ( bContext C,
wmOperator op 
)
static

◆ pose_propagate_fcurve()

static void pose_propagate_fcurve ( wmOperator op,
Object ob,
FCurve fcu,
float  startFrame,
tPosePropagate_ModeData  modeData 
)
static

◆ pose_propagate_get_boneHoldEndFrame()

static float pose_propagate_get_boneHoldEndFrame ( tPChanFCurveLink pfl,
float  startFrame 
)
static

◆ pose_propagate_get_refVal()

static bool pose_propagate_get_refVal ( Object ob,
FCurve fcu,
float value 
)
static

◆ pose_slide_apply()

static void pose_slide_apply ( bContext C,
tPoseSlideOp pso 
)
static

◆ pose_slide_apply_props()

static void pose_slide_apply_props ( tPoseSlideOp pso,
tPChanFCurveLink pfl,
const char  prop_prefix[] 
)
static

◆ pose_slide_apply_quat()

static void pose_slide_apply_quat ( tPoseSlideOp pso,
tPChanFCurveLink pfl 
)
static

◆ pose_slide_apply_val()

static void pose_slide_apply_val ( tPoseSlideOp pso,
FCurve fcu,
Object ob,
float val 
)
static

◆ pose_slide_apply_vec3()

static void pose_slide_apply_vec3 ( tPoseSlideOp pso,
tPChanFCurveLink pfl,
float  vec[3],
const char  propName[] 
)
static

◆ pose_slide_autoKeyframe()

static void pose_slide_autoKeyframe ( bContext C,
tPoseSlideOp pso 
)
static

◆ pose_slide_breakdown_exec()

static int pose_slide_breakdown_exec ( bContext C,
wmOperator op 
)
static

◆ pose_slide_breakdown_invoke()

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

◆ pose_slide_cancel()

static void pose_slide_cancel ( bContext UNUSEDC,
wmOperator op 
)
static

◆ pose_slide_draw_status()

static void pose_slide_draw_status ( tPoseSlideOp pso)
static

◆ pose_slide_exec_common()

static int pose_slide_exec_common ( bContext C,
wmOperator op,
tPoseSlideOp pso 
)
static

◆ pose_slide_exit()

static void pose_slide_exit ( wmOperator op)
static

◆ pose_slide_init()

static int pose_slide_init ( bContext C,
wmOperator op,
ePoseSlide_Modes  mode 
)
static

◆ pose_slide_invoke_common()

static int pose_slide_invoke_common ( bContext C,
wmOperator op,
tPoseSlideOp pso 
)
static

◆ pose_slide_modal()

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

◆ pose_slide_mouse_update_percentage()

static void pose_slide_mouse_update_percentage ( tPoseSlideOp pso,
wmOperator op,
const wmEvent event 
)
static

◆ pose_slide_opdef_properties()

static void pose_slide_opdef_properties ( wmOperatorType ot)
static

◆ pose_slide_push_exec()

static int pose_slide_push_exec ( bContext C,
wmOperator op 
)
static

◆ pose_slide_push_invoke()

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

◆ pose_slide_push_rest_exec()

static int pose_slide_push_rest_exec ( bContext C,
wmOperator op 
)
static

◆ pose_slide_push_rest_invoke()

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

◆ pose_slide_refresh()

static void pose_slide_refresh ( bContext C,
tPoseSlideOp pso 
)
static

◆ pose_slide_relax_exec()

static int pose_slide_relax_exec ( bContext C,
wmOperator op 
)
static

◆ pose_slide_relax_invoke()

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

◆ pose_slide_relax_rest_exec()

static int pose_slide_relax_rest_exec ( bContext C,
wmOperator op 
)
static

◆ pose_slide_relax_rest_invoke()

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

◆ pose_slide_reset()

static void pose_slide_reset ( tPoseSlideOp pso)
static

Definition at line 781 of file pose_slide.c.

References tPoseSlideOp::pfLinks, and poseAnim_mapping_reset().

Referenced by pose_slide_modal().

◆ pose_slide_rest_pose_apply()

static void pose_slide_rest_pose_apply ( bContext C,
tPoseSlideOp pso 
)
static

◆ pose_slide_rest_pose_apply_other_rot()

static void pose_slide_rest_pose_apply_other_rot ( tPoseSlideOp pso,
float  vec[4],
bool  quat 
)
static

◆ pose_slide_rest_pose_apply_vec3()

static void pose_slide_rest_pose_apply_vec3 ( tPoseSlideOp pso,
float  vec[3],
float  default_value 
)
static

◆ pose_slide_toggle_axis_locks()

static bool pose_slide_toggle_axis_locks ( wmOperator op,
tPoseSlideOp pso,
ePoseSlide_AxisLock  axis 
)
static

◆ pose_slide_toggle_channels_mode()

static void pose_slide_toggle_channels_mode ( wmOperator op,
tPoseSlideOp pso,
ePoseSlide_Channels  channel 
)
static

Variable Documentation

◆ prop_axis_lock_types

const EnumPropertyItem prop_axis_lock_types[]
static
Initial value:
= {
{0, "FREE", 0, "Free", "All axes are affected"},
{PS_LOCK_X, "X", 0, "X", "Only X-axis transforms are affected"},
{PS_LOCK_Y, "Y", 0, "Y", "Only Y-axis transforms are affected"},
{PS_LOCK_Z, "Z", 0, "Z", "Only Z-axis transforms are affected"},
{0, NULL, 0, NULL, NULL},
}
@ PS_LOCK_Z
Definition: pose_slide.c:175
@ PS_LOCK_Y
Definition: pose_slide.c:174
@ PS_LOCK_X
Definition: pose_slide.c:173

Definition at line 179 of file pose_slide.c.

Referenced by pose_slide_opdef_properties().

◆ prop_channels_types

const EnumPropertyItem prop_channels_types[]
static
Initial value:
= {
"ALL",
0,
"All Properties",
"All properties, including transforms, bendy bone shape, and custom properties"},
{PS_TFM_LOC, "LOC", 0, "Location", "Location only"},
{PS_TFM_ROT, "ROT", 0, "Rotation", "Rotation only"},
{PS_TFM_SIZE, "SIZE", 0, "Scale", "Scale only"},
{PS_TFM_BBONE_SHAPE, "BBONE", 0, "Bendy Bone", "Bendy Bone shape properties"},
{PS_TFM_PROPS, "CUSTOM", 0, "Custom Properties", "Custom properties"},
{0, NULL, 0, NULL, NULL},
}
@ PS_TFM_SIZE
Definition: pose_slide.c:149
@ PS_TFM_LOC
Definition: pose_slide.c:147
@ PS_TFM_PROPS
Definition: pose_slide.c:153
@ PS_TFM_ALL
Definition: pose_slide.c:145
@ PS_TFM_BBONE_SHAPE
Definition: pose_slide.c:151
@ PS_TFM_ROT
Definition: pose_slide.c:148

Definition at line 157 of file pose_slide.c.

Referenced by pose_slide_opdef_properties().