33#include "RNA_prototypes.hh"
51 if (
id ==
nullptr || point_cache ==
nullptr) {
57 "Library override data-blocks only support Disk Cache storage");
76 if (
id ==
nullptr || point_cache ==
nullptr) {
82 C,
"Linked or library override data-blocks do not allow adding or removing caches");
101 MEM_delete(job->
baker);
150 worker_status->
stop =
false;
169 cache->
edit =
nullptr;
195 Object *ob = (
GS(
id->name) ==
ID_OB) ? id_cast<Object *>(
id) :
nullptr;
227 "Baking point cache...",
271 ListBaseT<PTCacheID> pidlist;
280 pidlist.free_no_destruct();
294 ot->
name =
"Bake All Physics";
295 ot->
description =
"Bake all physics simulations in the current scene";
296 ot->
idname =
"PTCACHE_OT_bake_all";
313 ot->
name =
"Delete All Physics Bakes";
314 ot->
idname =
"PTCACHE_OT_free_bake_all";
315 ot->
description =
"Delete all baked caches of all objects in the current scene";
352 ot->
name =
"Bake Physics";
354 ot->
idname =
"PTCACHE_OT_bake";
371 ot->
name =
"Delete Physics Bake";
373 ot->
idname =
"PTCACHE_OT_free_bake";
385 ot->
name =
"Bake from Cache";
387 ot->
idname =
"PTCACHE_OT_bake_from_cache";
440 ot->
name =
"Add New Cache";
442 ot->
idname =
"PTCACHE_OT_add";
454 ot->
name =
"Delete Current Cache";
456 ot->
idname =
"PTCACHE_OT_remove";
#define FOREACH_SCENE_OBJECT_END
#define FOREACH_SCENE_OBJECT_BEGIN(scene, _instance)
#define ID_IS_OVERRIDE_LIBRARY_REAL(_id)
#define ID_IS_EDITABLE(_id)
Read Blender memory allocation and freeing.
bool all(VecOp< bool, D >) RET
void WM_main_add_notifier(uint type, void *reference)
void * MEM_new_uninitialized(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
static bool ptcache_add_remove_poll(bContext *C)
void WM_jobs_callbacks(wmJob *wm_job, wm_jobs_start_callback startjob, void(*initjob)(void *), void(*update)(void *), void(*endjob)(void *))
static wmOperatorStatus ptcache_bake_invoke(bContext *C, wmOperator *op, const wmEvent *)
static void ptcache_free_bake(PointCache *cache)
static wmOperatorStatus ptcache_add_new_exec(bContext *C, wmOperator *)
Depsgraph * CTX_data_depsgraph_pointer(const bContext *C)
static int ptcache_job_break(void *customdata)
static wmOperatorStatus ptcache_free_bake_exec(bContext *C, wmOperator *)
void PTCACHE_OT_bake(wmOperatorType *ot)
wmWindow * CTX_wm_window(const bContext *C)
void WM_jobs_customdata_set(wmJob *wm_job, void *customdata, void(*free)(void *customdata))
ViewLayer * CTX_data_view_layer(const bContext *C)
void WM_jobs_start(wmWindowManager *wm, wmJob *wm_job)
void BKE_ptcache_free(struct PointCache *cache)
void PTCACHE_OT_bake_all(wmOperatorType *ot)
void WM_locked_interface_set(wmWindowManager *wm, bool lock)
void PTCACHE_OT_remove(wmOperatorType *ot)
void CTX_wm_operator_poll_msg_set(bContext *C, const char *msg)
void PTCACHE_OT_add(wmOperatorType *ot)
void * MEM_new_zeroed(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
static bool ptcache_poll(bContext *C)
void BLI_remlink(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void DEG_id_tag_update(ID *id, unsigned int flags)
bool WM_jobs_has_running(const wmWindowManager *window_manager, const void *owner, const eWM_JobType type, const eWM_JobFlag exclude_flags)
wmWindowManager * CTX_wm_manager(const bContext *C)
void PTCACHE_OT_free_bake_all(wmOperatorType *ot)
static void ptcache_job_startjob(void *customdata, wmJobWorkerStatus *worker_status)
static wmOperatorStatus ptcache_bake_from_cache_exec(bContext *C, wmOperator *)
void BKE_ptcache_bake(struct PTCacheBaker *baker)
void BKE_ptcache_ids_from_object(ListBaseT< PTCacheID > *lb, struct Object *ob, struct Scene *scene, int duplis)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
static void ptcache_job_free(void *customdata)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
static void ptcache_bake_cancel(bContext *C, wmOperator *op)
static wmOperatorStatus ptcache_free_bake_all_exec(bContext *C, wmOperator *)
void PTCACHE_OT_bake_from_cache(wmOperatorType *ot)
wmEventHandler_Op * WM_event_add_modal_handler(bContext *C, wmOperator *op)
constexpr int MAX_DUPLI_RECUR
void WM_jobs_kill_type(wmWindowManager *wm, const void *owner, int job_type)
void PTCACHE_OT_free_bake(wmOperatorType *ot)
Main * CTX_data_main(const bContext *C)
wmJob * WM_jobs_get(wmWindowManager *wm, wmWindow *win, const void *owner, const char *name, const eWM_JobFlag flag, const eWM_JobType job_type)
void PE_free_ptcache_edit(PTCacheEdit *edit)
ID_Type GS(const char *name)
struct PointCache * BKE_ptcache_add(ListBaseT< PointCache > *ptcaches)
PTCacheID BKE_ptcache_id_find(struct Object *ob, struct Scene *scene, struct PointCache *cache)
Scene * CTX_data_scene(const bContext *C)
static void ptcache_job_endjob(void *customdata)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
static wmOperatorStatus ptcache_bake_exec(bContext *C, wmOperator *op)
void WM_jobs_timer(wmJob *wm_job, double time_step, uint note, uint endnote, void(*timer_step)(void *))
static bool ptcache_bake_all_poll(bContext *C)
static void ptcache_job_update(void *customdata, float progress, int *cancel)
PointerRNA CTX_data_pointer_get_type(const bContext *C, const char *member, StructRNA *type)
static PTCacheBaker * ptcache_baker_create(bContext *C, wmOperator *op, bool all)
static wmOperatorStatus ptcache_remove_exec(bContext *C, wmOperator *)
static wmOperatorStatus ptcache_bake_modal(bContext *C, wmOperator *op, const wmEvent *)
struct Depsgraph * depsgraph
void(*) update_progress(void *data, float progress, int *cancel)
struct ViewLayer * view_layer
struct PointCache * cache
unsigned int default_step
struct PointCache ** cache_ptr
ListBaseT< PointCache > * ptcaches
struct PTCacheEdit * edit
wmOperatorStatus(*) exec(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
void(*) cancel(bContext *C, wmOperator *op)
bool(*) poll(bContext *C) ATTR_WARN_UNUSED_RESULT
wmOperatorStatus(*) invoke(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
wmOperatorStatus(*) modal(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
struct wmOperatorType * type