Blender  V3.3
Classes
graph_slider_ops.c File Reference
#include <float.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "BLI_listbase.h"
#include "BLI_string.h"
#include "DNA_anim_types.h"
#include "DNA_scene_types.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "BLT_translation.h"
#include "BKE_context.h"
#include "UI_interface.h"
#include "ED_anim_api.h"
#include "ED_keyframes_edit.h"
#include "ED_numinput.h"
#include "ED_screen.h"
#include "ED_util.h"
#include "WM_api.h"
#include "WM_types.h"
#include "graph_intern.h"

Go to the source code of this file.

Classes

struct  tGraphSliderOp
 
struct  tBeztCopyData
 

Functions

Utility Functions
static void store_original_bezt_arrays (tGraphSliderOp *gso)
 
static void reset_bezts (tGraphSliderOp *gso)
 
static float slider_factor_get_and_remember (wmOperator *op)
 
Common Modal Functions
static void graph_slider_exit (bContext *C, wmOperator *op)
 
static int graph_slider_modal (bContext *C, wmOperator *op, const wmEvent *event)
 
static int graph_slider_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
Blend to Neighbor Operator
static void blend_to_neighbor_graph_keys (bAnimContext *ac, float factor)
 
static void blend_to_neighbor_draw_status_header (bContext *C, tGraphSliderOp *gso)
 
static void blend_to_neighbor_modal_update (bContext *C, wmOperator *op)
 
static int blend_to_neighbor_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
static int blend_to_neighbor_exec (bContext *C, wmOperator *op)
 
void GRAPH_OT_blend_to_neighbor (wmOperatorType *ot)
 
Breakdown Operator
static void breakdown_graph_keys (bAnimContext *ac, float factor)
 
static void breakdown_draw_status_header (bContext *C, tGraphSliderOp *gso)
 
static void breakdown_modal_update (bContext *C, wmOperator *op)
 
static int breakdown_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
static int breakdown_exec (bContext *C, wmOperator *op)
 
void GRAPH_OT_breakdown (wmOperatorType *ot)
 
Blend to Default Value Operator
static void blend_to_default_graph_keys (bAnimContext *ac, const float factor)
 
static void blend_to_default_draw_status_header (bContext *C, tGraphSliderOp *gso)
 
static void blend_to_default_modal_update (bContext *C, wmOperator *op)
 
static int blend_to_default_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
static int blend_to_default_exec (bContext *C, wmOperator *op)
 
void GRAPH_OT_blend_to_default (wmOperatorType *ot)
 

Internal Struct & Defines

#define OPERATOR_DATA_FILTER
 
typedef struct tGraphSliderOp tGraphSliderOp
 
typedef struct tBeztCopyData tBeztCopyData
 

Decimate Keyframes Operator

enum  tDecimModes { DECIM_RATIO = 1 , DECIM_ERROR }
 
typedef enum tDecimModes tDecimModes
 
static const EnumPropertyItem decimate_mode_items []
 
static void decimate_graph_keys (bAnimContext *ac, float factor, float error_sq_max)
 
static void decimate_draw_status (bContext *C, tGraphSliderOp *gso)
 
static void decimate_modal_update (bContext *C, wmOperator *op)
 
static int decimate_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
static int decimate_exec (bContext *C, wmOperator *op)
 
static bool decimate_poll_property (const bContext *UNUSED(C), wmOperator *op, const PropertyRNA *prop)
 
static char * decimate_desc (bContext *UNUSED(C), wmOperatorType *UNUSED(op), PointerRNA *ptr)
 
void GRAPH_OT_decimate (wmOperatorType *ot)
 

Detailed Description

Graph Slider Operators

This file contains a collection of operators to modify keyframes in the graph editor. All operators are modal and use a slider that allows the user to define a percentage to modify the operator.

Definition in file graph_slider_ops.c.

Macro Definition Documentation

◆ OPERATOR_DATA_FILTER

#define OPERATOR_DATA_FILTER
Value:
ANIMFILTER_FOREDIT | ANIMFILTER_SEL | ANIMFILTER_NODUPLIS)
@ ANIMFILTER_DATA_VISIBLE
Definition: ED_anim_api.h:292
@ ANIMFILTER_CURVE_VISIBLE
Definition: ED_anim_api.h:297
@ ANIMFILTER_NODUPLIS
Definition: ED_anim_api.h:325
@ ANIMFILTER_FCURVESONLY
Definition: ED_anim_api.h:328
@ ANIMFILTER_SEL
Definition: ED_anim_api.h:308

Definition at line 50 of file graph_slider_ops.c.

Typedef Documentation

◆ tBeztCopyData

typedef struct tBeztCopyData tBeztCopyData

◆ tDecimModes

typedef enum tDecimModes tDecimModes

◆ tGraphSliderOp

Enumeration Type Documentation

◆ tDecimModes

Enumerator
DECIM_RATIO 
DECIM_ERROR 

Definition at line 329 of file graph_slider_ops.c.

Function Documentation

