Blender V4.3
nla_draw.cc File Reference
#include <cfloat>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include "DNA_anim_types.h"
#include "DNA_node_types.h"
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
#include "BLI_blenlib.h"
#include "BLI_range.h"
#include "BLI_utildefines.h"
#include "BLT_translation.hh"
#include "BKE_action.hh"
#include "BKE_fcurve.hh"
#include "BKE_nla.hh"
#include "ED_anim_api.hh"
#include "ED_keyframes_draw.hh"
#include "ED_keyframes_keylist.hh"
#include "GPU_immediate.hh"
#include "GPU_immediate_util.hh"
#include "GPU_state.hh"
#include "WM_types.hh"
#include "UI_interface.hh"
#include "UI_resources.hh"
#include "UI_view2d.hh"
#include "nla_intern.hh"
#include "nla_private.h"

Go to the source code of this file.

Functions

void nla_action_get_color (AnimData *adt, bAction *act, float color[4])
 
static void nla_action_draw_keyframes (View2D *v2d, AnimData *adt, bAction *act, float y, float ymin, float ymax)
 
static void nla_actionclip_draw_markers (NlaStrip *strip, float yminc, float ymaxc, int shade, const bool dashed)
 
static void nla_strip_draw_markers (NlaStrip *strip, float yminc, float ymaxc)
 
static void nla_strip_get_color_inside (AnimData *adt, NlaStrip *strip, float color[3])
 
static void nla_draw_strip_curves (NlaStrip *strip, float yminc, float ymaxc, uint pos)
 
static uint nla_draw_use_dashed_outlines (const float color[4], bool muted)
 
static bool is_nlastrip_enabled (AnimData *adt, NlaTrack *nlt, NlaStrip *strip)
 
static void nla_draw_strip (SpaceNla *snla, AnimData *adt, NlaTrack *nlt, NlaStrip *strip, View2D *v2d, float yminc, float ymaxc)
 
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_draw_strip_frames_text (NlaTrack *, NlaStrip *strip, View2D *v2d, float, float ymaxc)
 
static ListBase get_visible_nla_strips (NlaTrack *nlt, View2D *v2d)
 
void draw_nla_main_data (bAnimContext *ac, SpaceNla *snla, ARegion *region)
 
void draw_nla_track_list (const bContext *C, bAnimContext *ac, ARegion *region, const ListBase &anim_data)
 

Function Documentation

◆ draw_nla_main_data()

void draw_nla_main_data ( bAnimContext * ac,
SpaceNla * snla,
ARegion * region )

Definition at line 786 of file nla_draw.cc.

References AnimData::act_extendmode, ANIM_animdata_filter(), ANIM_animdata_freelist(), ANIM_draw_action_framerange(), ANIMFILTER_DATA_VISIBLE, ANIMFILTER_FCURVESONLY, ANIMFILTER_LIST_CHANNELS, ANIMFILTER_LIST_VISIBLE, ANIMTYPE_ACTION_SLOT, ANIMTYPE_ANIMDATA, ANIMTYPE_DSARM, ANIMTYPE_DSCACHEFILE, ANIMTYPE_DSCAM, ANIMTYPE_DSCUR, ANIMTYPE_DSGPENCIL, ANIMTYPE_DSHAIR, ANIMTYPE_DSLAM, ANIMTYPE_DSLAT, ANIMTYPE_DSLINESTYLE, ANIMTYPE_DSMAT, ANIMTYPE_DSMBALL, ANIMTYPE_DSMCLIP, ANIMTYPE_DSMESH, ANIMTYPE_DSNTREE, ANIMTYPE_DSPART, ANIMTYPE_DSPOINTCLOUD, ANIMTYPE_DSSKEY, ANIMTYPE_DSSPK, ANIMTYPE_DSTEX, ANIMTYPE_DSVOLUME, ANIMTYPE_DSWOR, ANIMTYPE_FCURVE, ANIMTYPE_FILLACT_LAYERED, ANIMTYPE_FILLACTD, ANIMTYPE_FILLDRIVERS, ANIMTYPE_GPDATABLOCK, ANIMTYPE_GPLAYER, ANIMTYPE_GREASE_PENCIL_DATABLOCK, ANIMTYPE_GREASE_PENCIL_LAYER, ANIMTYPE_GREASE_PENCIL_LAYER_GROUP, ANIMTYPE_GROUP, ANIMTYPE_MASKDATABLOCK, ANIMTYPE_MASKLAYER, ANIMTYPE_NLAACTION, ANIMTYPE_NLACONTROLS, ANIMTYPE_NLACURVE, ANIMTYPE_NLATRACK, ANIMTYPE_NONE, ANIMTYPE_NUM_TYPES, ANIMTYPE_OBJECT, ANIMTYPE_PALETTE, ANIMTYPE_SCENE, ANIMTYPE_SHAPEKEY, ANIMTYPE_SPECIALDATA__UNUSED, ANIMTYPE_SUMMARY, BKE_nla_clip_length_ensure_nonzero(), BLI_rctf_size_x(), BLI_rcti_size_x(), View2D::cur, bAnimContext::data, bAnimContext::datatype, ListBase::first, blender::animrig::Action::get_frame_range(), get_visible_nla_strips(), GPU_blend(), GPU_BLEND_ALPHA, GPU_BLEND_NONE, GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_SHADER_3D_UNIFORM_COLOR, GPU_vertformat_attr_add(), immBindBuiltinProgram(), immRectf(), immUnbindProgram(), immUniformColor4fv(), immVertexFormat(), IN_RANGE, LISTBASE_FOREACH, View2D::mask, nla_action_draw_keyframes(), nla_action_get_color(), nla_draw_strip(), nla_draw_strip_frames_text(), nla_draw_strip_text(), NLASTRIP_EXTEND_HOLD, NLASTRIP_EXTEND_HOLD_FORWARD, NLASTRIP_EXTEND_NOTHING, NLASTRIP_FLAG_TEMP_META, NLATRACK_FIRST_TOP, NLATRACK_HEIGHT, NLATRACK_SKIP, NLATRACK_STEP, NLATRACK_TOT_HEIGHT, pos, View2D::tot, UI_SCALE_FAC, wrap(), rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.

