|
Blender V5.0
|
#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.
| void ANIM_center_frame | ( | bContext * | C, |
| int | smooth_viewtx ) |
Definition at line 768 of file anim_draw.cc.
References ATTR_FALLTHROUGH, BLI_rctf_size_x(), C, RenderData::cfra, CTX_data_scene(), CTX_wm_region(), View2D::cur, find_prev_next_keyframes(), Scene::r, U, 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 blender::ed::vse::sequencer_view_frame_exec().
| void ANIM_draw_action_framerange | ( | AnimData * | adt, |
| bAction * | action, | ||
| 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 207 of file anim_draw.cc.
References ACT_FRAME_RANGE, BKE_nla_tweakedit_remap(), CLAMP_MAX, CLAMP_MIN, View2D::cur, bAction::flag, bAction::frame_end, bAction::frame_start, GPU_blend(), GPU_BLEND_ALPHA, GPU_BLEND_NONE, GPU_line_width(), GPU_PRIM_LINES, GPU_SHADER_2D_DIAG_STRIPES, GPU_SHADER_3D_UNIFORM_COLOR, GPU_vertformat_attr_add(), immBegin(), immBindBuiltinProgram(), immEnd(), immRectf(), immUnbindProgram(), immUniform1i(), immUniform4f(), immUniformThemeColorShade(), immVertex2f(), immVertexFormat(), NLATIME_CONVERT_MAP, pos, TH_BACK, UI_GetThemeColorShadeAlpha4fv(), UI_SCALE_FAC, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by action_main_region_draw(), draw_channel_action_ranges(), and draw_nla_main_data().
General call for drawing current frame indicator in animation editor.
Definition at line 54 of file anim_draw.cc.
References C, RenderData::cfra, CTX_data_scene(), View2D::cur, DRAWCFRA_WIDE, flag, float, RenderData::framelen, GPU_line_width(), GPU_PRIM_LINES, GPU_SHADER_3D_UNIFORM_COLOR, GPU_vertformat_attr_add(), immBegin(), immBindBuiltinProgram(), immEnd(), immUnbindProgram(), immUniformThemeColor(), immVertex2f(), immVertexFormat(), pos, Scene::r, RenderData::subframe, TH_CFRAME, 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.
Definition at line 171 of file anim_draw.cc.
References View2D::cur, RenderData::efra, GPU_blend(), GPU_BLEND_ALPHA, GPU_BLEND_NONE, GPU_PRIM_LINES, GPU_SHADER_3D_UNIFORM_COLOR, GPU_vertformat_attr_add(), immBegin(), immBindBuiltinProgram(), immEnd(), immRectf(), immUnbindProgram(), immUniformThemeColorShade(), immUniformThemeColorShadeAlpha(), immVertex2f(), immVertexFormat(), pos, Scene::r, RenderData::sfra, TH_BACK, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by action_main_region_draw(), clip_draw_dopesheet_main(), clip_draw_graph(), graph_main_region_draw(), and nla_main_region_draw().
Draw preview range 'curtains' for highlighting where the animation data is.
Definition at line 82 of file anim_draw.cc.
References View2D::cur, GPU_blend(), GPU_BLEND_ALPHA, GPU_BLEND_NONE, GPU_SHADER_3D_UNIFORM_COLOR, GPU_vertformat_attr_add(), immBindBuiltinProgram(), immRectf(), immUnbindProgram(), immUniformThemeColorShadeAlpha(), immVertexFormat(), RenderData::pefra, pos, PRVRANGEON, RenderData::psfra, Scene::r, TH_ANIM_PREVIEW_RANGE, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by action_main_region_draw(), clip_draw_dopesheet_main(), clip_draw_graph(), blender::ed::vse::draw_timeline_seq(), graph_main_region_draw(), and nla_main_region_draw().
Draw range of the current sequencer scene strip when using scene time syncing.
Definition at line 113 of file anim_draw.cc.
References ADS_OVERLAY_SHOW_OVERLAYS, ADS_SHOW_SCENE_STRIP_FRAME_RANGE, C, CTX_wm_space_action(), CTX_wm_workspace(), View2D::cur, SpaceActionOverlays::flag, WorkSpace::flags, blender::ed::vse::get_scene_strip_for_time_sync(), blender::seq::give_frame_index(), GPU_blend(), GPU_BLEND_ALPHA, GPU_BLEND_NONE, GPU_SHADER_3D_UNIFORM_COLOR, GPU_vertformat_attr_add(), immBindBuiltinProgram(), immRectf(), immUnbindProgram(), immUniformThemeColorShadeAlpha(), immVertexFormat(), SpaceAction::overlays, pos, Scene::r, Strip::scene, WorkSpace::sequencer_scene, RenderData::sfra, TH_ANIM_SCENE_STRIP_RANGE, blender::seq::time_left_handle_frame_get(), blender::seq::time_right_handle_frame_get(), WORKSPACE_SYNC_SCENE_TIME, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by action_main_region_draw().
Add horizontal margin to the rectangle.
This function assumes that the X-min/X-max are set to a frame range to show.
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().
| short ANIM_get_normalization_flags | ( | SpaceLink * | space_link | ) |
Get flags used for normalization in ANIM_unit_mapping_get_factor.
Definition at line 415 of file anim_draw.cc.
References ANIM_UNITCONV_NORMALIZE, ANIM_UNITCONV_NORMALIZE_FREEZE, SpaceGraph::flag, SIPO_NORMALIZE, SIPO_NORMALIZE_FREEZE, SPACE_GRAPH, and SpaceLink::spacetype.
Referenced by create_ghost_curves(), blender::ed::transform::createTransGraphEditData(), draw_fcurve(), draw_fcurve_curve(), draw_fcurve_curve_keys(), draw_fcurve_curve_samples(), get_graph_keyframe_extents(), get_nearest_fcurve_verts_list(), get_normalized_fcurve_bounds(), 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().
| bool ANIM_nla_mapping_allowed | ( | const bAnimListElem * | ale | ) |
Check whether NLA time remapping should be done on this bAnimListElem.
Definition at line 274 of file anim_draw.cc.
References ANIMTYPE_DSGPENCIL, ANIMTYPE_FCURVE, ANIMTYPE_GPLAYER, ANIMTYPE_GREASE_PENCIL_DATABLOCK, ANIMTYPE_GREASE_PENCIL_LAYER, ANIMTYPE_GREASE_PENCIL_LAYER_GROUP, ANIMTYPE_MASKDATABLOCK, ANIMTYPE_MASKLAYER, ANIMTYPE_NLACURVE, ANIMTYPE_SUMMARY, FCurve::driver, bAnimListElem::key_data, and bAnimListElem::type.
Referenced by action_slot_summary_to_keylist(), actkeys_list_element_to_keylist(), ANIM_nla_mapping_apply_if_needed_fcurve(), ANIM_nla_tweakedit_remap(), blender::ed::transform::bezt_to_transdata(), box_select_action(), cachefile_to_keylist(), draw_fcurve(), ED_add_fcurve_channel(), keylist_from_graph_editor(), ob_to_keylist(), region_select_action_keys(), scene_to_keylist(), summary_to_keylist(), and blender::ed::transform::TimeToTransData().
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. |
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().
| void ANIM_nla_mapping_apply_if_needed_fcurve | ( | bAnimListElem * | ale, |
| FCurve * | fcu, | ||
| bool | restore, | ||
| bool | only_keys ) |
Same as above, but only if ANIM_nla_mapping_allowed(ale) returns true.
Definition at line 401 of file anim_draw.cc.
References bAnimListElem::adt, ANIM_nla_mapping_allowed(), and ANIM_nla_mapping_apply_fcurve().
Referenced by actkeys_framejump_exec(), actkeys_select_leftright(), box_select_graphkeys(), draw_fcurve(), get_nearest_fcurve_verts_list(), graphkeys_select_leftright(), markers_selectkeys_between(), markers_selectkeys_between(), mirror_action_keys(), mirror_graph_keys(), paste_animedit_keys(), blender::ed::transform::posttrans_action_clean(), snap_action_keys(), snap_graph_keys(), blender::ed::transform::special_aftertrans_update__actedit(), blender::ed::transform::special_aftertrans_update__graph(), and sum_selected_keyframes().
| float ANIM_nla_tweakedit_remap | ( | bAnimListElem * | ale, |
| float | cframe, | ||
| eNlaTime_ConvertModes | mode ) |
Do NLA time remapping, but only if ANIM_nla_mapping_allowed(ale) returns true.
Definition at line 324 of file anim_draw.cc.
References bAnimListElem::adt, ANIM_nla_mapping_allowed(), and BKE_nla_tweakedit_remap().
Referenced by actkeys_find_key_in_list_element(), actkeys_mselect_column(), bezt_to_cfraelem(), blender::ed::transform::bezt_to_transdata(), box_select_action(), channels_bake_exec(), columnselect_action_keys(), columnselect_graph_keys(), create_ghost_curves(), blender::ed::transform::createTransActionData(), blender::ed::transform::createTransGraphEditData(), draw_fcurve_modifier_controls_envelope(), get_channel_bounds(), get_graph_keyframe_extents(), get_keyframe_extents(), graphkeys_click_insert_exec(), graphkeys_mselect_column(), insert_graph_keys(), rectf_curve_intersection(), region_select_action_keys(), summary_keyframes_loop(), and blender::ed::transform::TimeToTransData().
| float ANIM_unit_mapping_get_factor | ( | Scene * | scene, |
| ID * | id, | ||
| FCurve * | fcu, | ||
| short | flag, | ||
| float * | r_offset ) |
Get unit conversion factor for given ID + F-Curve.
Definition at line 624 of file anim_draw.cc.
References ANIM_UNITCONV_NORMALIZE, ANIM_UNITCONV_RESTORE, DEG2RADF, flag, 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, UnitSettings::system_rotation, Scene::unit, and USER_UNIT_ROT_RADIANS.
Referenced by box_select_graphcurves(), box_select_graphkeys(), create_ghost_curves(), blender::ed::transform::createTransGraphEditData(), draw_fcurve(), draw_fcurve_curve(), draw_fcurve_curve_keys(), draw_fcurve_curve_samples(), get_graph_keyframe_extents(), get_nearest_fcurve_verts_list(), get_normalized_fcurve_bounds(), graph_draw_driver_debug(), graphkeys_click_insert_exec(), insert_graph_keys(), mirror_graph_keys(), snap_graph_keys(), sum_selected_keyframes(), and blender::animrig::tests::TEST_F().
|
static |
Definition at line 357 of file anim_draw.cc.
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 338 of file anim_draw.cc.
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 429 of file anim_draw.cc.
References FCurve::bezt, BEZT_IPO_BACK, BEZT_IPO_BEZ, BEZT_IPO_ELASTIC, BKE_curve_forward_diff_bezier(), BKE_fcurve_bezt_binarysearch_index(), BKE_fcurve_correct_bezpart(), data, FCurve::driver, ELEM, evaluate_fcurve_only_curve(), FLT_MAX, FCurve::fpt, i, BezTriple::ipo, len_v2v2(), max_ff(), max_ii(), min_ff(), min_ii(), RenderData::pefra, PRVRANGEON, RenderData::psfra, Scene::r, FCurve::totvert, v2, BezTriple::vec, and FPoint::vec.
Referenced by normalization_factor_get().
|
static |
Definition at line 671 of file anim_draw.cc.
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, FLT_MAX, Scene::gpd, gpencil_to_keylist(), mask(), mask_to_keylist(), ob_to_keylist(), Scene::r, SCE_KEYS_NO_SELONLY, scene_to_keylist(), and U.
Referenced by ANIM_center_frame().
Definition at line 556 of file anim_draw.cc.
References ANIM_UNITCONV_NORMALIZE_FREEZE, ANIM_UNITCONV_RESTORE, BLI_assert, fcurve_scene_coord_range_get(), flag, FLT_MAX, G, G_TRANSFORM_FCURVES, FCurve::prev_norm_factor, FCurve::prev_offset, and ulp_diff_ff().
Referenced by ANIM_unit_mapping_get_factor().