◆ blend_to_default_draw_status_header()

static void blend_to_default_draw_status_header ( bContext C,
tGraphSliderOp gso 
)
static

◆ blend_to_default_exec()

static int blend_to_default_exec ( bContext C,
wmOperator op 
)
static

◆ blend_to_default_graph_keys()

static void blend_to_default_graph_keys ( bAnimContext ac,
const float  factor 
)
static

◆ blend_to_default_invoke()

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

◆ blend_to_default_modal_update()

static void blend_to_default_modal_update ( bContext C,
wmOperator op 
)
static

◆ blend_to_neighbor_draw_status_header()

static void blend_to_neighbor_draw_status_header ( bContext C,
tGraphSliderOp gso 
)
static

◆ blend_to_neighbor_exec()

static int blend_to_neighbor_exec ( bContext C,
wmOperator op 
)
static

◆ blend_to_neighbor_graph_keys()

static void blend_to_neighbor_graph_keys ( bAnimContext ac,
float  factor 
)
static

◆ blend_to_neighbor_invoke()

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

◆ blend_to_neighbor_modal_update()

static void blend_to_neighbor_modal_update ( bContext C,
wmOperator op 
)
static

◆ breakdown_draw_status_header()

static void breakdown_draw_status_header ( bContext C,
tGraphSliderOp gso 
)
static

◆ breakdown_exec()

static int breakdown_exec ( bContext C,
wmOperator op 
)
static

◆ breakdown_graph_keys()

static void breakdown_graph_keys ( bAnimContext ac,
float  factor 
)
static

◆ breakdown_invoke()

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

◆ breakdown_modal_update()

static void breakdown_modal_update ( bContext C,
wmOperator op 
)
static

◆ decimate_desc()

static char* decimate_desc ( bContext UNUSEDC,
wmOperatorType UNUSEDop,
PointerRNA ptr 
)
static

Definition at line 476 of file graph_slider_ops.c.

References BLI_strdup(), DECIM_ERROR, NULL, ptr, RNA_enum_get(), and TIP_.

Referenced by GRAPH_OT_decimate().

◆ decimate_draw_status()

static void decimate_draw_status ( bContext C,
tGraphSliderOp gso 
)
static

◆ decimate_exec()

static int decimate_exec ( bContext C,
wmOperator op 
)
static

◆ decimate_graph_keys()

static void decimate_graph_keys ( bAnimContext ac,
float  factor,
float  error_sq_max 
)
static

◆ decimate_invoke()

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

◆ decimate_modal_update()

static void decimate_modal_update ( bContext C,
wmOperator op 
)
static

◆ decimate_poll_property()

static bool decimate_poll_property ( const bContext UNUSEDC,
wmOperator op,
const PropertyRNA prop 
)
static

◆ GRAPH_OT_blend_to_default()

void GRAPH_OT_blend_to_default ( wmOperatorType ot)

◆ GRAPH_OT_blend_to_neighbor()

void GRAPH_OT_blend_to_neighbor ( wmOperatorType ot)

◆ GRAPH_OT_breakdown()

void GRAPH_OT_breakdown ( wmOperatorType ot)

◆ GRAPH_OT_decimate()

void GRAPH_OT_decimate ( wmOperatorType ot)

◆ graph_slider_exit()

static void graph_slider_exit ( bContext C,
wmOperator op 
)
static

◆ graph_slider_invoke()

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

◆ graph_slider_modal()

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

◆ reset_bezts()

static void reset_bezts ( tGraphSliderOp gso)
static

◆ slider_factor_get_and_remember()

static float slider_factor_get_and_remember ( wmOperator op)
static

◆ store_original_bezt_arrays()

static void store_original_bezt_arrays ( tGraphSliderOp gso)
static

Construct a list with the original bezt arrays so we can restore them during modal operation. The data is stored on the struct that is passed.

Definition at line 90 of file graph_slider_ops.c.

References tGraphSliderOp::ac, ANIM_animdata_filter(), ANIM_animdata_freelist(), FCurve::bezt, tGraphSliderOp::bezt_arr_list, BLI_addtail(), copy(), bAnimContext::data, LinkData::data, bAnimContext::datatype, ListBase::first, if(), bAnimListElem::key_data, MEM_callocN, MEM_mallocN, bAnimListElem::next, NULL, OPERATOR_DATA_FILTER, and FCurve::totvert.

Referenced by graph_slider_invoke().

Variable Documentation

◆ decimate_mode_items

const EnumPropertyItem decimate_mode_items[]
static
Initial value:
= {
"RATIO",
0,
"Ratio",
"Use a percentage to specify how many keyframes you want to remove"},
"ERROR",
0,
"Error Margin",
"Use an error margin to specify how much the curve is allowed to deviate from the original "
"path"},
{0, NULL, 0, NULL, NULL},
}
@ DECIM_RATIO
@ DECIM_ERROR

Definition at line 488 of file graph_slider_ops.c.

Referenced by GRAPH_OT_decimate().