69 for (ale = anim_data.
first; ale; ale = ale->
next) {
143 memcpy(fcu->
bezt,
data->bezt, arr_size);
145 link_bezt = link_bezt->
next;
187 strcpy(mode_str,
TIP_(
"Decimate Keyframes"));
194 BLI_snprintf(status_str,
sizeof(status_str),
"%s: %s", mode_str, str_ofs);
199 status_str,
sizeof(status_str),
"%s: %d %%", mode_str, (
int)(percentage * 100.0f));
257 for (ale = anim_data.
first; ale; ale = ale->
next) {
271 memcpy(bezts_copy, fcu->
bezt, arr_size);
273 copy->bezt = bezts_copy;
288 "Fcurve Decimate: Can't decimate baked channels. Unbake them and try again.");
311 const float error_sq_max = FLT_MAX;
326 switch (event->
type) {
355 if (has_numinput ==
false) {
372 value = percentage * 100.0f;
375 percentage = value / 100.0f;
403 float remove_ratio = 1.0f;
405 float error_sq_max = FLT_MAX;
414 error_sq_max *= error_sq_max;
419 if (remove_ratio == 0.0f || error_sq_max == 0.0f) {
459 "Decimate F-Curves by specifying how much it can deviate from the original curve");
471 "Use a percentage to specify how many keyframes you want to remove"},
476 "Use an error margin to specify how much the curve is allowed to deviate from the original "
484 ot->
name =
"Decimate Keyframes";
487 "Decimate F-Curves by removing keyframes that influence the curve shape the least";
506 "Which mode to use for decimation");
514 "The ratio of remaining keyframes after the operation",
518 "remove_error_margin",
523 "How much the new decimated curve is allowed to deviate from the original",
struct ScrArea * CTX_wm_area(const bContext *C)
struct Scene * CTX_data_scene(const bContext *C)
struct ARegion * CTX_wm_region(const bContext *C)
struct wmWindow * CTX_wm_window(const bContext *C)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL() ATTR_MALLOC
size_t BLI_snprintf(char *__restrict dst, size_t maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
struct BezTriple BezTriple
#define ANIM_UPDATE_DEFAULT
@ ANIMFILTER_DATA_VISIBLE
@ ANIMFILTER_CURVE_VISIBLE
void ED_area_status_text(ScrArea *area, const char *str)
Read Guarded memory(de)allocation.
void ANIM_animdata_freelist(ListBase *anim_data)
void ANIM_animdata_update(bAnimContext *ac, ListBase *anim_data)
bool ANIM_animdata_get_context(const bContext *C, bAnimContext *ac)
size_t ANIM_animdata_filter(bAnimContext *ac, ListBase *anim_data, eAnimFilter_Flags filter_mode, void *data, eAnimCont_Types datatype)
bool graphop_editable_keyframes_poll(struct bContext *C)
static void decimate_exit(bContext *C, wmOperator *op)
static void decimate_draw_status_header(wmOperator *op, tDecimateGraphOp *dgo)
static void decimate_mouse_update_percentage(tDecimateGraphOp *dgo, wmOperator *op, const wmEvent *event)
static void graphkeys_decimate_modal_update(bContext *C, wmOperator *op)
static const EnumPropertyItem decimate_mode_items[]
static int graphkeys_decimate_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static void decimate_reset_bezts(tDecimateGraphOp *dgo)
static bool graphkeys_decimate_poll_property(const bContext *UNUSED(C), wmOperator *op, const PropertyRNA *prop)
struct tDecimateGraphOp tDecimateGraphOp
static int graphkeys_decimate_modal(bContext *C, wmOperator *op, const wmEvent *event)
void GRAPH_OT_decimate(wmOperatorType *ot)
static int graphkeys_decimate_exec(bContext *C, wmOperator *op)
static char * graphkeys_decimate_desc(bContext *UNUSED(C), wmOperatorType *UNUSED(op), PointerRNA *ptr)
static void decimate_graph_keys(bAnimContext *ac, float remove_ratio, float error_sq_max)
struct tBeztCopyData tBeztCopyData
DO_INLINE void filter(lfVector *V, fmatrix3x3 *S)
bool decimate_fcurve(bAnimListElem *ale, float remove_ratio, float error_sq_max)
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_mallocN)(size_t len, const char *str)
static void area(int d1, int d2, int e1, int e2, float weights[2])
static void copy(bNodeTree *dest_ntree, bNode *dest_node, const bNode *src_node)
float RNA_property_float_get(PointerRNA *ptr, PropertyRNA *prop)
const char * RNA_property_identifier(const PropertyRNA *prop)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
float RNA_float_get(PointerRNA *ptr, const char *name)
void RNA_property_float_set(PointerRNA *ptr, PropertyRNA *prop, float value)
int RNA_enum_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_float(StructOrFunctionRNA *cont_, const char *identifier, float default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
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)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
struct bAnimListElem * next
PropertyRNA * percentage_prop
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
char *(* get_description)(struct bContext *C, struct wmOperatorType *, struct PointerRNA *)
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
bool(* poll_property)(const struct bContext *C, struct wmOperator *op, const PropertyRNA *prop) ATTR_WARN_UNUSED_RESULT
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
void WM_cursor_modal_set(wmWindow *win, int val)
void WM_cursor_modal_restore(wmWindow *win)
wmEventHandler_Op * WM_event_add_modal_handler(bContext *C, wmOperator *op)
void WM_report(ReportType type, const char *message)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)