48 const bool do_sel_only,
49 const bool include_handles)
53 ListBase anim_data = {
nullptr,
nullptr};
71 *xmax = -999999999.0f;
77 *ymax = -999999999.0f;
81 if (anim_data.
first) {
82 bool foundBounds =
false;
88 float unitFac, offset;
107 if ((xmin) && (
bounds.xmin < *xmin)) {
110 if ((xmax) && (
bounds.xmax > *xmax)) {
113 if ((ymin) && (
bounds.ymin < *ymin)) {
116 if ((ymax) && (
bounds.ymax > *ymax)) {
126 if ((xmin && xmax) && (
fabsf(*xmax - *xmin) < 0.001f)) {
130 if ((ymin && ymax) && (
fabsf(*ymax - *ymin) < 0.001f)) {
197 if (ac.
scene ==
nullptr) {
219 ot->name =
"Set Preview Range to Selected";
220 ot->idname =
"GRAPH_OT_previewrange_set";
221 ot->description =
"Set Preview Range based on range of selected keyframes";
239 const bool do_sel_only,
240 const bool include_handles,
241 const int smooth_viewtx)
300 ot->name =
"Frame All";
301 ot->idname =
"GRAPH_OT_view_all";
302 ot->description =
"Reset viewable area to show full keyframe range";
317 "Include handles of keyframes when calculating extents");
323 ot->name =
"Frame Selected";
324 ot->idname =
"GRAPH_OT_view_selected";
325 ot->description =
"Reset viewable area to show selected keyframe range";
340 "Include handles of keyframes when calculating extents");
359 ot->name =
"Go to Current Frame";
360 ot->idname =
"GRAPH_OT_view_frame";
361 ot->description =
"Move the view to the current frame";
384 ListBase anim_data = {
nullptr,
nullptr};
392 printf(
"Error: Frame range for Ghost F-Curve creation is inappropriate\n");
408 float unitFac, offset;
422 gcu->
totvert = end - start + 1;
425 for (cfra = start; cfra <= end; cfra++, fpt++) {
481 ot->name =
"Create Ghost Curves";
482 ot->idname =
"GRAPH_OT_ghost_curves_create";
484 "Create snapshot (Ghosts) of selected F-Curves as background aid for active Graph Editor";
531 ot->name =
"Clear Ghost Curves";
532 ot->idname =
"GRAPH_OT_ghost_curves_clear";
533 ot->description =
"Clear F-Curve snapshots (Ghosts) for active Graph Editor";
ScrArea * CTX_wm_area(const bContext *C)
FCurve * BKE_fcurve_create()
void BKE_fcurves_free(ListBase *list)
float fcurve_samplingcb_evalcurve(FCurve *fcu, void *data, float evaltime)
bool BKE_fcurve_calc_bounds(const FCurve *fcu, bool selected_keys_only, bool include_handles, const float frame_range[2], rctf *r_bounds)
#define LISTBASE_FOREACH(type, var, list)
BLI_INLINE bool BLI_listbase_is_empty(const ListBase *lb)
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
MINLINE int round_fl_to_int(float a)
void BLI_rctf_resize_y(struct rctf *rect, float y)
void BLI_rctf_pad_y(struct rctf *rect, float boundary_size, float pad_min, float pad_max)
BLI_INLINE float BLI_rctf_size_y(const struct rctf *rct)
@ USER_ANIM_ONLY_SHOW_SELECTED_CURVE_KEYS
@ ANIMFILTER_DATA_VISIBLE
@ ANIMFILTER_CURVE_VISIBLE
void ED_area_tag_redraw(ScrArea *area)
bool ED_operator_graphedit_active(bContext *C)
Read Guarded memory(de)allocation.
void UI_view2d_smooth_view(const bContext *C, ARegion *region, const rctf *cur, int smooth_viewtx)
#define UI_MARKER_MARGIN_Y
#define V2D_SCROLL_HANDLE_HEIGHT
#define UI_TIME_SCRUB_MARGIN_Y
void ANIM_animdata_freelist(ListBase *anim_data)
short ANIM_get_normalization_flags(SpaceLink *space_link)
void ANIM_center_frame(bContext *C, int smooth_viewtx)
rctf ANIM_frame_range_view2d_add_xmargin(const View2D &view_2d, const rctf view_rect)
float ANIM_unit_mapping_get_factor(Scene *scene, ID *id, FCurve *fcu, short flag, float *r_offset)
float ANIM_nla_tweakedit_remap(bAnimListElem *ale, const float cframe, const eNlaTime_ConvertModes mode)
bool ANIM_animdata_get_context(const bContext *C, bAnimContext *ac)
size_t ANIM_animdata_filter(bAnimContext *ac, ListBase *anim_data, const eAnimFilter_Flags filter_mode, void *data, const eAnimCont_Types datatype)
ListBase * ED_context_get_markers(const bContext *C)
static btDbvtVolume bounds(btDbvtNode **leaves, int count)
bool graphop_visible_keyframes_poll(bContext *C)
static wmOperatorStatus graphkeys_viewall(bContext *C, const bool do_sel_only, const bool include_handles, const int smooth_viewtx)
static wmOperatorStatus graphkeys_view_frame_exec(bContext *C, wmOperator *op)
static wmOperatorStatus graphkeys_clear_ghostcurves_exec(bContext *C, wmOperator *)
static wmOperatorStatus graphkeys_create_ghostcurves_exec(bContext *C, wmOperator *)
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)
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 wmOperatorStatus graphkeys_viewall_exec(bContext *C, wmOperator *op)
static void create_ghost_curves(bAnimContext *ac, int start, int end)
static wmOperatorStatus graphkeys_previewrange_exec(bContext *C, wmOperator *)
static wmOperatorStatus graphkeys_view_selected_exec(bContext *C, wmOperator *op)
void * MEM_calloc_arrayN(size_t len, size_t size, const char *str)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
SpaceGraph_Runtime runtime
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
int WM_operator_smooth_viewtx_get(const wmOperator *op)