Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/fluid.c
| Show All 20 Lines | |||||
| * \ingroup bke | * \ingroup bke | ||||
| */ | */ | ||||
| #include "MEM_guardedalloc.h" | #include "MEM_guardedalloc.h" | ||||
| #include "BLI_listbase.h" | #include "BLI_listbase.h" | ||||
| #include "BLI_fileops.h" | #include "BLI_fileops.h" | ||||
| #include "BLI_hash.h" | |||||
| #include "BLI_math.h" | #include "BLI_math.h" | ||||
| #include "BLI_path_util.h" | #include "BLI_path_util.h" | ||||
| #include "BLI_string.h" | #include "BLI_string.h" | ||||
| #include "BLI_task.h" | #include "BLI_task.h" | ||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| #include "DNA_fluid_types.h" | #include "DNA_fluid_types.h" | ||||
| #include "DNA_modifier_types.h" | #include "DNA_modifier_types.h" | ||||
| ▲ Show 20 Lines • Show All 4,768 Lines • ▼ Show 20 Lines | #ifdef WITH_OPENVDB | ||||
| mmd->domain->cache_data_format = FLUID_DOMAIN_FILE_OPENVDB; | mmd->domain->cache_data_format = FLUID_DOMAIN_FILE_OPENVDB; | ||||
| mmd->domain->cache_particle_format = FLUID_DOMAIN_FILE_OPENVDB; | mmd->domain->cache_particle_format = FLUID_DOMAIN_FILE_OPENVDB; | ||||
| mmd->domain->cache_noise_format = FLUID_DOMAIN_FILE_OPENVDB; | mmd->domain->cache_noise_format = FLUID_DOMAIN_FILE_OPENVDB; | ||||
| #else | #else | ||||
| mmd->domain->cache_data_format = FLUID_DOMAIN_FILE_UNI; | mmd->domain->cache_data_format = FLUID_DOMAIN_FILE_UNI; | ||||
| mmd->domain->cache_particle_format = FLUID_DOMAIN_FILE_UNI; | mmd->domain->cache_particle_format = FLUID_DOMAIN_FILE_UNI; | ||||
| mmd->domain->cache_noise_format = FLUID_DOMAIN_FILE_UNI; | mmd->domain->cache_noise_format = FLUID_DOMAIN_FILE_UNI; | ||||
| #endif | #endif | ||||
| modifier_path_init(mmd->domain->cache_directory, | char cache_name[64]; | ||||
| sizeof(mmd->domain->cache_directory), | BKE_fluid_cache_new_name_for_current_session(sizeof(cache_name), cache_name); | ||||
| FLUID_DOMAIN_DIR_DEFAULT); | modifier_path_init( | ||||
| mmd->domain->cache_directory, sizeof(mmd->domain->cache_directory), cache_name); | |||||
| /* time options */ | /* time options */ | ||||
| mmd->domain->time_scale = 1.0; | mmd->domain->time_scale = 1.0; | ||||
| mmd->domain->cfl_condition = 4.0; | mmd->domain->cfl_condition = 4.0; | ||||
| mmd->domain->timesteps_minimum = 1; | mmd->domain->timesteps_minimum = 1; | ||||
| mmd->domain->timesteps_maximum = 4; | mmd->domain->timesteps_maximum = 4; | ||||
| /* display options */ | /* display options */ | ||||
| ▲ Show 20 Lines • Show All 319 Lines • ▼ Show 20 Lines | else if (tmmd->effector) { | ||||
| tmes->subframes = tmes->subframes; | tmes->subframes = tmes->subframes; | ||||
| /* guide options */ | /* guide options */ | ||||
| tmes->guide_mode = mes->guide_mode; | tmes->guide_mode = mes->guide_mode; | ||||
| tmes->vel_multi = mes->vel_multi; | tmes->vel_multi = mes->vel_multi; | ||||
| } | } | ||||
| } | } | ||||
| void BKE_fluid_cache_new_name_for_current_session(int maxlen, char *r_name) | |||||
| { | |||||
| static int counter = 1; | |||||
| BLI_snprintf(r_name, maxlen, FLUID_DOMAIN_DIR_DEFAULT "_%x", BLI_hash_int(counter)); | |||||
| counter++; | |||||
| } | |||||
| /** \} */ | /** \} */ | ||||