101 color[3] =
min_ff(0.7f, color[3] * 2.5f);
116 immRectf(pos_id, frame_range.
min, ymin + 2, frame_range.
max, ymax - 2);
172 NlaStrip *strip,
float yminc,
float ymaxc,
int shade,
const bool dashed)
185 float viewport_size[4];
201 if ((marker->frame > strip->
actstart) && (marker->frame < strip->
actend)) {
247 switch (strip->
type) {
298 const float yheight = ymaxc - yminc;
324 for (
float cfra = strip->
start; cfra <= strip->
end; cfra += 1.0f) {
326 CLAMP(y, 0.0f, 1.0f);
374 float viewport_size[4];
434 const bool is_other_track_soloed = adt_has_solo_track && !is_track_solo;
437 float color[4] = {1.0f, 1.0f, 1.0f, 1.0f};
460 if (strip->
prev ==
nullptr) {
488 if (!is_other_track_soloed &&
is_nlastrip_enabled(adt, nlt, strip) && !is_invalid_location) {
531 if (is_invalid_location) {
533 color[1] = color[2] = 0.15f;
537 color[0] = color[1] = color[2] = 1.0f;
541 color[0] = color[1] = color[2] = 0.0f;
573 for (
int i = 1; i < strip->
repeat; i++) {
574 float repeatPos = strip->
start + (repeatLen * i);
577 if (repeatPos < strip->end) {
587 const float y = (ymaxc - yminc) * 0.5f + yminc;
597 if ((cs->prev) &&
IS_EQF(cs->prev->end, cs->start) == 0) {
679 const float ytol = 1.0f;
680 const uchar col[4] = {220, 220, 220, 255};
709 ListBase empty = {
nullptr,
nullptr};
719 first = last = strip;
724 const bool has_strips_within_bounds = first !=
nullptr;
726 if (has_strips_within_bounds) {
728 for (
NlaStrip *strip = first->
next; strip; strip = strip->next) {
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;
771 if (v2d->
cur.
xmax < strip->start) {
774 first = last = strip->
prev;
782 ListBase visible_strips = {first, last};
783 return visible_strips;
788 View2D *v2d = ®ion->v2d;
790 const float text_margin_x = (8 *
UI_SCALE_FAC) * pixelx;
793 ListBase anim_data = {
nullptr,
nullptr};
815 float ycenter = (ymax + ymin + 2 *
NLATRACK_SKIP - 1) / 2.0f;
830 const float xminc = strip->start + text_margin_x;
831 const float xmaxc = strip->end - text_margin_x;
886 if (ale->data ==
nullptr) {
908 static_cast<bAction *
>(ale->data),
980 View2D *v2d = ®ion->v2d;
988 size_t track_index = 0;
1007 size_t track_index = 0;
1015 ale = ale->next, ymax -=
NLATRACK_STEP(snla), track_index++)
Blender kernel action and pose functionality.
FCurve * BKE_fcurve_find(ListBase *list, const char rna_path[], int array_index)
float evaluate_fcurve(const FCurve *fcu, float evaltime)
void BKE_nla_clip_length_ensure_nonzero(const float *actstart, float *r_actend)
bool BKE_nlastrip_within_bounds(NlaStrip *strip, float min, float max)
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
#define LISTBASE_FOREACH(type, var, list)
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE float min_ff(float a, float b)
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
void BLI_rctf_init(struct rctf *rect, float xmin, float xmax, float ymin, float ymax)
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
#define STRNCPY_RLEN(dst, src)
#define SNPRINTF_RLEN(dst, format,...)
#define IN_RANGE(a, b, c)
@ NLASTRIP_FLAG_USR_INFLUENCE
@ NLASTRIP_FLAG_INVALID_LOCATION
@ NLASTRIP_FLAG_TEMP_META
@ NLASTRIP_FLAG_TWEAKUSER
@ NLASTRIP_EXTEND_HOLD_FORWARD
@ NLASTRIP_EXTEND_NOTHING
@ NLASTRIP_TYPE_TRANSITION
@ ANIMTYPE_SPECIALDATA__UNUSED
@ ANIMTYPE_GREASE_PENCIL_DATABLOCK
@ ANIMTYPE_GREASE_PENCIL_LAYER
@ ANIMTYPE_FILLACT_LAYERED
@ ANIMTYPE_GREASE_PENCIL_LAYER_GROUP
#define NLATRACK_FIRST_TOP(ac)
#define NLATRACK_TOT_HEIGHT(ac, item_amount)
#define NLATRACK_STEP(snla)
@ ANIMFILTER_DATA_VISIBLE
@ ANIMFILTER_LIST_VISIBLE
@ ANIMFILTER_LIST_CHANNELS
#define NLATRACK_HEIGHT(snla)
@ GPU_SHADER_3D_LINE_DASHED_UNIFORM_COLOR
@ GPU_SHADER_KEYFRAME_SHAPE
@ GPU_SHADER_3D_UNIFORM_COLOR
void GPU_program_point_size(bool enable)
void GPU_blend(eGPUBlend blend)
void GPU_line_width(float width)
void GPU_line_smooth(bool enable)
void GPU_viewport_size_get_f(float coords[4])
void UI_draw_roundbox_4fv(const rctf *rect, bool filled, float rad, const float col[4])
uiBlock * UI_block_begin(const bContext *C, ARegion *region, std::string name, eUIEmbossType emboss)
void UI_draw_roundbox_corner_set(int type)
void UI_block_draw(const bContext *C, uiBlock *block)
void UI_block_end(const bContext *C, uiBlock *block)
void UI_GetThemeColor3fv(int colorid, float col[3])
void UI_GetThemeColor4fv(int colorid, float col[4])
void UI_view2d_sync(bScreen *screen, ScrArea *area, View2D *v2dcur, int flag)
char char char char void UI_view2d_text_cache_add(View2D *v2d, float x, float y, const char *str, size_t str_len, const unsigned char col[4])
void UI_view2d_text_cache_add_rectf(View2D *v2d, const rctf *rect_view, const char *str, size_t str_len, const unsigned char col[4])
void ANIM_channel_draw_widgets(const bContext *C, bAnimContext *ac, bAnimListElem *ale, uiBlock *block, const rctf *rect, size_t channel_index)
void ANIM_channel_draw(bAnimContext *ac, bAnimListElem *ale, float yminc, float ymaxc, size_t channel_index)
void ANIM_animdata_freelist(ListBase *anim_data)
void ANIM_draw_action_framerange(AnimData *adt, bAction *action, View2D *v2d, float ymin, float ymax)
size_t ANIM_animdata_filter(bAnimContext *ac, ListBase *anim_data, const eAnimFilter_Flags filter_mode, void *data, const eAnimCont_Types datatype)
float nlastrip_get_frame(NlaStrip *strip, float cframe, short mode)
float2 get_frame_range() const ATTR_WARN_UNUSED_RESULT
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)
bool ED_keylist_all_keys_frame_range(const AnimKeylist *keylist, Range2f *r_frame_range)
AnimKeylist * ED_keylist_create()
void ED_keylist_free(AnimKeylist *keylist)
const ListBase * ED_keylist_listbase(const AnimKeylist *keylist)
bool ED_keylist_is_empty(const AnimKeylist *keylist)
void action_to_keylist(AnimData *adt, bAction *dna_action, AnimKeylist *keylist, const int saction_flag, blender::float2 range)
static void nla_draw_strip_text(AnimData *adt, NlaTrack *nlt, NlaStrip *strip, View2D *v2d, float xminc, float xmaxc, float yminc, float ymaxc)
static bool is_nlastrip_enabled(AnimData *adt, NlaTrack *nlt, NlaStrip *strip)
static void nla_strip_draw_markers(NlaStrip *strip, float yminc, float ymaxc)
static void nla_action_draw_keyframes(View2D *v2d, AnimData *adt, bAction *act, float y, float ymin, float ymax)
static void nla_draw_strip_curves(NlaStrip *strip, float yminc, float ymaxc, uint pos)
static void nla_strip_get_color_inside(AnimData *adt, NlaStrip *strip, float color[3])
static void nla_draw_strip_frames_text(NlaTrack *, NlaStrip *strip, View2D *v2d, float, float ymaxc)
static void nla_draw_strip(SpaceNla *snla, AnimData *adt, NlaTrack *nlt, NlaStrip *strip, View2D *v2d, float yminc, float ymaxc)
static void nla_actionclip_draw_markers(NlaStrip *strip, float yminc, float ymaxc, int shade, const bool dashed)
static uint nla_draw_use_dashed_outlines(const float color[4], bool muted)
static ListBase get_visible_nla_strips(NlaTrack *nlt, View2D *v2d)
void draw_nla_track_list(const bContext *C, bAnimContext *ac, ARegion *region, const ListBase &anim_data)
void nla_action_get_color(AnimData *adt, bAction *act, float color[4])
void draw_nla_main_data(bAnimContext *ac, SpaceNla *snla, ARegion *region)
float wrap(float value, float max, float min)
ccl_device_inline int abs(int x)