Blender V4.3
physics_fluid.cc File Reference
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <sys/stat.h>
#include "MEM_guardedalloc.h"
#include "DNA_action_types.h"
#include "DNA_object_types.h"
#include "BLI_blenlib.h"
#include "BLI_path_utils.hh"
#include "BLI_time.h"
#include "BLI_utildefines.h"
#include "BLT_translation.hh"
#include "BKE_context.hh"
#include "BKE_fluid.h"
#include "BKE_global.hh"
#include "BKE_main.hh"
#include "BKE_modifier.hh"
#include "BKE_report.hh"
#include "BKE_screen.hh"
#include "DEG_depsgraph.hh"
#include "ED_object.hh"
#include "ED_screen.hh"
#include "WM_api.hh"
#include "WM_types.hh"
#include "physics_intern.hh"
#include "DNA_fluid_types.h"
#include "DNA_scene_types.h"

Go to the source code of this file.

Classes

struct  FluidJob
 

Macros

#define FLUID_JOB_BAKE_ALL   "FLUID_OT_bake_all"
 
#define FLUID_JOB_BAKE_DATA   "FLUID_OT_bake_data"
 
#define FLUID_JOB_BAKE_NOISE   "FLUID_OT_bake_noise"
 
#define FLUID_JOB_BAKE_MESH   "FLUID_OT_bake_mesh"
 
#define FLUID_JOB_BAKE_PARTICLES   "FLUID_OT_bake_particles"
 
#define FLUID_JOB_BAKE_GUIDES   "FLUID_OT_bake_guides"
 
#define FLUID_JOB_FREE_ALL   "FLUID_OT_free_all"
 
#define FLUID_JOB_FREE_DATA   "FLUID_OT_free_data"
 
#define FLUID_JOB_FREE_NOISE   "FLUID_OT_free_noise"
 
#define FLUID_JOB_FREE_MESH   "FLUID_OT_free_mesh"
 
#define FLUID_JOB_FREE_PARTICLES   "FLUID_OT_free_particles"
 
#define FLUID_JOB_FREE_GUIDES   "FLUID_OT_free_guides"
 
#define FLUID_JOB_BAKE_PAUSE   "FLUID_OT_pause_bake"
 

Functions

static bool fluid_is_bake_all (FluidJob *job)
 
static bool fluid_is_bake_data (FluidJob *job)
 
static bool fluid_is_bake_noise (FluidJob *job)
 
static bool fluid_is_bake_mesh (FluidJob *job)
 
static bool fluid_is_bake_particle (FluidJob *job)
 
static bool fluid_is_bake_guiding (FluidJob *job)
 
static bool fluid_is_free_all (FluidJob *job)
 
static bool fluid_is_free_data (FluidJob *job)
 
static bool fluid_is_free_noise (FluidJob *job)
 
static bool fluid_is_free_mesh (FluidJob *job)
 
static bool fluid_is_free_particles (FluidJob *job)
 
static bool fluid_is_free_guiding (FluidJob *job)
 
static bool fluid_initjob (bContext *C, FluidJob *job, wmOperator *op, char *error_msg, int error_size)
 
static bool fluid_validatepaths (FluidJob *job, ReportList *reports)
 
static void fluid_bake_free (void *customdata)
 
static void fluid_bake_sequence (FluidJob *job)
 
static void fluid_bake_endjob (void *customdata)
 
static void fluid_bake_startjob (void *customdata, wmJobWorkerStatus *worker_status)
 
static void fluid_free_endjob (void *customdata)
 
static void fluid_free_startjob (void *customdata, wmJobWorkerStatus *worker_status)
 
static int fluid_bake_exec (bContext *C, wmOperator *op)
 
static int fluid_bake_invoke (bContext *C, wmOperator *op, const wmEvent *)
 
static int fluid_bake_modal (bContext *C, wmOperator *, const wmEvent *event)
 
static int fluid_free_exec (bContext *C, wmOperator *op)
 
static int fluid_pause_exec (bContext *C, wmOperator *op)
 
void FLUID_OT_bake_all (wmOperatorType *ot)
 