Referenced by nla_main_region_draw().

◆ draw_nla_track_list()

◆ get_visible_nla_strips()

static ListBase get_visible_nla_strips ( NlaTrack * nlt,
View2D * v2d )
static

Gets the first and last visible NLA strips on a track. Note that this also includes tracks that might only be visible because of their extendmode.

Definition at line 706 of file nla_draw.cc.

References BKE_nlastrip_within_bounds(), BLI_listbase_is_empty(), View2D::cur, NlaStrip::end, NlaStrip::extendmode, ListBase::first, ListBase::last, LISTBASE_FOREACH, NlaStrip::next, NLASTRIP_EXTEND_HOLD, NLASTRIP_EXTEND_NOTHING, NlaStrip::prev, NlaStrip::start, NlaTrack::strips, rctf::xmax, and rctf::xmin.

Referenced by draw_nla_main_data().

◆ is_nlastrip_enabled()

static bool is_nlastrip_enabled ( AnimData * adt,
NlaTrack * nlt,
NlaStrip * strip )
static

This check only accounts for the track's disabled flag and whether the strip is being tweaked. It does not account for muting or soloing.

This shouldn't happen. If passed nullptr, then just treat strip as enabled.

For disabled tracks, only the tweaked strip is enabled.

Definition at line 401 of file nla_draw.cc.

References AnimData::actstrip, BLI_assert, NlaTrack::flag, and NLATRACK_DISABLED.

Referenced by nla_draw_strip().

◆ nla_action_draw_keyframes()

◆ nla_action_get_color()

void nla_action_get_color ( AnimData * adt,
bAction * act,
float color[4] )

Get color to use for NLA Action channel's background.

Note
color returned includes fine-tuned alpha!

Definition at line 54 of file nla_draw.cc.

References ADT_NLA_EDIT_ON, ADT_NLA_SOLO_TRACK, AnimData::flag, TH_ANIM_ACTIVE, TH_ANIM_INACTIVE, TH_NLA_TWEAK, and UI_GetThemeColor4fv().

Referenced by acf_nlaaction_backdrop(), acf_nlaaction_color(), draw_nla_main_data(), and nla_action_draw_keyframes().

◆ nla_actionclip_draw_markers()

◆ nla_draw_strip()

◆ nla_draw_strip_curves()

◆ nla_draw_strip_frames_text()

static void nla_draw_strip_frames_text ( NlaTrack * ,
NlaStrip * strip,
View2D * v2d,
float ,
float ymaxc )
static

Add frame extents to cache of text-strings to draw in pixel-space for now, only used when transforming strips.

Definition at line 676 of file nla_draw.cc.

References col, NlaStrip::end, SNPRINTF_RLEN, NlaStrip::start, and UI_view2d_text_cache_add().

Referenced by draw_nla_main_data().

◆ nla_draw_strip_text()

static void nla_draw_strip_text ( AnimData * adt,
NlaTrack * nlt,
NlaStrip * strip,
View2D * v2d,
float xminc,
float xmaxc,
float yminc,
float ymaxc )
static

◆ nla_draw_use_dashed_outlines()

◆ nla_strip_draw_markers()

static void nla_strip_draw_markers ( NlaStrip * strip,
float yminc,
float ymaxc )
static

◆ nla_strip_get_color_inside()