Geometry Nodes: add theme option for simulated frames in timeline
The new theme setting for the dope sheet (timeline) allows changing the color of the bar that shows which frames are cached/baked. The invalid/cached/baked status is differentiated by hardcoded transparency values. In theory, those could be separate theme settings though. Pull Request: https://projects.blender.org/blender/blender/pulls/107738
This commit is contained in:
@@ -567,6 +567,7 @@ const bTheme U_theme_default = {
|
||||
.handle_vertex_size = 4,
|
||||
.anim_active = RGBA(0x4d272766),
|
||||
.anim_preview_range = RGBA(0xa14d0066),
|
||||
.simulated_frames = RGBA(0x721e65ff),
|
||||
},
|
||||
.space_nla = {
|
||||
.back = RGBA(0x30303000),
|
||||
|
||||
@@ -109,6 +109,7 @@ static void do_versions_theme(const UserDef *userdef, bTheme *btheme)
|
||||
{
|
||||
/* Keep this block, even when empty. */
|
||||
FROM_DEFAULT_V4_UCHAR(space_node.node_zone_simulation);
|
||||
FROM_DEFAULT_V4_UCHAR(space_action.simulated_frames);
|
||||
}
|
||||
|
||||
#undef FROM_DEFAULT_V4_UCHAR
|
||||
|
||||
@@ -180,6 +180,7 @@ typedef enum ThemeColorID {
|
||||
TH_NODE_ATTRIBUTE,
|
||||
|
||||
TH_NODE_ZONE_SIMULATION,
|
||||
TH_SIMULATED_FRAMES,
|
||||
|
||||
TH_CONSOLE_OUTPUT,
|
||||
TH_CONSOLE_INPUT,
|
||||
|
||||
@@ -644,6 +644,9 @@ const uchar *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colorid)
|
||||
case TH_NODE_ZONE_SIMULATION:
|
||||
cp = ts->node_zone_simulation;
|
||||
break;
|
||||
case TH_SIMULATED_FRAMES:
|
||||
cp = ts->simulated_frames;
|
||||
break;
|
||||
|
||||
case TH_SEQ_MOVIE:
|
||||
cp = ts->movie;
|
||||
|
||||
@@ -691,17 +691,18 @@ static void timeline_cache_draw_simulation_nodes(
|
||||
GPU_matrix_scale_2f(1.0, height);
|
||||
|
||||
float color[4];
|
||||
UI_GetThemeColor4fv(TH_SIMULATED_FRAMES, color);
|
||||
switch (cache.cache_state()) {
|
||||
case blender::bke::sim::CacheState::Invalid: {
|
||||
copy_v4_fl4(color, 0.8, 0.8, 0.2, 0.3);
|
||||
color[3] = 0.4f;
|
||||
break;
|
||||
}
|
||||
case blender::bke::sim::CacheState::Valid: {
|
||||
copy_v4_fl4(color, 0.8, 0.8, 0.2, 1.0);
|
||||
color[3] = 0.7f;
|
||||
break;
|
||||
}
|
||||
case blender::bke::sim::CacheState::Baked: {
|
||||
copy_v4_fl4(color, 1.0, 0.6, 0.2, 1.0);
|
||||
color[3] = 1.0f;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -345,7 +345,7 @@ typedef struct ThemeSpace {
|
||||
unsigned char nodeclass_geometry[4], nodeclass_attribute[4];
|
||||
|
||||
unsigned char node_zone_simulation[4];
|
||||
char _pad8[4];
|
||||
unsigned char simulated_frames[4];
|
||||
|
||||
/** For sequence editor. */
|
||||
unsigned char movie[4], movieclip[4], mask[4], image[4], scene[4], audio[4];
|
||||
|
||||
@@ -3563,6 +3563,12 @@ static void rna_def_userdef_theme_space_action(BlenderRNA *brna)
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Interpolation Line", "Color of lines showing non-bezier interpolation modes");
|
||||
RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
|
||||
|
||||
prop = RNA_def_property(srna, "simulated_frames", PROP_FLOAT, PROP_COLOR_GAMMA);
|
||||
RNA_def_property_float_sdna(prop, NULL, "simulated_frames");
|
||||
RNA_def_property_array(prop, 4);
|
||||
RNA_def_property_ui_text(prop, "Simulated Frames", "");
|
||||
RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
|
||||
}
|
||||
|
||||
static void rna_def_userdef_theme_space_nla(BlenderRNA *brna)
|
||||
|
||||
Reference in New Issue
Block a user