void FLUID_OT_free_all (wmOperatorType *ot)
 
void FLUID_OT_bake_data (wmOperatorType *ot)
 
void FLUID_OT_free_data (wmOperatorType *ot)
 
void FLUID_OT_bake_noise (wmOperatorType *ot)
 
void FLUID_OT_free_noise (wmOperatorType *ot)
 
void FLUID_OT_bake_mesh (wmOperatorType *ot)
 
void FLUID_OT_free_mesh (wmOperatorType *ot)
 
void FLUID_OT_bake_particles (wmOperatorType *ot)
 
void FLUID_OT_free_particles (wmOperatorType *ot)
 
void FLUID_OT_bake_guides (wmOperatorType *ot)
 
void FLUID_OT_free_guides (wmOperatorType *ot)
 
void FLUID_OT_pause_bake (wmOperatorType *ot)
 

Macro Definition Documentation

◆ FLUID_JOB_BAKE_ALL

#define FLUID_JOB_BAKE_ALL   "FLUID_OT_bake_all"

Definition at line 48 of file physics_fluid.cc.

Referenced by fluid_is_bake_all(), and FLUID_OT_bake_all().

◆ FLUID_JOB_BAKE_DATA

#define FLUID_JOB_BAKE_DATA   "FLUID_OT_bake_data"

Definition at line 49 of file physics_fluid.cc.

Referenced by fluid_is_bake_data(), and FLUID_OT_bake_data().

◆ FLUID_JOB_BAKE_GUIDES

#define FLUID_JOB_BAKE_GUIDES   "FLUID_OT_bake_guides"

Definition at line 53 of file physics_fluid.cc.

Referenced by fluid_is_bake_guiding(), and FLUID_OT_bake_guides().

◆ FLUID_JOB_BAKE_MESH

#define FLUID_JOB_BAKE_MESH   "FLUID_OT_bake_mesh"

Definition at line 51 of file physics_fluid.cc.

Referenced by fluid_is_bake_mesh(), and FLUID_OT_bake_mesh().

◆ FLUID_JOB_BAKE_NOISE

#define FLUID_JOB_BAKE_NOISE   "FLUID_OT_bake_noise"

Definition at line 50 of file physics_fluid.cc.

Referenced by fluid_is_bake_noise(), and FLUID_OT_bake_noise().

◆ FLUID_JOB_BAKE_PARTICLES

#define FLUID_JOB_BAKE_PARTICLES   "FLUID_OT_bake_particles"

Definition at line 52 of file physics_fluid.cc.

Referenced by fluid_is_bake_particle(), and FLUID_OT_bake_particles().

◆ FLUID_JOB_BAKE_PAUSE

#define FLUID_JOB_BAKE_PAUSE   "FLUID_OT_pause_bake"

Definition at line 60 of file physics_fluid.cc.

Referenced by FLUID_OT_pause_bake().

◆ FLUID_JOB_FREE_ALL

#define FLUID_JOB_FREE_ALL   "FLUID_OT_free_all"

Definition at line 54 of file physics_fluid.cc.

Referenced by fluid_is_free_all(), and FLUID_OT_free_all().

◆ FLUID_JOB_FREE_DATA

#define FLUID_JOB_FREE_DATA   "FLUID_OT_free_data"

Definition at line 55 of file physics_fluid.cc.

Referenced by fluid_is_free_data(), and FLUID_OT_free_data().

◆ FLUID_JOB_FREE_GUIDES

#define FLUID_JOB_FREE_GUIDES   "FLUID_OT_free_guides"

Definition at line 59 of file physics_fluid.cc.

Referenced by fluid_is_free_guiding(), and FLUID_OT_free_guides().

◆ FLUID_JOB_FREE_MESH

#define FLUID_JOB_FREE_MESH   "FLUID_OT_free_mesh"

Definition at line 57 of file physics_fluid.cc.

Referenced by fluid_is_free_mesh(), and FLUID_OT_free_mesh().

◆ FLUID_JOB_FREE_NOISE

#define FLUID_JOB_FREE_NOISE   "FLUID_OT_free_noise"

Definition at line 56 of file physics_fluid.cc.

