diff options
-rw-r--r-- | source/blender/blenkernel/BKE_smoke.h | 9 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/effect.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/pointcache.c | 18 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/smoke.c | 18 |
4 files changed, 24 insertions, 23 deletions
diff --git a/source/blender/blenkernel/BKE_smoke.h b/source/blender/blenkernel/BKE_smoke.h index 1a11dd0151d..cac207b3922 100644 --- a/source/blender/blenkernel/BKE_smoke.h +++ b/source/blender/blenkernel/BKE_smoke.h @@ -30,15 +30,16 @@ struct Mesh *smokeModifier_do( struct Scene *scene, struct Object *ob, struct Mesh *me); -void smoke_reallocate_fluid(struct SmokeDomainSettings *sds, float dx, int res[3], int free_old); -void smoke_reallocate_highres_fluid(struct SmokeDomainSettings *sds, float dx, int res[3], int free_old); void smokeModifier_free(struct SmokeModifierData *smd); void smokeModifier_reset(struct SmokeModifierData *smd); void smokeModifier_reset_turbulence(struct SmokeModifierData *smd); void smokeModifier_createType(struct SmokeModifierData *smd); void smokeModifier_copy(const SmokeModifierData *smd, struct SmokeModifierData *tsmd, const int flag); -float smoke_get_velocity_at(struct Object *ob, float position[3], float velocity[3]); -int smoke_get_data_flags(struct SmokeDomainSettings *sds); +void BKE_smoke_reallocate_fluid(struct SmokeDomainSettings *sds, float dx, int res[3], int free_old); +void BKE_smoke_reallocate_highres_fluid(struct SmokeDomainSettings *sds, float dx, int res[3], int free_old); + +float BKE_smoke_get_velocity_at(struct Object *ob, float position[3], float velocity[3]); +int BKE_smoke_get_data_flags(struct SmokeDomainSettings *sds); #endif /* __BKE_SMOKE_H__ */ diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c index c3e9afcca1e..fddaeb32ac3 100644 --- a/source/blender/blenkernel/intern/effect.c +++ b/source/blender/blenkernel/intern/effect.c @@ -946,7 +946,7 @@ static void do_physical_effector(EffectorCache *eff, EffectorData *efd, Effected zero_v3(force); if (pd->f_source) { float density; - if ((density = smoke_get_velocity_at(pd->f_source, point->loc, force)) >= 0.0f) { + if ((density = BKE_smoke_get_velocity_at(pd->f_source, point->loc, force)) >= 0.0f) { float influence = strength * efd->falloff; if (pd->flag & PFIELD_SMOKE_DENSITY) { influence *= density; diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index 5be0b083d5b..ada254ba77e 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -580,7 +580,7 @@ static int ptcache_smoke_write(PTCacheFile *pf, void *smoke_v) SmokeModifierData *smd= (SmokeModifierData *)smoke_v; SmokeDomainSettings *sds = smd->domain; int ret = 0; - int fluid_fields = smoke_get_data_flags(sds); + int fluid_fields = BKE_smoke_get_data_flags(sds); /* version header */ ptcache_file_write(pf, SMOKE_CACHE_VERSION, 4, sizeof(char)); @@ -698,7 +698,7 @@ static int ptcache_smoke_read_old(PTCacheFile *pf, void *smoke_v) unsigned char *obstacles; float *tmp_array = MEM_callocN(out_len, "Smoke old cache tmp"); - int fluid_fields = smoke_get_data_flags(sds); + int fluid_fields = BKE_smoke_get_data_flags(sds); /* Part part of the new cache header */ sds->active_color[0] = 0.7f; @@ -767,7 +767,7 @@ static int ptcache_smoke_read(PTCacheFile *pf, void *smoke_v) char version[4]; int ch_res[3]; float ch_dx; - int fluid_fields = smoke_get_data_flags(sds); + int fluid_fields = BKE_smoke_get_data_flags(sds); int cache_fields = 0; int active_fields = 0; int reallocate = 0; @@ -805,12 +805,12 @@ static int ptcache_smoke_read(PTCacheFile *pf, void *smoke_v) /* reallocate fluid if needed*/ if (reallocate) { sds->active_fields = active_fields | cache_fields; - smoke_reallocate_fluid(sds, ch_dx, ch_res, 1); + BKE_smoke_reallocate_fluid(sds, ch_dx, ch_res, 1); sds->dx = ch_dx; copy_v3_v3_int(sds->res, ch_res); sds->total_cells = ch_res[0]*ch_res[1]*ch_res[2]; if (sds->flags & MOD_SMOKE_HIGHRES) { - smoke_reallocate_highres_fluid(sds, ch_dx, ch_res, 1); + BKE_smoke_reallocate_highres_fluid(sds, ch_dx, ch_res, 1); } } @@ -959,7 +959,7 @@ static int ptcache_smoke_openvdb_write(struct OpenVDBWriter *writer, void *smoke OpenVDBWriter_add_meta_v3(writer, "blender/smoke/active_color", sds->active_color); OpenVDBWriter_add_meta_mat4(writer, "blender/smoke/obmat", sds->obmat); - int fluid_fields = smoke_get_data_flags(sds); + int fluid_fields = BKE_smoke_get_data_flags(sds); struct OpenVDBFloatGrid *clip_grid = NULL; @@ -1042,7 +1042,7 @@ static int ptcache_smoke_openvdb_read(struct OpenVDBReader *reader, void *smoke_ SmokeDomainSettings *sds = smd->domain; - int fluid_fields = smoke_get_data_flags(sds); + int fluid_fields = BKE_smoke_get_data_flags(sds); int active_fields, cache_fields = 0; int cache_res[3]; float cache_dx; @@ -1084,13 +1084,13 @@ static int ptcache_smoke_openvdb_read(struct OpenVDBReader *reader, void *smoke_ /* reallocate fluid if needed*/ if (reallocate) { sds->active_fields = active_fields | cache_fields; - smoke_reallocate_fluid(sds, cache_dx, cache_res, 1); + BKE_smoke_reallocate_fluid(sds, cache_dx, cache_res, 1); sds->dx = cache_dx; copy_v3_v3_int(sds->res, cache_res); sds->total_cells = cache_res[0] * cache_res[1] * cache_res[2]; if (sds->flags & MOD_SMOKE_HIGHRES) { - smoke_reallocate_highres_fluid(sds, cache_dx, cache_res, 1); + BKE_smoke_reallocate_highres_fluid(sds, cache_dx, cache_res, 1); } } diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c index aee6e5138bc..3c779b54c4d 100644 --- a/source/blender/blenkernel/intern/smoke.c +++ b/source/blender/blenkernel/intern/smoke.c @@ -121,13 +121,13 @@ void smoke_initBlenderRNA(struct FLUID_3D *UNUSED(fluid), float *UNUSED(alpha), int *UNUSED(border_colli), float *UNUSED(burning_rate), float *UNUSED(flame_smoke), float *UNUSED(flame_smoke_color), float *UNUSED(flame_vorticity), float *UNUSED(flame_ignition_temp), float *UNUSED(flame_max_temp)) {} struct Mesh *smokeModifier_do(SmokeModifierData *UNUSED(smd), Depsgraph *UNUSED(depsgraph), Scene *UNUSED(scene), Object *UNUSED(ob), Mesh *UNUSED(me)) { return NULL; } -float smoke_get_velocity_at(struct Object *UNUSED(ob), float UNUSED(position[3]), float UNUSED(velocity[3])) { return 0.0f; } +float BKE_smoke_get_velocity_at(struct Object *UNUSED(ob), float UNUSED(position[3]), float UNUSED(velocity[3])) { return 0.0f; } #endif /* WITH_SMOKE */ #ifdef WITH_SMOKE -void smoke_reallocate_fluid(SmokeDomainSettings *sds, float dx, int res[3], int free_old) +void BKE_smoke_reallocate_fluid(SmokeDomainSettings *sds, float dx, int res[3], int free_old) { int use_heat = (sds->active_fields & SM_ACTIVE_HEAT); int use_fire = (sds->active_fields & SM_ACTIVE_FIRE); @@ -149,7 +149,7 @@ void smoke_reallocate_fluid(SmokeDomainSettings *sds, float dx, int res[3], int sds->shadow = MEM_callocN(sizeof(float) * res[0] * res[1] * res[2], "SmokeDomainShadow"); } -void smoke_reallocate_highres_fluid(SmokeDomainSettings *sds, float dx, int res[3], int free_old) +void BKE_smoke_reallocate_highres_fluid(SmokeDomainSettings *sds, float dx, int res[3], int free_old) { int use_fire = (sds->active_fields & (SM_ACTIVE_HEAT | SM_ACTIVE_FIRE)); int use_colors = (sds->active_fields & SM_ACTIVE_COLORS); @@ -293,13 +293,13 @@ static int smokeModifier_init(SmokeModifierData *smd, Object *ob, int scene_fram copy_v3_v3_int(sds->res_max, res); /* allocate fluid */ - smoke_reallocate_fluid(sds, sds->dx, sds->res, 0); + BKE_smoke_reallocate_fluid(sds, sds->dx, sds->res, 0); smd->time = scene_framenr; /* allocate highres fluid */ if (sds->flags & MOD_SMOKE_HIGHRES) { - smoke_reallocate_highres_fluid(sds, sds->dx, sds->res, 0); + BKE_smoke_reallocate_highres_fluid(sds, sds->dx, sds->res, 0); } /* allocate shadow buffer */ if (!sds->shadow) @@ -1929,9 +1929,9 @@ static void adjustDomainResolution(SmokeDomainSettings *sds, int new_shift[3], E struct FLUID_3D *fluid_old = sds->fluid; struct WTURBULENCE *turb_old = sds->wt; /* allocate new fluid data */ - smoke_reallocate_fluid(sds, sds->dx, res, 0); + BKE_smoke_reallocate_fluid(sds, sds->dx, res, 0); if (sds->flags & MOD_SMOKE_HIGHRES) { - smoke_reallocate_highres_fluid(sds, sds->dx, res, 0); + BKE_smoke_reallocate_highres_fluid(sds, sds->dx, res, 0); } /* copy values from old fluid to new */ @@ -3077,7 +3077,7 @@ static void smoke_calc_transparency(SmokeDomainSettings *sds, ViewLayer *view_la /* get smoke velocity and density at given coordinates * returns fluid density or -1.0f if outside domain. */ -float smoke_get_velocity_at(struct Object *ob, float position[3], float velocity[3]) +float BKE_smoke_get_velocity_at(struct Object *ob, float position[3], float velocity[3]) { SmokeModifierData *smd = (SmokeModifierData *)modifiers_findByType(ob, eModifierType_Smoke); zero_v3(velocity); @@ -3131,7 +3131,7 @@ float smoke_get_velocity_at(struct Object *ob, float position[3], float velocity return -1.0f; } -int smoke_get_data_flags(SmokeDomainSettings *sds) +int BKE_smoke_get_data_flags(SmokeDomainSettings *sds) { int flags = 0; |