diff --git a/scripts/startup/bl_ui/space_time.py b/scripts/startup/bl_ui/space_time.py index 3c04e71269d..b23a8df2caa 100644 --- a/scripts/startup/bl_ui/space_time.py +++ b/scripts/startup/bl_ui/space_time.py @@ -168,6 +168,7 @@ class TIME_MT_cache(Menu): col.prop(st, "cache_softbody") col.prop(st, "cache_particles") col.prop(st, "cache_cloth") + col.prop(st, "cache_simulation_nodes") col.prop(st, "cache_smoke") col.prop(st, "cache_dynamicpaint") col.prop(st, "cache_rigidbody") diff --git a/source/blender/blenkernel/BKE_blender_version.h b/source/blender/blenkernel/BKE_blender_version.h index 943ecb2bf64..d0683cb891a 100644 --- a/source/blender/blenkernel/BKE_blender_version.h +++ b/source/blender/blenkernel/BKE_blender_version.h @@ -31,7 +31,7 @@ extern "C" { * version. Older Blender versions will test this and show a warning if the file * was written with too new a version. */ #define BLENDER_FILE_MIN_VERSION 305 -#define BLENDER_FILE_MIN_SUBVERSION 9 +#define BLENDER_FILE_MIN_SUBVERSION 10 /** User readable version string. */ const char *BKE_blender_version_string(void); diff --git a/source/blender/blenloader/intern/versioning_300.cc b/source/blender/blenloader/intern/versioning_300.cc index e0ed139ab8f..e8338b5dd08 100644 --- a/source/blender/blenloader/intern/versioning_300.cc +++ b/source/blender/blenloader/intern/versioning_300.cc @@ -4355,6 +4355,27 @@ void blo_do_versions_300(FileData *fd, Library * /*lib*/, Main *bmain) } } + if (!MAIN_VERSION_ATLEAST(bmain, 306, 9)) { + /* Fix sound strips with speed factor set to 0. See #107289. */ + LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) { + Editing *ed = SEQ_editing_get(scene); + if (ed != nullptr) { + SEQ_for_each_callback(&ed->seqbase, version_seq_fix_broken_sound_strips, nullptr); + } + } + + LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) { + LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) { + LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) { + if (sl->spacetype == SPACE_ACTION) { + SpaceAction *saction = reinterpret_cast(sl); + saction->cache_display |= TIME_CACHE_SIMULATION_NODES; + } + } + } + } + } + /** * Versioning code until next subversion bump goes here. * @@ -4366,13 +4387,5 @@ void blo_do_versions_300(FileData *fd, Library * /*lib*/, Main *bmain) */ { /* Keep this block, even when empty. */ - - /* Fix sound strips with speed factor set to 0. See #107289. */ - LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) { - Editing *ed = SEQ_editing_get(scene); - if (ed != nullptr) { - SEQ_for_each_callback(&ed->seqbase, version_seq_fix_broken_sound_strips, nullptr); - } - } } } diff --git a/source/blender/editors/space_action/action_draw.cc b/source/blender/editors/space_action/action_draw.cc index 60d0f0e2def..9bdb9ca8b08 100644 --- a/source/blender/editors/space_action/action_draw.cc +++ b/source/blender/editors/space_action/action_draw.cc @@ -758,23 +758,25 @@ void timeline_draw_cache(const SpaceAction *saction, const Object *ob, const Sce y_offset += cache_draw_height; } - LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) { - if (md->type != eModifierType_Nodes) { - continue; + if (saction->cache_display & TIME_CACHE_SIMULATION_NODES) { + LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) { + if (md->type != eModifierType_Nodes) { + continue; + } + const NodesModifierData *nmd = reinterpret_cast(md); + if (nmd->node_group == nullptr) { + continue; + } + if (nmd->simulation_cache == nullptr) { + continue; + } + if ((nmd->node_group->runtime->runtime_flag & NTREE_RUNTIME_FLAG_HAS_SIMULATION_ZONE) == 0) { + continue; + } + timeline_cache_draw_simulation_nodes( + *scene, *nmd->simulation_cache, y_offset, cache_draw_height, pos_id); + y_offset += cache_draw_height; } - const NodesModifierData *nmd = reinterpret_cast(md); - if (nmd->node_group == nullptr) { - continue; - } - if (nmd->simulation_cache == nullptr) { - continue; - } - if ((nmd->node_group->runtime->runtime_flag & NTREE_RUNTIME_FLAG_HAS_SIMULATION_ZONE) == 0) { - continue; - } - timeline_cache_draw_simulation_nodes( - *scene, *nmd->simulation_cache, y_offset, cache_draw_height, pos_id); - y_offset += cache_draw_height; } GPU_blend(GPU_BLEND_NONE); diff --git a/source/blender/editors/space_action/space_action.cc b/source/blender/editors/space_action/space_action.cc index 57d074e7051..6a075416a2d 100644 --- a/source/blender/editors/space_action/space_action.cc +++ b/source/blender/editors/space_action/space_action.cc @@ -67,11 +67,9 @@ static SpaceLink *action_create(const ScrArea *area, const Scene *scene) saction->ads.filterflag |= ADS_FILTER_SUMMARY; - /* enable all cache display */ - saction->cache_display |= TIME_CACHE_DISPLAY; - saction->cache_display |= (TIME_CACHE_SOFTBODY | TIME_CACHE_PARTICLES); - saction->cache_display |= (TIME_CACHE_CLOTH | TIME_CACHE_SMOKE | TIME_CACHE_DYNAMICPAINT); - saction->cache_display |= TIME_CACHE_RIGIDBODY; + saction->cache_display = TIME_CACHE_DISPLAY | TIME_CACHE_SOFTBODY | TIME_CACHE_PARTICLES | + TIME_CACHE_CLOTH | TIME_CACHE_SMOKE | TIME_CACHE_DYNAMICPAINT | + TIME_CACHE_RIGIDBODY | TIME_CACHE_SIMULATION_NODES; /* header */ region = MEM_cnew("header for action"); diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h index bd0e52f48e3..1567a6acda5 100644 --- a/source/blender/makesdna/DNA_action_types.h +++ b/source/blender/makesdna/DNA_action_types.h @@ -934,6 +934,7 @@ typedef enum eTimeline_Cache_Flag { TIME_CACHE_SMOKE = (1 << 4), TIME_CACHE_DYNAMICPAINT = (1 << 5), TIME_CACHE_RIGIDBODY = (1 << 6), + TIME_CACHE_SIMULATION_NODES = (1 << 7), } eTimeline_Cache_Flag; /* ************************************************ */ diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 9e09e469b83..dc89b6e3174 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -6286,6 +6286,12 @@ static void rna_def_space_dopesheet(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Smoke", "Show the active object's smoke cache"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, NULL); + prop = RNA_def_property(srna, "cache_simulation_nodes", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "cache_display", TIME_CACHE_SIMULATION_NODES); + RNA_def_property_ui_text( + prop, "Simulation Nodes", "Show the active object's simulation nodes cache and bake data"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, NULL); + prop = RNA_def_property(srna, "cache_dynamicpaint", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "cache_display", TIME_CACHE_DYNAMICPAINT); RNA_def_property_ui_text(prop, "Dynamic Paint", "Show the active object's Dynamic Paint cache");