Fix #107608 : Changing color for simulation zone doesn't save #107808
|
@ -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),
|
||||
|
|
|
@ -99,6 +99,7 @@ static void do_versions_theme(const UserDef *userdef, bTheme *btheme)
|
|||
|
||||
if (!USER_VERSION_ATLEAST(306, 8)) {
|
||||
FROM_DEFAULT_V4_UCHAR(space_node.node_zone_simulation);
|
||||
FROM_DEFAULT_V4_UCHAR(space_action.simulated_frames);
|
||||
}
|
||||
/**
|
||||
* Versioning code until next subversion bump goes here.
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue