48#define FLUID_JOB_BAKE_ALL "FLUID_OT_bake_all"
49#define FLUID_JOB_BAKE_DATA "FLUID_OT_bake_data"
50#define FLUID_JOB_BAKE_NOISE "FLUID_OT_bake_noise"
51#define FLUID_JOB_BAKE_MESH "FLUID_OT_bake_mesh"
52#define FLUID_JOB_BAKE_PARTICLES "FLUID_OT_bake_particles"
53#define FLUID_JOB_BAKE_GUIDES "FLUID_OT_bake_guides"
54#define FLUID_JOB_FREE_ALL "FLUID_OT_free_all"
55#define FLUID_JOB_FREE_DATA "FLUID_OT_free_data"
56#define FLUID_JOB_FREE_NOISE "FLUID_OT_free_noise"
57#define FLUID_JOB_FREE_MESH "FLUID_OT_free_mesh"
58#define FLUID_JOB_FREE_PARTICLES "FLUID_OT_free_particles"
59#define FLUID_JOB_FREE_GUIDES "FLUID_OT_free_guides"
60#define FLUID_JOB_BAKE_PAUSE "FLUID_OT_pause_bake"
141 BLI_strncpy(error_msg,
N_(
"Bake failed: no Fluid modifier found"), error_size);
146 BLI_strncpy(error_msg,
N_(
"Bake failed: invalid domain"), error_size);
166 bool is_relative =
false;
177 "Fluid: Empty cache path, reset to default '%s'",
196 "Fluid: Could not create cache directory '%s', reset to default '%s'",
204 "Fluid: Could not use default cache directory '%s', "
205 "please define a valid cache path manually",
235 int frame = 1, orig_frame;
237 int *pause_frame =
nullptr;
256 is_first_frame = ((*pause_frame) == 0);
260 orig_frame = scene->
r.
cfra;
261 scene->
r.
cfra = frame;
268 (*pause_frame) = frame;
284 scene->
r.
cfra = frame;
297 scene->
r.
cfra = orig_frame;
332 G.is_rendering =
false;
344 if (fds->
error[0] !=
'\0') {
368 G.is_rendering =
true;
429 worker_status->
stop =
false;
437 G.is_rendering =
false;
452 if (fds->
error[0] !=
'\0') {
473 G.is_rendering =
true;
504 worker_status->
stop =
false;
515 char error_msg[256] =
"\0";
542 char error_msg[256] =
"\0";
586 switch (event->
type) {
686 ot->name =
"Bake All";
687 ot->description =
"Bake Entire Fluid Simulation";
700 ot->name =
"Free All";
701 ot->description =
"Free Entire Fluid Simulation";
712 ot->name =
"Bake Data";
713 ot->description =
"Bake Fluid Data";
726 ot->name =
"Free Data";
727 ot->description =
"Free Fluid Data";
738 ot->name =
"Bake Noise";
739 ot->description =
"Bake Fluid Noise";
752 ot->name =
"Free Noise";
753 ot->description =
"Free Fluid Noise";
764 ot->name =
"Bake Mesh";
765 ot->description =
"Bake Fluid Mesh";
778 ot->name =
"Free Mesh";
779 ot->description =
"Free Fluid Mesh";
790 ot->name =
"Bake Particles";
791 ot->description =
"Bake Fluid Particles";
804 ot->name =
"Free Particles";
805 ot->description =
"Free Fluid Particles";
816 ot->name =
"Bake Guides";
817 ot->description =
"Bake Fluid Guiding";
830 ot->name =
"Free Guides";
831 ot->description =
"Free Fluid Guiding";
842 ot->name =
"Pause Bake";
843 ot->description =
"Pause Bake";
wmWindow * CTX_wm_window(const bContext *C)
Depsgraph * CTX_data_depsgraph_pointer(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
Main * CTX_data_main(const bContext *C)
wmWindowManager * CTX_wm_manager(const bContext *C)
void BKE_fluid_cache_new_name_for_current_session(int maxlen, char *r_name)
void BKE_fluid_cache_free(struct FluidDomainSettings *fds, struct Object *ob, int cache_map)
void BKE_modifier_path_init(char *path, int path_maxncpy, const char *name)
ModifierData * BKE_modifiers_findby_type(const Object *ob, ModifierType type)
const char * BKE_modifier_path_relbase_from_global(Object *ob)
const char * BKE_modifier_path_relbase(Main *bmain, Object *ob)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BKE_report(ReportList *reports, eReportType type, const char *message)
void BKE_spacedata_draw_locks(bool set)
bool BLI_dir_create_recursive(const char *dirname) ATTR_NONNULL()
bool BLI_path_abs(char path[FILE_MAX], const char *basepath) ATTR_NONNULL(1
#define BLI_path_join(...)
bool void BLI_path_rel(char path[FILE_MAX], const char *basepath) ATTR_NONNULL(1)
#define STRNCPY(dst, src)
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
Platform independent time functions.
double BLI_time_now_seconds(void)
void DEG_id_tag_update(ID *id, unsigned int flags)
#define FLUID_DOMAIN_DIR_DATA
#define FLUID_DOMAIN_DIR_PARTICLES
#define FLUID_DOMAIN_DIR_MESH
#define FLUID_DOMAIN_DIR_GUIDE
#define FLUID_DOMAIN_DIR_SCRIPT
@ FLUID_DOMAIN_BAKED_DATA
@ FLUID_DOMAIN_OUTDATED_GUIDE
@ FLUID_DOMAIN_OUTDATED_PARTICLES
@ FLUID_DOMAIN_BAKING_MESH
@ FLUID_DOMAIN_BAKING_NOISE
@ FLUID_DOMAIN_BAKING_GUIDE
@ FLUID_DOMAIN_OUTDATED_NOISE
@ FLUID_DOMAIN_BAKED_NOISE
@ FLUID_DOMAIN_BAKED_MESH
@ FLUID_DOMAIN_OUTDATED_MESH
@ FLUID_DOMAIN_BAKING_DATA
@ FLUID_DOMAIN_BAKED_GUIDE
@ FLUID_DOMAIN_BAKED_PARTICLES
@ FLUID_DOMAIN_OUTDATED_DATA
@ FLUID_DOMAIN_BAKING_PARTICLES
#define FLUID_DOMAIN_DIR_CONFIG
@ FLUID_DOMAIN_EXPORT_MANTA_SCRIPT
#define FLUID_DOMAIN_DIR_NOISE
Object is a sort of wrapper for general info.
bool ED_operator_object_active_editable(bContext *C)
void ED_update_for_newframe(Main *bmain, Depsgraph *depsgraph)
Read Guarded memory(de)allocation.
@ WM_JOB_TYPE_OBJECT_SIM_FLUID
void *(* MEM_mallocN)(size_t len, const char *str)
void MEM_freeN(void *vmemh)
Object * context_active_object(const bContext *C)
#define FLUID_JOB_FREE_DATA
#define FLUID_JOB_BAKE_GUIDES
static int fluid_bake_exec(bContext *C, wmOperator *op)
#define FLUID_JOB_BAKE_ALL
void FLUID_OT_free_mesh(wmOperatorType *ot)
static void fluid_bake_endjob(void *customdata)
static bool fluid_is_bake_guiding(FluidJob *job)
static bool fluid_is_bake_particle(FluidJob *job)
static bool fluid_is_free_data(FluidJob *job)
static bool fluid_is_bake_noise(FluidJob *job)
static bool fluid_validatepaths(FluidJob *job, ReportList *reports)
#define FLUID_JOB_FREE_MESH
void FLUID_OT_free_particles(wmOperatorType *ot)
#define FLUID_JOB_FREE_ALL
void FLUID_OT_free_all(wmOperatorType *ot)
void FLUID_OT_bake_guides(wmOperatorType *ot)
static void fluid_free_startjob(void *customdata, wmJobWorkerStatus *worker_status)
static int fluid_pause_exec(bContext *C, wmOperator *op)
static int fluid_bake_modal(bContext *C, wmOperator *, const wmEvent *event)
static bool fluid_is_free_mesh(FluidJob *job)
void FLUID_OT_free_guides(wmOperatorType *ot)
#define FLUID_JOB_BAKE_PAUSE
void FLUID_OT_bake_particles(wmOperatorType *ot)
static bool fluid_initjob(bContext *C, FluidJob *job, wmOperator *op, char *error_msg, int error_size)
static void fluid_free_endjob(void *customdata)
static bool fluid_is_free_guiding(FluidJob *job)
static bool fluid_is_bake_all(FluidJob *job)
static void fluid_bake_free(void *customdata)
#define FLUID_JOB_BAKE_NOISE
#define FLUID_JOB_FREE_PARTICLES
void FLUID_OT_bake_all(wmOperatorType *ot)
#define FLUID_JOB_BAKE_PARTICLES
static bool fluid_is_bake_mesh(FluidJob *job)
static void fluid_bake_startjob(void *customdata, wmJobWorkerStatus *worker_status)
static bool fluid_is_free_all(FluidJob *job)
static bool fluid_is_free_noise(FluidJob *job)
static bool fluid_is_free_particles(FluidJob *job)
#define FLUID_JOB_FREE_NOISE
void FLUID_OT_bake_data(wmOperatorType *ot)
static bool fluid_is_bake_data(FluidJob *job)
void FLUID_OT_free_noise(wmOperatorType *ot)
#define FLUID_JOB_FREE_GUIDES
static int fluid_free_exec(bContext *C, wmOperator *op)
#define FLUID_JOB_BAKE_DATA
static int fluid_bake_invoke(bContext *C, wmOperator *op, const wmEvent *)
void FLUID_OT_pause_bake(wmOperatorType *ot)
void FLUID_OT_bake_noise(wmOperatorType *ot)
void FLUID_OT_free_data(wmOperatorType *ot)
#define FLUID_JOB_BAKE_MESH
static void fluid_bake_sequence(FluidJob *job)
void FLUID_OT_bake_mesh(wmOperatorType *ot)
int cache_frame_pause_mesh
int cache_frame_pause_data
int cache_frame_pause_particles
int cache_frame_pause_guide
char cache_directory[1024]
int cache_frame_pause_noise
struct FluidDomainSettings * domain
struct ReportList * reports
struct wmOperatorType * type
void WM_report_banners_cancel(Main *bmain)
wmEventHandler_Op * WM_event_add_modal_handler(bContext *C, wmOperator *op)
void WM_reportf(eReportType type, const char *format,...)
void WM_set_locked_interface(wmWindowManager *wm, bool lock)
void WM_jobs_timer(wmJob *wm_job, double time_step, uint note, uint endnote)
void WM_jobs_start(wmWindowManager *wm, wmJob *wm_job)
wmJob * WM_jobs_get(wmWindowManager *wm, wmWindow *win, const void *owner, const char *name, const eWM_JobFlag flag, const eWM_JobType job_type)
void WM_jobs_callbacks(wmJob *wm_job, wm_jobs_start_callback startjob, void(*initjob)(void *), void(*update)(void *), void(*endjob)(void *))
bool WM_jobs_test(const wmWindowManager *wm, const void *owner, int job_type)
void WM_jobs_customdata_set(wmJob *wm_job, void *customdata, void(*free)(void *customdata))