Blender  V3.3
Functions
nla_draw.c File Reference
#include <float.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "DNA_anim_types.h"
#include "DNA_node_types.h"
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
#include "DNA_windowmanager_types.h"
#include "BLI_blenlib.h"
#include "BLI_dlrbTree.h"
#include "BLI_range.h"
#include "BLI_utildefines.h"
#include "BKE_context.h"
#include "BKE_fcurve.h"
#include "BKE_nla.h"
#include "BKE_screen.h"
#include "ED_anim_api.h"
#include "ED_keyframes_draw.h"
#include "ED_keyframes_keylist.h"
#include "GPU_immediate.h"
#include "GPU_immediate_util.h"
#include "GPU_state.h"
#include "WM_types.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "UI_view2d.h"
#include "nla_intern.h"
#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 *UNUSED(nlt), NlaStrip *strip, View2D *v2d, float UNUSED(yminc), 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_channel_list (const bContext *C, bAnimContext *ac, ARegion *region)
 

Function Documentation

◆ draw_nla_channel_list()

void draw_nla_channel_list ( const bContext *  C,
bAnimContext *  ac,
ARegion *  region 
)

◆ draw_nla_main_data()

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

◆ 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 709 of file nla_draw.c.

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, NULL, blender::meshintersect::prev(), 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 NULL, then just treat strip as enabled.

For disabled tracks, only the tweaked strip is enabled.

Definition at line 409 of file nla_draw.c.

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

Referenced by nla_draw_strip().

◆ nla_action_draw_keyframes()

static void nla_action_draw_keyframes ( View2D *  v2d,
AnimData *  adt,
bAction *  act,
float  y,
float  ymin,
float  ymax 
)
static

◆ nla_action_get_color()

void nla_action_get_color ( struct AnimData *  adt,
struct 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 52 of file nla_draw.c.

References ADT_NLA_EDIT_ON, ADT_NLA_SOLO_TRACK, color, 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()

static void nla_actionclip_draw_markers ( NlaStrip *  strip,
float  yminc,
float  ymaxc,
int  shade,
const bool  dashed 
)
static

◆ nla_draw_strip()

static void nla_draw_strip ( SpaceNla *  snla,
AnimData *  adt,
NlaTrack *  nlt,
NlaStrip *  strip,
View2D *  v2d,
float  yminc,
float  ymaxc 
)
static

◆ nla_draw_strip_curves()

static void nla_draw_strip_curves ( NlaStrip *  strip,
float  yminc,
float  ymaxc,
uint  pos 
)
static

◆ nla_draw_strip_frames_text()

static void nla_draw_strip_frames_text ( NlaTrack *  UNUSEDnlt,
NlaStrip *  strip,
View2D *  v2d,
float   UNUSEDyminc,
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 679 of file nla_draw.c.

References BLI_snprintf_rlen(), col, NlaStrip::end, 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()

static uint nla_draw_use_dashed_outlines ( const float  color[4],
bool  muted 
)
static

◆ nla_strip_draw_markers()

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

◆ nla_strip_get_color_inside()

static void nla_strip_get_color_inside ( AnimData *  adt,
NlaStrip *  strip,
float  color[3] 
)
static