48 const bool do_sel_only,
49 const bool include_handles)
72 *xmax = -999999999.0f;
78 *ymax = -999999999.0f;
82 if (anim_data.first) {
83 bool foundBounds =
false;
86 for (ale = anim_data.first; ale; ale = ale->
next) {
89 float txmin, txmax, tymin, tymax;
94 fcu, &txmin, &txmax, &tymin, &tymax, do_sel_only, include_handles)) {
112 if ((xmin) && (txmin < *xmin)) {
115 if ((xmax) && (txmax > *xmax)) {
118 if ((ymin) && (tymin < *ymin)) {
121 if ((ymax) && (tymax > *ymax)) {
131 if ((xmin && xmax) && (
fabsf(*xmax - *xmin) < 0.001f)) {
135 if ((ymin && ymax) && (
fabsf(*ymax - *ymin) < 0.001f)) {
224 ot->
name =
"Set Preview Range to Selected";
225 ot->
idname =
"GRAPH_OT_previewrange_set";
226 ot->
description =
"Set Preview Range based on range of selected keyframes";
244 const bool do_sel_only,
245 const bool include_handles,
246 const int smooth_viewtx)
306 ot->
description =
"Reset viewable area to show full keyframe range";
321 "Include handles of keyframes when calculating extents");
327 ot->
name =
"Frame Selected";
328 ot->
idname =
"GRAPH_OT_view_selected";
329 ot->
description =
"Reset viewable area to show selected keyframe range";
344 "Include handles of keyframes when calculating extents");
363 ot->
name =
"Go to Current Frame";
397 printf(
"Error: Frame range for Ghost F-Curve creation is inappropriate\n");
407 for (ale = anim_data.first; ale; ale = ale->
next) {
426 gcu->fpt = fpt =
MEM_callocN(
sizeof(
FPoint) * (end - start + 1),
"Ghost FPoint Samples");
427 gcu->totvert = end - start + 1;
430 for (cfra = start; cfra <= end; cfra++, fpt++) {
440 gcu->color[0] = fcu->
color[0] - 0.07f;
441 gcu->color[1] = fcu->
color[1] - 0.07f;
442 gcu->color[2] = fcu->
color[2] - 0.07f;
486 ot->
name =
"Create Ghost Curves";
487 ot->
idname =
"GRAPH_OT_ghost_curves_create";
489 "Create snapshot (Ghosts) of selected F-Curves as background aid for active Graph Editor";
536 ot->
name =
"Clear Ghost Curves";
537 ot->
idname =
"GRAPH_OT_ghost_curves_clear";
538 ot->
description =
"Clear F-Curve snapshots (Ghosts) for active Graph Editor";
typedef float(TangentPoint)[2]
struct ScrArea * CTX_wm_area(const bContext *C)
bool BKE_fcurve_calc_bounds(struct FCurve *fcu, float *xmin, float *xmax, float *ymin, float *ymax, bool do_sel_only, bool include_handles)
void BKE_fcurves_free(ListBase *list)
struct FCurve * BKE_fcurve_create(void)
float fcurve_samplingcb_evalcurve(struct FCurve *fcu, void *data, float evaltime)
float BKE_nla_tweakedit_remap(struct AnimData *adt, float cframe, short mode)
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
MINLINE int round_fl_to_int(float a)
void BLI_rctf_pad_y(struct rctf *rect, float boundary_size, float pad_min, float pad_max)
void BLI_rctf_scale(rctf *rect, float scale)
@ ANIMFILTER_DATA_VISIBLE
@ ANIMFILTER_CURVE_VISIBLE
void ED_area_tag_redraw(ScrArea *area)
bool ED_operator_graphedit_active(struct bContext *C)
Read Guarded memory(de)allocation.
#define UI_MARKER_MARGIN_Y
void UI_view2d_smooth_view(const struct bContext *C, struct ARegion *region, const struct rctf *cur, int smooth_viewtx)
#define V2D_SCROLL_HANDLE_HEIGHT
#define UI_TIME_SCRUB_MARGIN_Y
void ANIM_animdata_freelist(ListBase *anim_data)
AnimData * ANIM_nla_mapping_get(bAnimContext *ac, bAnimListElem *ale)
void ANIM_center_frame(struct bContext *C, int smooth_viewtx)
float ANIM_unit_mapping_get_factor(Scene *scene, ID *id, FCurve *fcu, short flag, float *r_offset)
short ANIM_get_normalization_flags(bAnimContext *ac)
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)
ListBase * ED_context_get_markers(const bContext *C)
bool graphop_visible_keyframes_poll(struct bContext *C)
static int graphkeys_view_selected_exec(bContext *C, wmOperator *op)
static int graphkeys_view_frame_exec(bContext *C, wmOperator *op)
static int graphkeys_create_ghostcurves_exec(bContext *C, wmOperator *UNUSED(op))
void GRAPH_OT_ghost_curves_create(wmOperatorType *ot)
void get_graph_keyframe_extents(bAnimContext *ac, float *xmin, float *xmax, float *ymin, float *ymax, const bool do_sel_only, const bool include_handles)
void GRAPH_OT_view_all(wmOperatorType *ot)
static int graphkeys_previewrange_exec(bContext *C, wmOperator *UNUSED(op))
void GRAPH_OT_view_frame(wmOperatorType *ot)
void GRAPH_OT_view_selected(wmOperatorType *ot)
void GRAPH_OT_previewrange_set(wmOperatorType *ot)
void GRAPH_OT_ghost_curves_clear(wmOperatorType *ot)
static int graphkeys_viewall_exec(bContext *C, wmOperator *op)
static void create_ghost_curves(bAnimContext *ac, int start, int end)
static int graphkeys_clear_ghostcurves_exec(bContext *C, wmOperator *UNUSED(op))
static int graphkeys_viewall(bContext *C, const bool do_sel_only, const bool include_handles, const int smooth_viewtx)
DO_INLINE void filter(lfVector *V, fmatrix3x3 *S)
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
void *(* MEM_callocN)(size_t len, const char *str)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
SpaceGraph_Runtime runtime
struct bAnimListElem * next
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
int WM_operator_smooth_viewtx_get(const wmOperator *op)