Blender
V3.3
|
#include "BLI_sys_types.h"
#include "DNA_anim_types.h"
#include "DNA_gpencil_types.h"
#include "DNA_mask_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
#include "DNA_userdef_types.h"
#include "BLI_dlrbTree.h"
#include "BLI_math.h"
#include "BLI_rect.h"
#include "BLI_timecode.h"
#include "BLI_utildefines.h"
#include "BKE_context.h"
#include "BKE_curve.h"
#include "BKE_fcurve.h"
#include "BKE_global.h"
#include "BKE_mask.h"
#include "BKE_nla.h"
#include "ED_anim_api.h"
#include "ED_keyframes_draw.h"
#include "ED_keyframes_edit.h"
#include "ED_keyframes_keylist.h"
#include "RNA_access.h"
#include "RNA_path.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "UI_view2d.h"
#include "GPU_immediate.h"
#include "GPU_matrix.h"
#include "GPU_state.h"
Go to the source code of this file.
Definition at line 619 of file anim_draw.c.
References ATTR_FALLTHROUGH, BLI_rctf_size_x(), C, RenderData::cfra, CTX_data_scene(), CTX_wm_region(), View2D::cur, find_prev_next_keyframes(), FPS, Scene::r, scene, UI_view2d_smooth_view(), ARegion::v2d, w(), rctf::xmax, rctf::xmin, rctf::ymax, rctf::ymin, ZOOM_FRAME_MODE_KEEP_RANGE, ZOOM_FRAME_MODE_KEYFRAMES, and ZOOM_FRAME_MODE_SECONDS.
Referenced by actkeys_view_frame_exec(), graphkeys_view_frame_exec(), nlaedit_viewframe_exec(), and sequencer_view_frame_exec().
void ANIM_draw_action_framerange | ( | struct AnimData * | adt, |
struct bAction * | action, | ||
struct View2D * | v2d, | ||
float | ymin, | ||
float | ymax | ||
) |
Draw manually set intended playback frame range guides for the action in the background. Allows specifying a subset of the Y range of the view.
Definition at line 149 of file anim_draw.c.
References ACT_FRAME_RANGE, BKE_nla_tweakedit_remap(), CLAMP_MAX, CLAMP_MIN, color, View2D::cur, bAction::flag, bAction::frame_end, bAction::frame_start, GPU_blend(), GPU_BLEND_ALPHA, GPU_BLEND_NONE, GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_line_width(), GPU_PRIM_LINES, GPU_SHADER_2D_DIAG_STRIPES, GPU_SHADER_2D_UNIFORM_COLOR, GPU_vertformat_attr_add(), immBegin(), immBindBuiltinProgram(), immEnd(), immRectf(), immUnbindProgram(), immUniform1i(), immUniform4f(), immUniformThemeColorShade(), immVertex2f(), immVertexFormat(), NLATIME_CONVERT_MAP, pos, TH_BACK, UI_GetThemeColorShadeAlpha4fv(), rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by action_main_region_draw(), draw_channel_action_ranges(), and draw_nla_main_data().
Definition at line 51 of file anim_draw.c.
References C, RenderData::cfra, CTX_data_scene(), View2D::cur, DRAWCFRA_WIDE, float(), RenderData::framelen, GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_line_width(), GPU_PRIM_LINES, GPU_SHADER_2D_UNIFORM_COLOR, GPU_vertformat_attr_add(), immBegin(), immBindBuiltinProgram(), immEnd(), immUnbindProgram(), immUniformThemeColor(), immVertex2f(), immVertexFormat(), pos, Scene::r, scene, RenderData::subframe, TH_CFRAME, time, x, rctf::ymax, and rctf::ymin.
Referenced by dopesheet_region_draw(), and graph_region_draw().
Draw frame range guides (for scene frame range) in background.
TODO: Should we still show these when preview range is enabled?
Definition at line 113 of file anim_draw.c.
References View2D::cur, RenderData::efra, GPU_blend(), GPU_BLEND_ALPHA, GPU_BLEND_NONE, GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_PRIM_LINES, GPU_SHADER_2D_UNIFORM_COLOR, GPU_vertformat_attr_add(), immBegin(), immBindBuiltinProgram(), immEnd(), immRectf(), immUnbindProgram(), immUniformThemeColorShade(), immUniformThemeColorShadeAlpha(), immVertex2f(), immVertexFormat(), pos, Scene::r, scene, RenderData::sfra, TH_BACK, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by action_main_region_draw(), graph_main_region_draw(), and nla_main_region_draw().
Definition at line 79 of file anim_draw.c.
References C, CTX_data_scene(), View2D::cur, GPU_blend(), GPU_BLEND_ALPHA, GPU_BLEND_NONE, GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_SHADER_2D_UNIFORM_COLOR, GPU_vertformat_attr_add(), immBindBuiltinProgram(), immRectf(), immUnbindProgram(), immUniformThemeColorShadeAlpha(), immVertexFormat(), PEFRA, pos, PRVRANGEON, PSFRA, scene, TH_ANIM_PREVIEW_RANGE, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by action_main_region_draw(), draw_timeline_seq(), graph_main_region_draw(), and nla_main_region_draw().
short ANIM_get_normalization_flags | ( | bAnimContext * | ac | ) |
Get flags used for normalization in ANIM_unit_mapping_get_factor.
Definition at line 318 of file anim_draw.c.
References ANIM_UNITCONV_NORMALIZE, ANIM_UNITCONV_NORMALIZE_FREEZE, SpaceGraph::flag, SIPO_NORMALIZE, SIPO_NORMALIZE_FREEZE, bAnimContext::sl, SPACE_GRAPH, and SpaceLink::spacetype.
Referenced by draw_fcurve(), draw_fcurve_curve(), draw_fcurve_curve_bezts(), draw_fcurve_curve_samples(), get_nearest_fcurve_verts_list(), graph_draw_driver_debug(), graphkeys_click_insert_exec(), initialize_box_select_key_editing_data(), insert_graph_keys(), mirror_graph_keys(), snap_graph_keys(), and sum_selected_keyframes().
void ANIM_nla_mapping_apply_fcurve | ( | struct AnimData * | adt, |
struct FCurve * | fcu, | ||
bool | restore, | ||
bool | only_keys | ||
) |
Apply/Unapply NLA mapping to all keyframes in the nominated F-Curve
restore | Whether to map points back to non-mapped time. |
only_keys | Whether to only adjust the location of the center point of beztriples. |
Definition at line 291 of file anim_draw.c.
References ANIM_fcurve_keyframes_loop(), bezt_nlamapping_apply(), bezt_nlamapping_restore(), KeyframeEditData::data, KeyframeEditData::i1, and NULL.
Referenced by actkeys_framejump_exec(), actkeys_select_leftright(), box_select_graphkeys(), draw_fcurve(), fcurve_to_keylist(), get_nearest_fcurve_verts_list(), graphkeys_select_leftright(), markers_selectkeys_between(), mirror_action_keys(), mirror_graph_keys(), paste_animedit_keys(), posttrans_action_clean(), snap_action_keys(), snap_graph_keys(), special_aftertrans_update__actedit(), special_aftertrans_update__graph(), and sum_selected_keyframes().
AnimData* ANIM_nla_mapping_get | ( | bAnimContext * | ac, |
bAnimListElem * | ale | ||
) |
Obtain the AnimData block providing NLA-mapping for the given channel (if applicable).
TODO: do not supply return this if the animdata tells us that there is no mapping to perform.
Definition at line 216 of file anim_draw.c.
References bAnimListElem::adt, ANIMCONT_ACTION, ANIMCONT_CHANNEL, ANIMCONT_DOPESHEET, ANIMCONT_FCURVES, ANIMCONT_NLA, ANIMCONT_SHAPEKEY, ANIMTYPE_NLACURVE, bAnimContext::datatype, ELEM, G, NULL, and bAnimListElem::type.
Referenced by actkeys_find_key_in_list_element(), actkeys_framejump_exec(), actkeys_list_element_to_keylist(), actkeys_mselect_column(), actkeys_select_leftright(), box_select_action(), box_select_graphcurves(), box_select_graphkeys(), columnselect_action_keys(), columnselect_graph_keys(), createTransActionData(), draw_channel_strips(), draw_fcurve(), get_keyframe_extents(), get_nearest_fcurve_verts_list(), graphkeys_click_insert_exec(), graphkeys_mselect_column(), graphkeys_select_leftright(), insert_fcurve_key(), insert_graph_keys(), markers_selectkeys_between(), mirror_action_keys(), mirror_graph_keys(), paste_animedit_keys(), posttrans_action_clean(), region_select_action_keys(), snap_action_keys(), snap_graph_keys(), special_aftertrans_update__actedit(), special_aftertrans_update__graph(), sum_selected_keyframes(), and summary_keyframes_loop().
float ANIM_unit_mapping_get_factor | ( | struct Scene * | scene, |
struct ID * | id, | ||
struct FCurve * | fcu, | ||
short | flag, | ||
float * | r_offset | ||
) |
Get unit conversion factor for given ID + F-Curve.
Definition at line 485 of file anim_draw.c.
References ANIM_UNITCONV_NORMALIZE, ANIM_UNITCONV_RESTORE, DEG2RADF, normalization_factor_get(), PROP_UNIT_ROTATION, ptr, RAD2DEGF, RNA_id_pointer_create(), FCurve::rna_path, RNA_path_resolve_property(), RNA_property_subtype(), RNA_SUBTYPE_UNIT, scene, UnitSettings::system_rotation, Scene::unit, and USER_UNIT_ROT_RADIANS.
Referenced by box_select_graphcurves(), box_select_graphkeys(), draw_fcurve(), draw_fcurve_curve(), draw_fcurve_curve_bezts(), draw_fcurve_curve_samples(), get_nearest_fcurve_verts_list(), graph_draw_driver_debug(), graphkeys_click_insert_exec(), insert_graph_keys(), mirror_graph_keys(), snap_graph_keys(), and sum_selected_keyframes().
|
static |
Definition at line 274 of file anim_draw.c.
References BKE_nla_tweakedit_remap(), KeyframeEditData::data, KeyframeEditData::i1, NLATIME_CONVERT_MAP, and BezTriple::vec.
Referenced by ANIM_nla_mapping_apply_fcurve().
|
static |
Definition at line 255 of file anim_draw.c.
References BKE_nla_tweakedit_remap(), KeyframeEditData::data, KeyframeEditData::i1, NLATIME_CONVERT_UNMAP, and BezTriple::vec.
Referenced by ANIM_nla_mapping_apply_fcurve().
|
static |
Definition at line 522 of file anim_draw.c.
References ADS_FILTER_ONLYSEL, BKE_mask_layer_active(), C, ActKeyColumn::cfra, RenderData::cfra, CTX_data_active_object(), CTX_data_edit_mask(), CTX_data_scene(), Object::data, ED_keylist_create(), ED_keylist_find_next(), ED_keylist_find_prev(), ED_keylist_free(), ED_keylist_prepare_for_direct_access(), bDopeSheet::filterflag, Scene::flag, float(), Scene::gpd, gpencil_to_keylist(), mask(), mask_to_keylist(), NULL, ob_to_keylist(), Scene::r, SCE_KEYS_NO_SELONLY, scene, and scene_to_keylist().
Referenced by ANIM_center_frame().
|
static |
Definition at line 332 of file anim_draw.c.
References ANIM_UNITCONV_NORMALIZE_FREEZE, ANIM_UNITCONV_RESTORE, FCurve::bezt, BEZT_IPO_BACK, BEZT_IPO_BEZ, BEZT_IPO_ELASTIC, BKE_curve_forward_diff_bezier(), BKE_fcurve_correct_bezpart(), BLI_assert, data, FCurve::driver, ELEM, evaluate_fcurve_only_curve(), G, G_TRANSFORM_FCURVES, IN_RANGE_INCL, BezTriple::ipo, len_v2v2(), max_ff(), min_ff(), min_ii(), offset, RenderData::pefra, FCurve::prev_norm_factor, FCurve::prev_offset, PRVRANGEON, RenderData::psfra, Scene::r, scene, FCurve::totvert, v1, v2, and BezTriple::vec.
Referenced by ANIM_unit_mapping_get_factor().