116 immRectf(pos_id, frame_range.
min, ymin + 2, frame_range.
max, ymax - 2);
121 uint key_len = keys->count();
129 format,
"color", gpu::VertAttrType::UNORM_8_8_8_8);
131 format,
"outlineColor", gpu::VertAttrType::UNORM_8_8_8_8);
169 NlaStrip *strip,
float yminc,
float ymaxc,
int shade,
const bool dashed)
182 float viewport_size[4];
244 switch (strip->
type) {
295 const float yheight = ymaxc - yminc;
321 for (
float cfra = strip->
start; cfra <= strip->end; cfra += 1.0f) {
371 float viewport_size[4];
431 const bool is_other_track_soloed = adt_has_solo_track && !is_track_solo;
434 float color[4] = {1.0f, 1.0f, 1.0f, 1.0f};
457 if (strip->
prev ==
nullptr) {
487 if (!is_other_track_soloed &&
is_nlastrip_enabled(adt, nlt, strip) && !is_invalid_location) {
530 if (is_invalid_location) {
572 for (
int i = 1; i < strip->
repeat; i++) {
573 float repeatPos = strip->
start + (repeatLen * i);
576 if (repeatPos < strip->end) {
587 const float y = (ymaxc - yminc) * 0.5f + yminc;
644 col[0] = col[1] = col[2] = 0;
647 col[0] = col[1] = col[2] = 255;
679 const float ytol = 1.0f;
680 const uchar col[4] = {220, 220, 220, 255};
708 if (nlt->
strips.is_empty()) {
709 ListBaseT<NlaStrip> empty = {
nullptr,
nullptr};
719 first = last = &strip;
724 const bool has_strips_within_bounds = first !=
nullptr;
726 if (has_strips_within_bounds) {
751 if (first_strip && v2d->
cur.
xmax < first_strip->
start &&
757 first = last = first_strip;
759 else if (last_strip && v2d->
cur.
xmin > last_strip->
end &&
765 first = last = last_strip;
774 first = last = strip.
prev;
782 ListBaseT<NlaStrip> visible_strips = {first, last};
783 return visible_strips;
790 const float text_margin_x = (8 *
UI_SCALE_FAC) * pixelx;
793 ListBaseT<bAnimListElem> anim_data = {
nullptr,
nullptr};
813 float ycenter = (ymax + ymin + 2 *
NLATRACK_SKIP - 1) / 2.0f;
827 for (
NlaStrip &strip : visible_nla_strips) {
828 const float xminc = strip.start + text_margin_x;
829 const float xmaxc = strip.end - text_margin_x;
884 if (ale->data ==
nullptr) {
906 static_cast<bAction *
>(ale->data),
974 const ListBaseT<bAnimListElem> &anim_data)
986 size_t track_index = 0;
1005 size_t track_index = 0;
1028 block_end(
C, block);
1029 block_draw(
C, block);
#define SNPRINTF_UTF8_RLEN(dst, format,...)
#define STRNCPY_UTF8_RLEN(dst, src)
#define NLATRACK_FIRST_TOP(ac)
#define NLATRACK_TOT_HEIGHT(ac, item_amount)
#define NLATRACK_STEP(snla)
#define NLATRACK_HEIGHT(snla)
#define IN_RANGE(a, b, c)
float2 get_frame_range() const ATTR_WARN_UNUSED_RESULT
BLI_INLINE Texture * wrap(MTLTexture *texture)
void get_color_3fv(int colorid, float col[3])
void get_color_4fv(int colorid, float col[4])
char char char char void view2d_text_cache_add(View2D *v2d, float x, float y, const char *str, size_t str_len, const unsigned char col[4])
void view2d_text_cache_add_rectf(View2D *v2d, const rctf *rect_view, const char *str, size_t str_len, const unsigned char col[4])
void draw_roundbox_corner_set(int type)
void view2d_sync(bScreen *screen, ScrArea *area, View2D *v2dcur, int flag)
void draw_roundbox_4fv(const rctf *rect, bool filled, float rad, const float col[4])
float nlastrip_get_frame(NlaStrip *strip, float cframe, short mode)
MINLINE float min_ff(float a, float b)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
void ANIM_channel_draw(bAnimContext *ac, bAnimListElem *ale, float yminc, float ymaxc, size_t channel_index)
void action_to_keylist(AnimData *adt, bAction *dna_action, AnimKeylist *keylist, const int saction_flag, float2 range)
static void nla_draw_strip(SpaceNla *snla, AnimData *adt, NlaTrack *nlt, NlaStrip *strip, View2D *v2d, float yminc, float ymaxc)
void draw_nla_track_list(const bContext *C, bAnimContext *ac, ARegion *region, const ListBaseT< bAnimListElem > &anim_data)
void immUniformColor3f(float r, float g, float b)
void ANIM_draw_action_framerange(AnimData *adt, bAction *action, View2D *v2d, float ymin, float ymax)
@ NLASTRIP_FLAG_USR_INFLUENCE
@ NLASTRIP_FLAG_TWEAKUSER
@ NLASTRIP_FLAG_INVALID_LOCATION
@ NLASTRIP_FLAG_TEMP_META
void draw_keyframe_shape(const float x, const float y, float size, const bool sel, const eBezTriple_KeyframeType key_type, const eKeyframeShapeDrawOpts mode, const float alpha, const KeyframeShaderBindings *sh_bindings, const short handle_type, const short extreme_type)
static void nla_draw_strip_frames_text(NlaTrack *, NlaStrip *strip, View2D *v2d, float, float ymaxc)
void immUniform2f(const char *name, float x, float y)
void immBeginAtMost(GPUPrimType, uint max_vertex_len)
@ NLASTRIP_EXTEND_NOTHING
@ NLASTRIP_EXTEND_HOLD_FORWARD
GPUVertFormat * immVertexFormat()
static uint nla_draw_use_dashed_outlines(const float color[4], bool muted)
void immBegin(GPUPrimType, uint vertex_len)
static bool is_nlastrip_enabled(AnimData *adt, NlaTrack *nlt, NlaStrip *strip)
void GPU_line_smooth(bool enable)
static void nla_draw_strip_curves(NlaStrip *strip, float yminc, float ymaxc, uint pos)
bool ED_keylist_is_empty(const AnimKeylist *keylist)
void immUniformColor4fv(const float rgba[4])
static ListBaseT< NlaStrip > get_visible_nla_strips(NlaTrack *nlt, View2D *v2d)
@ ANIMTYPE_GREASE_PENCIL_LAYER_GROUP
@ ANIMTYPE_GREASE_PENCIL_DATABLOCK
@ ANIMTYPE_GREASE_PENCIL_LAYER
@ ANIMTYPE_FILLACT_LAYERED
@ ANIMTYPE_SPECIALDATA__UNUSED
void GPU_line_width(float width)
void immBindBuiltinProgram(GPUBuiltinShader shader_id)
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
void BKE_nla_clip_length_ensure_nonzero(const float *actstart, float *r_actend)
VecBase< float, 2 > float2
void immUniform1f(const char *name, float x)
size_t ANIM_animdata_filter(bAnimContext *ac, ListBaseT< bAnimListElem > *anim_data, const eAnimFilter_Flags filter_mode, void *data, const eAnimCont_Types datatype)
void immVertex2f(uint attr_id, float x, float y)
@ ANIMFILTER_LIST_VISIBLE
@ ANIMFILTER_DATA_VISIBLE
@ ANIMFILTER_LIST_CHANNELS
static void nla_strip_get_color_inside(AnimData *adt, NlaStrip *strip, float color[3])
void GPU_viewport_size_get_f(float coords[4])
@ GPU_SHADER_KEYFRAME_SHAPE
@ GPU_SHADER_3D_UNIFORM_COLOR
@ GPU_SHADER_3D_LINE_DASHED_UNIFORM_COLOR
@ NLASTRIP_TYPE_TRANSITION
static void nla_strip_draw_markers(NlaStrip *strip, float yminc, float ymaxc)
void immUniformThemeColorShade(int color_id, int offset)
void immUniformColor4f(float r, float g, float b, float a)
void GPU_program_point_size(bool enable)
AnimKeylist * ED_keylist_create()
void nla_action_get_color(AnimData *adt, bAction *act, float color[4])
void ANIM_channel_draw_widgets(const bContext *C, bAnimContext *ac, bAnimListElem *ale, ui::Block *block, const rctf *rect, size_t channel_index)
bool BKE_nlastrip_within_bounds(NlaStrip *strip, float min, float max)
uint GPU_vertformat_attr_add(GPUVertFormat *format, StringRef name, gpu::VertAttrType type)
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
void imm_draw_box_wire_2d(uint pos, float x1, float y1, float x2, float y2)
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
void ANIM_animdata_freelist(ListBaseT< bAnimListElem > *anim_data)
void draw_nla_main_data(bAnimContext *ac, SpaceNla *snla, ARegion *region)
void ED_keylist_free(AnimKeylist *keylist)
void immUniformColor3fv(const float rgb[3])
void GPU_blend(GPUBlend blend)
const ListBaseT< ActKeyColumn > * ED_keylist_listbase(const AnimKeylist *keylist)
void immUniform1i(const char *name, int x)
FCurve * BKE_fcurve_find(ListBaseT< FCurve > *list, const char rna_path[], int array_index)
void immUniformColor3fvAlpha(const float rgb[3], float a)
static void nla_actionclip_draw_markers(NlaStrip *strip, float yminc, float ymaxc, int shade, const bool dashed)
void immRectf(uint pos, float x1, float y1, float x2, float y2)
bool ED_keylist_all_keys_frame_range(const AnimKeylist *keylist, Bounds< float > *r_frame_range)
void BLI_rctf_init(struct rctf *rect, float xmin, float xmax, float ymin, float ymax)
float evaluate_fcurve(const FCurve *fcu, float evaltime)
static void nla_draw_strip_text(AnimData *adt, NlaTrack *nlt, NlaStrip *strip, View2D *v2d, float xminc, float xmaxc, float yminc, float ymaxc)
static void nla_action_draw_keyframes(View2D *v2d, AnimData *adt, bAction *act, float y, float ymin, float ymax)
eNlaStrip_Extrapolate_Mode act_extendmode
ListBaseT< FCurve > fcurves
eNlaStrip_Extrapolate_Mode extendmode
ListBaseT< NlaStrip > strips
ListBaseT< NlaStrip > strips
ListBaseT< struct TimeMarker > markers