62 View2D *v2d = ®ion->v2d;
69 size_t channel_index = 0;
73 ale = ale->
next, ymax -= channel_step, channel_index++)
88 size_t channel_index = 0;
92 ale = ale->
next, ymax -= channel_step, channel_index++)
119#define EXTRA_SCROLL_PAD 100.0f
132 float ymin = ymax - ystep;
135 ale = ale->next, ymax = ymin, ymin -= ystep)
155 if (action != cur_action || adt != cur_adt) {
174 uchar col1[4], col2[4];
175 uchar col1a[4], col2a[4];
176 uchar col1b[4], col2b[4];
177 uchar col_summary[4];
194 ale = ale->
next, ymax -= channel_step)
254 color = sel ? col1a : col2a;
259 color[3] = sel ? col1[3] : col2b[3];
263 color = sel ? col1 : col2;
283 color = sel ? col1 : col2;
318 int action_flag = saction->
flag;
334 ale = ale->
next, ymax -= channel_step)
337 float ycenter = (ymin + ymax) / 2.0f;
357 draw_list,
static_cast<bAnimContext *
>(ale->
data), ycenter, scale_factor, action_flag);
474 View2D *v2d = ®ion->v2d;
608 float color_state[4])
611 color[3] = color_state[3] = 1.0f;
614 color[3] = color_state[3] = 0.7f;
618 color[3] = color_state[3] = 0.7f;
623 int search_start_frame,
624 int *r_segment_start,
628 int current = search_start_frame;
636 *r_segment_start = current;
645 *r_segment_end = current - 1;
649 *r_segment_end = current - 1;
665 current = segment_end + 1;
674 if (segments_count == 0) {
684 immRectf_fast(pos_id, segment_start, 0, segment_end + 1.0f, 1.0f);
685 current = segment_end + 1;
731 const bool all_simulations_baked,
733 const float line_height,
740 bool has_bake =
false;
742 for (
const CacheRange &sim_range : cache_ranges) {
743 switch (sim_range.status) {
754 for (
const CacheRange &sim_range : cache_ranges) {
755 status_change_frames_set.
add(sim_range.frames.first());
756 status_change_frames_set.
add(sim_range.frames.one_after_last());
759 status_change_frames.
extend(status_change_frames_set.
begin(), status_change_frames_set.
end());
760 std::sort(status_change_frames.
begin(), status_change_frames.
end());
771 invalid_color.
a *= 0.7f;
773 valid_color.
a *= 0.7f;
776 float max_used_height = 1.0f;
777 for (
const int range_i : frame_ranges.
index_range()) {
779 const int start_frame = frame_range.
first();
780 const int end_frame = frame_range.
last();
782 bool has_bake_at_frame =
false;
783 bool has_valid_at_frame =
false;
784 bool has_invalid_at_frame =
false;
785 for (
const CacheRange &sim_range : cache_ranges) {
786 if (sim_range.frames.contains(start_frame)) {
787 switch (sim_range.status) {
789 has_invalid_at_frame =
true;
792 has_valid_at_frame =
true;
795 has_bake_at_frame =
true;
800 if (!(has_bake_at_frame || has_valid_at_frame || has_invalid_at_frame)) {
804 if (all_simulations_baked) {
808 immRectf_fast(pos_id, start_frame, 0, end_frame + 1.0f, 1.0f);
812 if (has_valid_at_frame || has_invalid_at_frame) {
814 immUniform4fv(
"color2", has_invalid_at_frame ? invalid_color : valid_color);
816 const float top = has_bake ? 2.0f : 1.0f;
817 immRectf_fast(pos_id, start_frame, 0.0f, end_frame + 1.0f, top);
819 max_used_height =
top;
821 if (has_bake_at_frame) {
825 immRectf_fast(pos_id, start_frame, 0, end_frame + 1.0f, 1.0f);
832 *y_offset += max_used_height * 2;
851 float y_offset = 0.0f;
852 const float cache_draw_height = 4.0f *
UI_SCALE_FAC *
U.pixelsize;
862 if (pid->cache->cached_frames ==
nullptr) {
868 y_offset += cache_draw_height;
872 bool all_simulations_baked =
true;
890 std::lock_guard
lock{modifier_cache.
mutex};
894 all_simulations_baked =
false;
898 all_simulations_baked =
false;
920 cache_ranges, all_simulations_baked, &y_offset, cache_draw_height, pos_id);
Functions and classes to work with Actions.
#define PTCACHE_TYPE_SMOKE_HIGHRES
void BKE_ptcache_ids_from_object(struct ListBase *lb, struct Object *ob, struct Scene *scene, int duplis)
#define PTCACHE_TYPE_CLOTH
#define PTCACHE_TYPE_DYNAMICPAINT
#define PTCACHE_TYPE_PARTICLES
#define PTCACHE_TYPE_SOFTBODY
#define PTCACHE_TYPE_SMOKE_DOMAIN
#define PTCACHE_TYPE_RIGIDBODY
#define LISTBASE_FOREACH(type, var, list)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
MINLINE void copy_v4_v4(float r[4], const float a[4])
MINLINE void mul_v3_fl(float r[3], float f)
void interp_v3_v3v3(float r[3], const float a[3], const float b[3], float t)
void BLI_rctf_init(struct rctf *rect, float xmin, float xmax, float ymin, float ymax)
#define IN_RANGE(a, b, c)
@ TIME_CACHE_DYNAMICPAINT
@ TIME_CACHE_SIMULATION_NODES
@ SACTION_SHOW_INTERPOLATION
@ NODES_MODIFIER_BAKE_MODE_STILL
Object is a sort of wrapper for general info.
@ USER_ANIM_SHOW_CHANNEL_GROUP_COLORS
@ ANIMTYPE_GREASE_PENCIL_DATABLOCK
@ ANIMTYPE_FILLACT_LAYERED
@ ANIMTYPE_GREASE_PENCIL_LAYER_GROUP
@ ALE_GREASE_PENCIL_GROUP
@ ACHANNEL_SETTING_SELECT
void GPU_matrix_scale_2f(float x, float y)
void GPU_matrix_translate_2f(float x, float y)
@ GPU_SHADER_2D_DIAG_STRIPES
@ GPU_SHADER_3D_UNIFORM_COLOR
void GPU_blend(eGPUBlend blend)
uiBlock * UI_block_begin(const bContext *C, ARegion *region, std::string name, eUIEmbossType emboss)
void UI_block_draw(const bContext *C, uiBlock *block)
void UI_block_end(const bContext *C, uiBlock *block)
@ TH_DOPESHEET_CHANNELSUBOB
void UI_GetThemeColor4fv(int colorid, float col[4])
void UI_GetThemeColor4ubv(int colorid, unsigned char col[4])
void UI_view2d_sync(bScreen *screen, ScrArea *area, View2D *v2dcur, int flag)
#define V2D_SCROLL_HANDLE_HEIGHT
static void draw_backdrops(bAnimContext *ac, ListBase &anim_data, View2D *v2d, uint pos)
void draw_channel_names(bContext *C, bAnimContext *ac, ARegion *region, const ListBase &anim_data)
static uint timeline_cache_segments_count(PointCache *cache)
static void timeline_cache_draw_cached_segments(PointCache *cache, uint pos_id)
void timeline_draw_cache(const SpaceAction *saction, const Object *ob, const Scene *scene)
static void timeline_cache_draw_single(PTCacheID *pid, float y_offset, float height, uint pos_id)
static void draw_channel_action_ranges(ListBase *anim_data, View2D *v2d)
void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *region, ListBase *anim_data)
static void timeline_cache_draw_geometry_nodes(const blender::Span< CacheRange > cache_ranges, const bool all_simulations_baked, float *y_offset, const float line_height, const uint pos_id)
static void timeline_cache_modify_color_based_on_state(PointCache *cache, float color[4], float color_state[4])
static bool timeline_cache_is_hidden_by_setting(const SpaceAction *saction, const PTCacheID *pid)
static void draw_keyframes(bAnimContext *ac, View2D *v2d, SpaceAction *saction, ListBase &anim_data)
static void timeline_cache_color_get(PTCacheID *pid, float color[4])
static bool timeline_cache_find_next_cached_segment(PointCache *cache, int search_start_frame, int *r_segment_start, int *r_segment_end)
float ANIM_UI_get_channel_skip()
void ANIM_channel_draw_widgets(const bContext *C, bAnimContext *ac, bAnimListElem *ale, uiBlock *block, const rctf *rect, size_t channel_index)
float ANIM_UI_get_keyframe_scale_factor()
void ANIM_channel_draw(bAnimContext *ac, bAnimListElem *ale, float yminc, float ymaxc, size_t channel_index)
const bAnimChannelType * ANIM_channel_get_typeinfo(bAnimListElem *ale)
float ANIM_UI_get_channel_step()
float ANIM_UI_get_first_channel_top(View2D *v2d)
float ANIM_UI_get_channel_height()
bAction * ANIM_channel_action_get(const bAnimListElem *ale)
short ANIM_channel_setting_get(bAnimContext *ac, bAnimListElem *ale, eAnimChannel_Settings setting)
void ANIM_animdata_freelist(ListBase *anim_data)
AnimData * ANIM_nla_mapping_get(bAnimContext *ac, bAnimListElem *ale)
void ANIM_draw_action_framerange(AnimData *adt, bAction *action, View2D *v2d, float ymin, float ymax)
constexpr int64_t first() const
constexpr int64_t last(const int64_t n=0) const
constexpr bool is_empty() const
void append(const T &value)
void extend(Span< T > array)
Span< T > as_span() const
IndexRange index_range() const
void ED_add_action_slot_channel(ChannelDrawList *channel_list, AnimData *adt, animrig::Action &action, animrig::Slot &slot, const float ypos, const float yscale_fac, int saction_flag)
void ED_add_grease_pencil_layer_legacy_channel(ChannelDrawList *channel_list, bDopeSheet *ads, bGPDlayer *gpl, float ypos, float yscale_fac, int saction_flag)
ChannelDrawList * ED_channel_draw_list_create()
void ED_add_grease_pencil_cels_channel(ChannelDrawList *channel_list, bDopeSheet *ads, const GreasePencilLayer *layer, const float ypos, const float yscale_fac, int saction_flag)
void ED_add_scene_channel(ChannelDrawList *channel_list, bDopeSheet *ads, Scene *sce, float ypos, float yscale_fac, int saction_flag)
void ED_channel_list_flush(ChannelDrawList *channel_list, View2D *v2d)
void ED_add_grease_pencil_layer_group_channel(ChannelDrawList *channel_list, bDopeSheet *ads, const GreasePencilLayerTreeGroup *layer_group, const float ypos, const float yscale_fac, int saction_flag)
void ED_add_action_channel(ChannelDrawList *channel_list, AnimData *adt, bAction *act, float ypos, float yscale_fac, int saction_flag)
void ED_add_action_layered_channel(ChannelDrawList *channel_list, AnimData *adt, bAction *action, const float ypos, const float yscale_fac, int saction_flag)
void ED_channel_list_free(ChannelDrawList *channel_list)
void ED_add_fcurve_channel(ChannelDrawList *channel_list, AnimData *adt, FCurve *fcu, float ypos, float yscale_fac, int saction_flag)
void ED_add_action_group_channel(ChannelDrawList *channel_list, AnimData *adt, bActionGroup *agrp, float ypos, float yscale_fac, int saction_flag)
void ED_add_mask_layer_channel(ChannelDrawList *channel_list, bDopeSheet *ads, MaskLayer *masklay, float ypos, float yscale_fac, int saction_flag)
void ED_add_summary_channel(ChannelDrawList *channel_list, bAnimContext *ac, float ypos, float yscale_fac, int saction_flag)
void ED_add_object_channel(ChannelDrawList *channel_list, bDopeSheet *ads, Object *ob, float ypos, float yscale_fac, int saction_flag)
void ED_add_grease_pencil_datablock_channel(ChannelDrawList *channel_list, bAnimContext *ac, AnimData *adt, const GreasePencil *grease_pencil, const float ypos, const float yscale_fac, int saction_flag)
blender::bke::bake::CacheStatus status
blender::IndexRange frames
struct bNodeTree * node_group
NodesModifierRuntimeHandle * runtime
struct PointCache * cache
bool(* has_setting)(bAnimContext *ac, bAnimListElem *ale, eAnimChannel_Settings setting)
bool(* get_channel_color)(const bAnimListElem *ale, uint8_t r_color[3])
Map< int, std::unique_ptr< SimulationNodeCache > > simulation_cache_by_id
Map< int, std::unique_ptr< BakeNodeCache > > bake_cache_by_id
IndexRange frame_range() const
Vector< std::unique_ptr< FrameCache > > frames