|
Blender
V2.93
|
#include <float.h>#include <math.h>#include <stdio.h>#include <string.h>#include "BLI_blenlib.h"#include "BLI_math.h"#include "BLI_utildefines.h"#include "DNA_anim_types.h"#include "DNA_screen_types.h"#include "DNA_space_types.h"#include "DNA_userdef_types.h"#include "DNA_windowmanager_types.h"#include "BKE_action.h"#include "BKE_anim_data.h"#include "BKE_context.h"#include "BKE_curve.h"#include "BKE_fcurve.h"#include "BKE_nla.h"#include "GPU_immediate.h"#include "GPU_matrix.h"#include "GPU_state.h"#include "ED_anim_api.h"#include "graph_intern.h"#include "UI_interface.h"#include "UI_resources.h"#include "UI_view2d.h"Go to the source code of this file.
Functions | |
FCurve Modifier Drawing | |
| static void | graph_draw_driver_debug (bAnimContext *ac, ID *id, FCurve *fcu) |
| static void | draw_fcurve_modifier_controls_envelope (FModifier *fcm, View2D *v2d, AnimData *adt_nla_remap) |
| static void | set_fcurve_vertex_color (FCurve *fcu, bool sel) |
| static void | draw_fcurve_selected_keyframe_vertices (FCurve *fcu, View2D *v2d, bool edit, bool sel, uint pos) |
| static void | draw_fcurve_active_vertex (const FCurve *fcu, const View2D *v2d, const uint pos) |
| static void | draw_fcurve_keyframe_vertices (FCurve *fcu, View2D *v2d, bool edit, uint pos) |
| static void | draw_fcurve_selected_handle_vertices (FCurve *fcu, View2D *v2d, bool sel, bool sel_handle_only, uint pos) |
| static void | draw_fcurve_active_handle_vertices (const FCurve *fcu, const bool sel_handle_only, const uint pos) |
| static void | draw_fcurve_handle_vertices (FCurve *fcu, View2D *v2d, bool sel_handle_only, uint pos) |
| static void | draw_fcurve_vertices (ARegion *region, FCurve *fcu, bool do_handles, bool sel_handle_only) |
| static bool | draw_fcurve_handles_check (SpaceGraph *sipo, FCurve *fcu) |
| static void | draw_fcurve_handles (SpaceGraph *sipo, FCurve *fcu) |
| static void | draw_fcurve_sample_control (float x, float y, float xscale, float yscale, float hsize, uint pos) |
| static void | draw_fcurve_samples (SpaceGraph *sipo, ARegion *region, FCurve *fcu) |
| static void | draw_fcurve_curve (bAnimContext *ac, ID *id, FCurve *fcu_, View2D *v2d, uint pos, const bool use_nla_remap, const bool draw_extrapolation) |
| static void | draw_fcurve_curve_samples (bAnimContext *ac, ID *id, FCurve *fcu, View2D *v2d, const uint shdr_pos, const bool draw_extrapolation) |
| static bool | fcurve_can_use_simple_bezt_drawing (FCurve *fcu) |
| static void | draw_fcurve_curve_bezts (bAnimContext *ac, ID *id, FCurve *fcu, View2D *v2d, uint pos, const bool draw_extrapolation) |
| static void | draw_fcurve (bAnimContext *ac, SpaceGraph *sipo, ARegion *region, bAnimListElem *ale) |
| void | graph_draw_ghost_curves (bAnimContext *ac, SpaceGraph *sipo, ARegion *region) |
| void | graph_draw_curves (bAnimContext *ac, SpaceGraph *sipo, ARegion *region, short sel) |
Utility Drawing Defines | |
| static float | fcurve_display_alpha (FCurve *fcu) |
Channel List | |
| void | graph_draw_channel_names (bContext *C, bAnimContext *ac, ARegion *region) |
|
static |
We have to do this mapping dance since the keyframes were remapped but the Fmodifier evaluations are not.
So we undo the keyframe remapping and instead remap the evaluation time when drawing the curve itself. Afterward, we go back and redo the keyframe remapping so the controls are drawn properly.
Definition at line 1024 of file graph_draw.c.
References AGRP_MUTED, ANIM_get_normalization_flags(), ANIM_nla_mapping_apply_fcurve(), ANIM_nla_mapping_get(), ANIM_unit_mapping_get_factor(), ANIMCONT_DRIVERS, FCurve::bezt, BKE_fcurve_are_keyframes_usable(), BKE_fcurve_is_protected(), FCurve::color, bAnimContext::datatype, draw_fcurve_curve(), draw_fcurve_curve_bezts(), draw_fcurve_curve_samples(), draw_fcurve_handles(), draw_fcurve_handles_check(), draw_fcurve_modifier_controls_envelope(), draw_fcurve_samples(), draw_fcurve_vertices(), FCURVE_ACTIVE, fcurve_can_use_simple_bezt_drawing(), fcurve_display_alpha(), FCURVE_INT_VALUES, FCURVE_MUTED, FCURVE_SELECTED, find_active_fmodifier(), ListBase::first, bActionGroup::flag, FCurve::flag, SpaceGraph::flag, FMODIFIER_TYPE_ENVELOPE, FCurve::fpt, GPU_blend(), GPU_BLEND_ALPHA, GPU_BLEND_NONE, GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_line_smooth(), GPU_line_width(), GPU_matrix_pop(), GPU_matrix_push(), GPU_matrix_scale_2f(), GPU_matrix_translate_2f(), GPU_SHADER_2D_LINE_DASHED_UNIFORM_COLOR, GPU_vertformat_attr_add(), GPU_viewport_size_get_f(), graph_draw_driver_debug(), FCurve::grp, bAnimListElem::id, immBindBuiltinProgram(), immUnbindProgram(), immUniform1f(), immUniform1i(), immUniform2f(), immUniformColor3fvAlpha(), immUniformThemeColorShade(), immVertexFormat(), bAnimListElem::key_data, FCurve::modifiers, bAnimContext::scene, SIPO_BEAUTYDRAW_OFF, SIPO_NO_DRAW_EXTRAPOLATION, SIPO_SELCUVERTSONLY, SIPO_SELVHANDLESONLY, TH_HEADER, FCurve::totvert, UI_DPI_FAC, and ARegion::v2d.
Referenced by graph_draw_curves().
|
static |
Draw the extra handles for the active point.
Definition at line 311 of file graph_draw.c.
References FCurve::bezt, BEZT_IPO_BEZ, BEZT_ISSEL_ANY, BKE_fcurve_active_keyframe_index(), BezTriple::f1, BezTriple::f3, FCURVE_ACTIVE, FCURVE_ACTIVE_KEYFRAME_NONE, FCurve::flag, GPU_PRIM_POINTS, immBeginAtMost(), immEnd(), immUniform4fv(), immUniformColor3fvAlpha(), immVertex2fv(), BezTriple::ipo, pos, SELECT, TH_VERTEX_ACTIVE, UI_GetThemeColor4fv(), and BezTriple::vec.
Referenced by draw_fcurve_handle_vertices().
|
static |
Draw the extra indicator for the active point.
Definition at line 225 of file graph_draw.c.
References FCurve::bezt, BKE_fcurve_active_keyframe_index(), BLI_rctf_size_x(), View2D::cur, BezTriple::f2, FCURVE_ACTIVE, FCURVE_ACTIVE_KEYFRAME_NONE, FCurve::flag, GPU_PRIM_POINTS, immBegin(), immEnd(), immUniformThemeColor(), immVertex2fv(), IN_RANGE, pos, SELECT, TH_VERTEX_ACTIVE, BezTriple::vec, rctf::xmax, and rctf::xmin.
Referenced by draw_fcurve_keyframe_vertices().
|
static |
Definition at line 583 of file graph_draw.c.
References ANIM_get_normalization_flags(), ANIM_unit_mapping_get_factor(), BKE_animdata_from_id(), BKE_fcurve_calc_range(), BKE_nla_tweakedit_remap(), View2D::cur, FCurve::driver, evaluate_fcurve(), SpaceGraph::flag, GPU_PRIM_LINE_STRIP, immBegin(), immEnd(), immVertex2f(), max_ff(), min_ff(), NLATIME_CONVERT_MAP, NLATIME_CONVERT_UNMAP, NULL, pos, bAnimContext::scene, SIPO_BEAUTYDRAW_OFF, bAnimContext::sl, SWAP, UI_view2d_scale_get_x(), rctf::xmax, and rctf::xmin.
Referenced by draw_fcurve().
|
static |
Definition at line 840 of file graph_draw.c.
References ANIM_get_normalization_flags(), ANIM_unit_mapping_get_factor(), FCurve::bezt, BEZT_IPO_BEZ, BEZT_IPO_CONST, BEZT_IPO_LIN, BKE_curve_forward_diff_bezier(), BKE_fcurve_correct_bezpart(), View2D::cur, data, FCurve::driver, FCurve::extend, FCURVE_EXTRAPOLATE_CONSTANT, FCURVE_INT_VALUES, FCurve::flag, GPU_matrix_pop(), GPU_matrix_push(), GPU_matrix_scale_2f(), GPU_matrix_translate_2f(), GPU_PRIM_LINE_STRIP, immBeginAtMost(), immEnd(), immVertex2fv(), BezTriple::ipo, len_v2v2(), pos, bAnimContext::scene, FCurve::totvert, v1, v2, BezTriple::vec, rctf::xmax, and rctf::xmin.
Referenced by draw_fcurve().
|
static |
Definition at line 723 of file graph_draw.c.
References ANIM_get_normalization_flags(), ANIM_unit_mapping_get_factor(), count, View2D::cur, FCurve::extend, FCURVE_EXTRAPOLATE_CONSTANT, FCURVE_INT_VALUES, FCurve::flag, FCurve::fpt, GPU_matrix_pop(), GPU_matrix_push(), GPU_matrix_scale_2f(), GPU_matrix_translate_2f(), GPU_PRIM_LINE_STRIP, if(), immBegin(), immEnd(), immVertex2fv(), bAnimContext::scene, FCurve::totvert, v, FPoint::vec, rctf::xmax, and rctf::xmin.
Referenced by draw_fcurve(), and graph_draw_ghost_curves().
|
static |
Definition at line 344 of file graph_draw.c.
References draw_fcurve_active_handle_vertices(), draw_fcurve_selected_handle_vertices(), GPU_SHADER_2D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_OUTLINE_AA, immBindBuiltinProgram(), immUnbindProgram(), immUniform1f(), pos, TH_HANDLE_VERTEX_SIZE, and UI_GetThemeValuef().
Referenced by draw_fcurve_vertices().
|
static |
Definition at line 418 of file graph_draw.c.
References FCurve::bezt, BEZT_IPO_BEZ, BEZT_ISSEL_ANY, col, BezTriple::f1, BezTriple::f2, BezTriple::f3, fcurve_display_alpha(), SpaceGraph::flag, GPU_blend(), GPU_BLEND_ALPHA, GPU_BLEND_NONE, GPU_COMP_F32, GPU_COMP_U8, GPU_FETCH_FLOAT, GPU_FETCH_INT_TO_FLOAT_UNIT, GPU_line_smooth(), GPU_PRIM_LINES, GPU_SHADER_2D_FLAT_COLOR, GPU_vertformat_attr_add(), BezTriple::h1, BezTriple::h2, immAttr4ubv(), immBeginAtMost(), immBindBuiltinProgram(), immEnd(), immUnbindProgram(), immVertex2fv(), immVertexFormat(), BezTriple::ipo, NULL, pos, SELECT, SIPO_BEAUTYDRAW_OFF, SIPO_SELVHANDLESONLY, TH_HANDLE_FREE, TH_HANDLE_SEL_FREE, FCurve::totvert, UI_GetThemeColor3ubv(), and BezTriple::vec.
Referenced by draw_fcurve().
|
static |
Definition at line 394 of file graph_draw.c.
References AGRP_PROTECTED, FCURVE_INT_VALUES, FCURVE_PROTECTED, bActionGroup::flag, FCurve::flag, SpaceGraph::flag, FCurve::grp, SIPO_NOHANDLES, and FCurve::totvert.
Referenced by draw_fcurve().
|
static |
Definition at line 249 of file graph_draw.c.
References draw_fcurve_active_vertex(), draw_fcurve_selected_keyframe_vertices(), GPU_SHADER_2D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_AA, immBindBuiltinProgram(), immUnbindProgram(), immUniform1f(), pos, TH_VERTEX_SIZE, and UI_GetThemeValuef().
Referenced by draw_fcurve_vertices().
|
static |
| adt_nla_remap | Send NULL if no NLA remapping necessary. |
Definition at line 84 of file graph_draw.c.
References BKE_nla_tweakedit_remap(), BLI_rctf_size_x(), View2D::cur, FModifier::data, FMod_Envelope::data, GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_line_width(), GPU_point_size(), GPU_PRIM_LINES, GPU_PRIM_POINTS, GPU_SHADER_2D_LINE_DASHED_UNIFORM_COLOR, GPU_SHADER_2D_UNIFORM_COLOR, GPU_vertformat_attr_add(), GPU_viewport_size_get_f(), immBegin(), immBeginAtMost(), immBindBuiltinProgram(), immEnd(), immUnbindProgram(), immUniform1f(), immUniform1i(), immUniform2f(), immUniformColor3f(), immVertex2f(), immVertexFormat(), IN_RANGE, FMod_Envelope::max, FMod_Envelope::midval, FMod_Envelope::min, NLATIME_CONVERT_MAP, FMod_Envelope::totvert, UI_DPI_FAC, rctf::xmax, and rctf::xmin.
Referenced by draw_fcurve().
|
static |
Definition at line 519 of file graph_draw.c.
References GPU_matrix_pop(), GPU_matrix_push(), GPU_matrix_scale_2f(), GPU_matrix_translate_2f(), GPU_PRIM_LINES, immBegin(), immEnd(), immVertex2f(), pos, x, and y.
Referenced by draw_fcurve_samples().
|
static |
Definition at line 541 of file graph_draw.c.
References draw_fcurve_sample_control(), FCURVE_SELECTED, FCurve::flag, SpaceGraph::flag, FCurve::fpt, GPU_blend(), GPU_BLEND_ALPHA, GPU_BLEND_NONE, GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_line_smooth(), GPU_SHADER_2D_UNIFORM_COLOR, GPU_vertformat_attr_add(), immBindBuiltinProgram(), immUnbindProgram(), immUniformThemeColor(), immVertexFormat(), NULL, pos, SIPO_BEAUTYDRAW_OFF, TH_TEXT, TH_TEXT_HI, TH_VERTEX_SIZE, FCurve::totvert, UI_GetThemeValuef(), UI_view2d_scale_get(), ARegion::v2d, and FPoint::vec.
Referenced by draw_fcurve().
|
static |
Definition at line 263 of file graph_draw.c.
References FCurve::bezt, BEZT_IPO_BEZ, BEZT_ISSEL_ANY, BezTriple::f1, BezTriple::f3, GPU_PRIM_POINTS, immBeginAtMost(), immEnd(), immUniform4f(), immUniformColor3fvAlpha(), immVertex2fv(), BezTriple::ipo, NULL, pos, SELECT, TH_HANDLE_VERTEX, TH_HANDLE_VERTEX_SELECT, FCurve::totvert, UI_GetThemeColor3fv(), and BezTriple::vec.
Referenced by draw_fcurve_handle_vertices().
|
static |
Definition at line 186 of file graph_draw.c.
References FCurve::bezt, BLI_rctf_size_x(), View2D::cur, BezTriple::f2, GPU_PRIM_POINTS, immBeginAtMost(), immEnd(), immVertex2fv(), IN_RANGE, pos, SELECT, set_fcurve_vertex_color(), FCurve::totvert, BezTriple::vec, rctf::xmax, and rctf::xmin.
Referenced by draw_fcurve_keyframe_vertices().
|
static |
Definition at line 360 of file graph_draw.c.
References draw_fcurve_handle_vertices(), draw_fcurve_keyframe_vertices(), FCURVE_PROTECTED, FCurve::flag, GPU_blend(), GPU_BLEND_ALPHA, GPU_BLEND_NONE, GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_program_point_size(), GPU_vertformat_attr_add(), immVertexFormat(), pos, and ARegion::v2d.
Referenced by draw_fcurve().
|
static |
Definition at line 825 of file graph_draw.c.
References FCurve::bezt, BEZT_IPO_BEZ, BEZT_IPO_CONST, BEZT_IPO_LIN, ELEM, and BezTriple::ipo.
Referenced by draw_fcurve().
Definition at line 67 of file graph_draw.c.
References FCURVE_SELECTED, and FCurve::flag.
Referenced by draw_fcurve(), draw_fcurve_handles(), and set_fcurve_vertex_color().
| void graph_draw_channel_names | ( | bContext * | C, |
| bAnimContext * | ac, | ||
| ARegion * | region | ||
| ) |
Definition at line 1411 of file graph_draw.c.
References ACHANNEL_FIRST_TOP, ACHANNEL_HEIGHT, ACHANNEL_STEP, ACHANNEL_TOT_HEIGHT, ANIM_animdata_filter(), ANIM_animdata_freelist(), ANIM_channel_draw(), ANIM_channel_draw_widgets(), ANIMFILTER_DATA_VISIBLE, ANIMFILTER_LIST_CHANNELS, ANIMFILTER_LIST_VISIBLE, BLI_rctf_init(), C, View2D::cur, bAnimContext::data, bAnimContext::datatype, filter(), ListBase::first, GPU_blend(), GPU_BLEND_ALPHA, GPU_BLEND_NONE, height, IN_RANGE, bAnimListElem::next, NULL, View2D::tot, UI_block_begin(), UI_block_draw(), UI_block_end(), UI_EMBOSS, ARegion::v2d, V2D_SCROLL_WIDTH, rctf::xmax, rctf::ymax, and rctf::ymin.
Referenced by graph_channel_region_draw().
| void graph_draw_curves | ( | bAnimContext * | ac, |
| SpaceGraph * | sipo, | ||
| ARegion * | region, | ||
| short | sel | ||
| ) |
Definition at line 1369 of file graph_draw.c.
References ANIM_animdata_filter(), ANIM_animdata_freelist(), ANIMFILTER_CURVE_VISIBLE, ANIMFILTER_DATA_VISIBLE, ANIMFILTER_SEL, ANIMFILTER_UNSEL, bAnimContext::data, bAnimContext::datatype, draw_fcurve(), FCURVE_ACTIVE, filter(), ListBase::first, FCurve::flag, if(), bAnimListElem::key_data, bAnimListElem::next, and NULL.
Referenced by graph_main_region_draw().
|
static |
Definition at line 1203 of file graph_draw.c.
References ANIM_get_normalization_flags(), ANIM_unit_mapping_get_factor(), BLI_listbase_is_empty(), FCurve::color, View2D::cur, ChannelDriver::curval, FCurve::curval, FCurve::driver, DRIVER_FLAG_INVALID, ChannelDriver::flag, GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_line_width(), GPU_point_size(), GPU_PRIM_LINES, GPU_PRIM_POINTS, GPU_SHADER_2D_LINE_DASHED_UNIFORM_COLOR, GPU_SHADER_2D_UNIFORM_COLOR, GPU_vertformat_attr_add(), GPU_viewport_size_get_f(), immBegin(), immBindBuiltinProgram(), immEnd(), immUnbindProgram(), immUniform1f(), immUniform1i(), immUniform2f(), immUniformColor3f(), immUniformColor3fv(), immVertex2f(), immVertex2fv(), immVertexFormat(), FCurve::modifiers, bAnimContext::region, bAnimContext::scene, t, FCurve::totvert, UI_DPI_FAC, ARegion::v2d, x, rctf::xmax, rctf::xmin, y, and rctf::ymin.
Referenced by draw_fcurve().
| void graph_draw_ghost_curves | ( | bAnimContext * | ac, |
| SpaceGraph * | sipo, | ||
| ARegion * | region | ||
| ) |
Definition at line 1319 of file graph_draw.c.
References FCurve::color, draw_fcurve_curve_samples(), ListBase::first, SpaceGraph::flag, SpaceGraph_Runtime::ghost_curves, GPU_blend(), GPU_BLEND_ALPHA, GPU_BLEND_NONE, GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_line_smooth(), GPU_line_width(), GPU_SHADER_2D_LINE_DASHED_UNIFORM_COLOR, GPU_vertformat_attr_add(), GPU_viewport_size_get_f(), immBindBuiltinProgram(), immUnbindProgram(), immUniform1f(), immUniform1i(), immUniform2f(), immUniformColor3fvAlpha(), immVertexFormat(), FCurve::next, NULL, SpaceGraph::runtime, SIPO_BEAUTYDRAW_OFF, SIPO_NO_DRAW_EXTRAPOLATION, UI_DPI_FAC, and ARegion::v2d.
Referenced by graph_main_region_draw().
|
static |
Definition at line 160 of file graph_draw.c.
References CLAMP, KDL::diff(), fcurve_display_alpha(), FCURVE_PROTECTED, FCurve::flag, immUniformColor4fv(), TH_TEXT, TH_TEXT_HI, TH_VERTEX, TH_VERTEX_SELECT, and UI_GetThemeColor3fv().
Referenced by draw_fcurve_selected_keyframe_vertices().