Blender V5.0
anim_draw.cc File Reference
#include "BLI_sys_types.h"
#include "DNA_anim_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_sequence_types.h"
#include "DNA_space_types.h"
#include "DNA_userdef_types.h"
#include "DNA_workspace_types.h"
#include "BLI_listbase.h"
#include "BLI_math_rotation.h"
#include "BLI_math_vector.h"
#include "BLI_rect.h"
#include "BLI_utildefines.h"
#include "BKE_context.hh"
#include "BKE_curve.hh"
#include "BKE_fcurve.hh"
#include "BKE_global.hh"
#include "BKE_mask.h"
#include "BKE_nla.hh"
#include "ED_anim_api.hh"
#include "ED_keyframes_edit.hh"
#include "ED_keyframes_keylist.hh"
#include "ED_sequencer.hh"
#include "RNA_access.hh"
#include "RNA_path.hh"
#include "UI_resources.hh"
#include "UI_view2d.hh"
#include "GPU_immediate.hh"
#include "GPU_state.hh"
#include "SEQ_time.hh"
#include <utility>

Go to the source code of this file.

Functions

void ANIM_draw_cfra (const bContext *C, View2D *v2d, short flag)
void ANIM_draw_previewrange (const Scene *scene, View2D *v2d, int end_frame_width)
void ANIM_draw_scene_strip_range (const bContext *C, View2D *v2d)
void ANIM_draw_framerange (Scene *scene, View2D *v2d)
void ANIM_draw_action_framerange (AnimData *adt, bAction *action, View2D *v2d, float ymin, float ymax)
bool ANIM_nla_mapping_allowed (const bAnimListElem *ale)
float ANIM_nla_tweakedit_remap (bAnimListElem *ale, const float cframe, const eNlaTime_ConvertModes mode)
static short bezt_nlamapping_restore (KeyframeEditData *ked, BezTriple *bezt)
static short bezt_nlamapping_apply (KeyframeEditData *ked, BezTriple *bezt)
void ANIM_nla_mapping_apply_fcurve (AnimData *adt, FCurve *fcu, bool restore, bool only_keys)
void ANIM_nla_mapping_apply_if_needed_fcurve (bAnimListElem *ale, FCurve *fcu, const bool restore, const bool only_keys)
short ANIM_get_normalization_flags (SpaceLink *space_link)
static void fcurve_scene_coord_range_get (Scene *scene, const FCurve *fcu, float *r_min_coord, float *r_max_coord)
static float normalization_factor_get (Scene *scene, FCurve *fcu, short flag, float *r_offset)
float ANIM_unit_mapping_get_factor (Scene *scene, ID *id, FCurve *fcu, short flag, float *r_offset)
static bool find_prev_next_keyframes (bContext *C, int *r_nextfra, int *r_prevfra)
void ANIM_center_frame (bContext *C, int smooth_viewtx)
rctf ANIM_frame_range_view2d_add_xmargin (const View2D &view_2d, const rctf view_rect)

Function Documentation

◆ ANIM_center_frame()

◆ ANIM_draw_action_framerange()

◆ ANIM_draw_cfra()

◆ ANIM_draw_framerange()

◆ ANIM_draw_previewrange()

◆ ANIM_draw_scene_strip_range()

◆ ANIM_frame_range_view2d_add_xmargin()

rctf ANIM_frame_range_view2d_add_xmargin ( const View2D & view_2d,
rctf view_rect )

Add horizontal margin to the rectangle.

This function assumes that the X-min/X-max are set to a frame range to show.

Returns
The new rectangle with horizontal margin added, for visual comfort.

Definition at line 811 of file anim_draw.cc.

References BLI_rctf_size_x(), BLI_rcti_size_x(), View2D::mask, UI_SCALE_FAC, rctf::xmax, and rctf::xmin.

Referenced by actkeys_viewall(), graphkeys_viewall(), and scene_range_frame_exec().

◆ ANIM_get_normalization_flags()

◆ ANIM_nla_mapping_allowed()

◆ ANIM_nla_mapping_apply_fcurve()

void ANIM_nla_mapping_apply_fcurve ( AnimData * adt,
FCurve * fcu,
bool restore,
bool only_keys )

Apply/Unapply NLA mapping to all keyframes in the nominated F-Curve

Parameters
restoreWhether to map points back to non-mapped time.
only_keysWhether to only adjust the location of the center point of beztriples.

TODO: this is only used by fcurve_to_keylist() at this point. Perhaps with some refactoring we can make fcurve_to_keylist() use ANIM_nla_mapping_apply_if_needed_fcurve() instead, and then we can get rid of this.

Definition at line 374 of file anim_draw.cc.

References ANIM_fcurve_keyframes_loop(), bezt_nlamapping_apply(), bezt_nlamapping_restore(), BLI_listbase_is_empty(), KeyframeEditData::data, KeyframeEditData::i1, and AnimData::nla_tracks.

Referenced by ANIM_nla_mapping_apply_if_needed_fcurve(), and fcurve_to_keylist().

◆ ANIM_nla_mapping_apply_if_needed_fcurve()

◆ ANIM_nla_tweakedit_remap()

◆ ANIM_unit_mapping_get_factor()

◆ bezt_nlamapping_apply()

short bezt_nlamapping_apply ( KeyframeEditData * ked,
BezTriple * bezt )
static

◆ bezt_nlamapping_restore()

short bezt_nlamapping_restore ( KeyframeEditData * ked,
BezTriple * bezt )
static

◆ fcurve_scene_coord_range_get()

◆ find_prev_next_keyframes()

◆ normalization_factor_get()

float normalization_factor_get ( Scene * scene,
FCurve * fcu,
short flag,
float * r_offset )
static