Referenced by fluid_is_free_noise(), and FLUID_OT_free_noise().

◆ FLUID_JOB_FREE_PARTICLES

#define FLUID_JOB_FREE_PARTICLES   "FLUID_OT_free_particles"

Definition at line 58 of file physics_fluid.cc.

Referenced by fluid_is_free_particles(), and FLUID_OT_free_particles().

Function Documentation

◆ fluid_bake_endjob()

◆ fluid_bake_exec()

◆ fluid_bake_free()

static void fluid_bake_free ( void * customdata)
static

Definition at line 225 of file physics_fluid.cc.

References MEM_freeN().

Referenced by fluid_bake_exec(), fluid_bake_invoke(), and fluid_free_exec().

◆ fluid_bake_invoke()

◆ fluid_bake_modal()

◆ fluid_bake_sequence()

◆ fluid_bake_startjob()

static void fluid_bake_startjob ( void * customdata,
wmJobWorkerStatus * worker_status )
static

Definition at line 353 of file physics_fluid.cc.

References BKE_modifier_path_relbase_from_global(), BKE_spacedata_draw_locks(), BLI_dir_create_recursive(), BLI_path_abs(), BLI_path_join, BLI_time_now_seconds(), FluidDomainSettings::cache_directory, FluidDomainSettings::cache_flag, FluidDomainSettings::cache_frame_pause_data, FluidDomainSettings::cache_frame_pause_guide, FluidDomainSettings::cache_frame_pause_mesh, FluidDomainSettings::cache_frame_pause_noise, FluidDomainSettings::cache_frame_pause_particles, DEG_id_tag_update(), FluidJob::do_update, wmJobWorkerStatus::do_update, FluidModifierData::domain, FILE_MAX, FluidDomainSettings::flags, fluid_bake_sequence(), FLUID_DOMAIN_BAKED_DATA, FLUID_DOMAIN_BAKED_GUIDE, FLUID_DOMAIN_BAKED_MESH, FLUID_DOMAIN_BAKED_NOISE, FLUID_DOMAIN_BAKED_PARTICLES, FLUID_DOMAIN_BAKING_DATA, FLUID_DOMAIN_BAKING_GUIDE, FLUID_DOMAIN_BAKING_MESH, FLUID_DOMAIN_BAKING_NOISE, FLUID_DOMAIN_BAKING_PARTICLES, FLUID_DOMAIN_DIR_CONFIG, FLUID_DOMAIN_DIR_DATA, FLUID_DOMAIN_DIR_GUIDE, FLUID_DOMAIN_DIR_MESH, FLUID_DOMAIN_DIR_NOISE, FLUID_DOMAIN_DIR_PARTICLES, FLUID_DOMAIN_DIR_SCRIPT, FLUID_DOMAIN_EXPORT_MANTA_SCRIPT, FLUID_DOMAIN_OUTDATED_DATA, FLUID_DOMAIN_OUTDATED_GUIDE, FLUID_DOMAIN_OUTDATED_MESH, FLUID_DOMAIN_OUTDATED_NOISE, FLUID_DOMAIN_OUTDATED_PARTICLES, fluid_is_bake_all(), fluid_is_bake_data(), fluid_is_bake_guiding(), fluid_is_bake_mesh(), fluid_is_bake_noise(), fluid_is_bake_particle(), FluidJob::fmd, G, Object::id, ID_RECALC_GEOMETRY, FluidJob::ob, FluidJob::pause_frame, FluidJob::progress, wmJobWorkerStatus::progress, FluidJob::start, FluidJob::stop, wmJobWorkerStatus::stop, and FluidJob::success.

Referenced by fluid_bake_exec(), and fluid_bake_invoke().

◆ fluid_free_endjob()

◆ fluid_free_exec()

◆ fluid_free_startjob()

◆ fluid_initjob()

◆ fluid_is_bake_all()

static bool fluid_is_bake_all ( FluidJob * job)
inlinestatic

Definition at line 83 of file physics_fluid.cc.

References FLUID_JOB_BAKE_ALL, STREQ, and FluidJob::type.

Referenced by fluid_bake_endjob(), and fluid_bake_startjob().

