Fix #113812: disabled Bake simulation if cache is not enabled #114601

Merged
Jacques Lucke merged 1 commits from Enrique-de-la-Calle/blender:bake-require-cache into blender-v4.1-release 2024-02-21 14:13:09 +01:00
1 changed files with 7 additions and 0 deletions
Showing only changes of commit 429ca54e27 - Show all commits

View File

@ -19,6 +19,7 @@
#include "WM_api.hh"
#include "WM_types.hh"
#include "ED_object.hh"
#include "ED_screen.hh"
#include "DNA_array_utils.hh"
@ -216,6 +217,12 @@ static bool bake_simulation_poll(bContext *C)
CTX_wm_operator_poll_msg_set(C, "File must be saved before baking");
return false;
}
Object *ob = ED_object_active_context(C);
const bool use_frame_cache = ob->flag & OB_FLAG_USE_SIMULATION_CACHE;
if (!use_frame_cache) {
CTX_wm_operator_poll_msg_set(C, "Cache has to be enabled");
return false;
}
return true;
}