◆ fluid_is_bake_data()

static bool fluid_is_bake_data ( FluidJob * job)
inlinestatic

Definition at line 87 of file physics_fluid.cc.

References FLUID_JOB_BAKE_DATA, STREQ, and FluidJob::type.

Referenced by fluid_bake_endjob(), and fluid_bake_startjob().

◆ fluid_is_bake_guiding()

static bool fluid_is_bake_guiding ( FluidJob * job)
inlinestatic

Definition at line 103 of file physics_fluid.cc.

References FLUID_JOB_BAKE_GUIDES, STREQ, and FluidJob::type.

Referenced by fluid_bake_endjob(), and fluid_bake_startjob().

◆ fluid_is_bake_mesh()

static bool fluid_is_bake_mesh ( FluidJob * job)
inlinestatic

Definition at line 95 of file physics_fluid.cc.

References FLUID_JOB_BAKE_MESH, STREQ, and FluidJob::type.

Referenced by fluid_bake_endjob(), and fluid_bake_startjob().

◆ fluid_is_bake_noise()

static bool fluid_is_bake_noise ( FluidJob * job)
inlinestatic

Definition at line 91 of file physics_fluid.cc.

References FLUID_JOB_BAKE_NOISE, STREQ, and FluidJob::type.

Referenced by fluid_bake_endjob(), and fluid_bake_startjob().

◆ fluid_is_bake_particle()

static bool fluid_is_bake_particle ( FluidJob * job)
inlinestatic

Definition at line 99 of file physics_fluid.cc.

References FLUID_JOB_BAKE_PARTICLES, STREQ, and FluidJob::type.

Referenced by fluid_bake_endjob(), and fluid_bake_startjob().

◆ fluid_is_free_all()

static bool fluid_is_free_all ( FluidJob * job)
inlinestatic

Definition at line 107 of file physics_fluid.cc.

References FLUID_JOB_FREE_ALL, STREQ, and FluidJob::type.

Referenced by fluid_free_startjob().

◆ fluid_is_free_data()

static bool fluid_is_free_data ( FluidJob * job)
inlinestatic

Definition at line 111 of file physics_fluid.cc.

References FLUID_JOB_FREE_DATA, STREQ, and FluidJob::type.

Referenced by fluid_free_startjob().

◆ fluid_is_free_guiding()

static bool fluid_is_free_guiding ( FluidJob * job)
inlinestatic

Definition at line 127 of file physics_fluid.cc.

References FLUID_JOB_FREE_GUIDES, STREQ, and FluidJob::type.

Referenced by fluid_free_startjob().

◆ fluid_is_free_mesh()

static bool fluid_is_free_mesh ( FluidJob * job)
inlinestatic

Definition at line 119 of file physics_fluid.cc.

References FLUID_JOB_FREE_MESH, STREQ, and FluidJob::type.

Referenced by fluid_free_startjob().

◆ fluid_is_free_noise()

static bool fluid_is_free_noise ( FluidJob * job)
inlinestatic

Definition at line 115 of file physics_fluid.cc.

References FLUID_JOB_FREE_NOISE, STREQ, and FluidJob::type.

Referenced by fluid_free_startjob().

◆ fluid_is_free_particles()

static bool fluid_is_free_particles ( FluidJob * job)
inlinestatic

Definition at line 123 of file physics_fluid.cc.

References FLUID_JOB_FREE_PARTICLES, STREQ, and FluidJob::type.

Referenced by fluid_free_startjob().

◆ FLUID_OT_bake_all()

◆ FLUID_OT_bake_data()

◆ FLUID_OT_bake_guides()

◆ FLUID_OT_bake_mesh()

◆ FLUID_OT_bake_noise()

◆ FLUID_OT_bake_particles()

◆ FLUID_OT_free_all()

◆ FLUID_OT_free_data()

◆ FLUID_OT_free_guides()

◆ FLUID_OT_free_mesh()

◆ FLUID_OT_free_noise()

◆ FLUID_OT_free_particles()

◆ FLUID_OT_pause_bake()

◆ fluid_pause_exec()

◆ fluid_validatepaths()