[Bf-blender-cvs] [f3fa0fb9b17] fluid-mantaflow: Mantaflow: Updates in /blender/source

Sebastián Barschkis noreply at git.blender.org
Sat Apr 6 22:13:00 CEST 2019


Commit: f3fa0fb9b17573c3b04ecbc9249e39bb50b702c1
Author: Sebastián Barschkis
Date:   Sun Oct 28 16:22:34 2018 +0100
Branches: fluid-mantaflow
https://developer.blender.org/rBf3fa0fb9b17573c3b04ecbc9249e39bb50b702c1

Mantaflow: Updates in /blender/source

A collection of smaller changes in the C files

===================================================================

M	source/blender/alembic/intern/abc_exporter.cc
M	source/blender/blenkernel/BKE_smoke.h
M	source/blender/blenkernel/CMakeLists.txt
M	source/blender/blenkernel/intern/dynamicpaint.c
M	source/blender/blenkernel/intern/pointcache.c
M	source/blender/blenloader/intern/readfile.c
M	source/blender/blenloader/intern/versioning_250.c
M	source/blender/blenloader/intern/versioning_260.c
M	source/blender/blenloader/intern/writefile.c
M	source/blender/draw/engines/eevee/eevee_volumes.c
M	source/blender/draw/engines/workbench/workbench_volume.c
M	source/blender/draw/modes/object_mode.c
M	source/blender/editors/physics/CMakeLists.txt
M	source/blender/editors/physics/physics_intern.h
M	source/blender/editors/physics/physics_ops.c
M	source/blender/editors/space_view3d/CMakeLists.txt
M	source/blender/gpu/CMakeLists.txt
M	source/blender/gpu/intern/gpu_draw.c
M	source/blender/makesdna/DNA_modifier_types.h
M	source/blender/makesdna/DNA_particle_types.h
M	source/blender/makesrna/intern/CMakeLists.txt
M	source/blender/makesrna/intern/rna_modifier.c
M	source/blender/makesrna/intern/rna_particle.c
M	source/blender/modifiers/intern/MOD_smoke.c
M	source/blender/python/intern/CMakeLists.txt
M	source/blender/python/intern/bpy_app_build_options.c
M	source/blender/python/intern/bpy_interface.c
M	source/blender/render/CMakeLists.txt
M	source/blender/render/intern/source/voxeldata.c
M	source/blender/windowmanager/WM_api.h

===================================================================

diff --git a/source/blender/alembic/intern/abc_exporter.cc b/source/blender/alembic/intern/abc_exporter.cc
index d470488937a..60a1b9c00e2 100644
--- a/source/blender/alembic/intern/abc_exporter.cc
+++ b/source/blender/alembic/intern/abc_exporter.cc
@@ -44,6 +44,7 @@ extern "C" {
 #include "DNA_object_types.h"
 #include "DNA_scene_types.h"
 #include "DNA_space_types.h"  /* for FILE_MAX */
+#include "DNA_smoke_types.h"
 
 #include "BLI_string.h"
 
@@ -109,7 +110,8 @@ static bool object_is_smoke_sim(Object *ob)
 
 	if (md) {
 		SmokeModifierData *smd = reinterpret_cast<SmokeModifierData *>(md);
-		return (smd->type == MOD_SMOKE_TYPE_DOMAIN);
+		return (smd->type == MOD_SMOKE_TYPE_DOMAIN && smd->domain &&
+				smd->domain->type == FLUID_DOMAIN_TYPE_GAS);
 	}
 
 	return false;
@@ -548,7 +550,11 @@ void AbcExporter::createParticleSystemsWriters(Object *ob, AbcTransformWriter *x
 			m_settings.export_child_hairs = true;
 			m_shapes.push_back(new AbcHairWriter(ob, xform, m_shape_sampling_index, m_settings, psys));
 		}
-		else if (m_settings.export_particles && psys->part->type == PART_EMITTER) {
+		else if (m_settings.export_particles &&
+				 (psys->part->type & PART_EMITTER || psys->part->type & PART_MANTA_FLIP ||
+				  psys->part->type & PART_MANTA_SPRAY || psys->part->type & PART_MANTA_BUBBLE ||
+				  psys->part->type & PART_MANTA_FOAM || psys->part->type & PART_MANTA_TRACER))
+		{
 			m_shapes.push_back(new AbcPointsWriter(ob, xform, m_shape_sampling_index, m_settings, psys));
 		}
 	}
diff --git a/source/blender/blenkernel/BKE_smoke.h b/source/blender/blenkernel/BKE_smoke.h
index deee85c02d4..336c29eff48 100644
--- a/source/blender/blenkernel/BKE_smoke.h
+++ b/source/blender/blenkernel/BKE_smoke.h
@@ -40,11 +40,10 @@ 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 smoke_reallocate_fluid(struct SmokeDomainSettings *sds, int res[3], int free_old);
+void smoke_reallocate_highres_fluid(struct SmokeDomainSettings *sds, int res[3]);
 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);
 
diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt
index 77c9df12428..434543d56fe 100644
--- a/source/blender/blenkernel/CMakeLists.txt
+++ b/source/blender/blenkernel/CMakeLists.txt
@@ -54,6 +54,7 @@ set(INC
 	../../../intern/clog
 	../../../intern/libmv
 	../../../intern/opensubdiv
+	../../../intern/mantaflow/extern
 	../../../extern/curve_fit_nd
 )
 
@@ -480,8 +481,8 @@ if(WITH_MOD_FLUID)
 	add_definitions(-DWITH_MOD_FLUID)
 endif()
 
-if(WITH_MOD_SMOKE)
-	add_definitions(-DWITH_SMOKE)
+if(WITH_MOD_MANTA)
+	add_definitions(-DWITH_MANTA)
 endif()
 
 if(WITH_MOD_OCEANSIM)
diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c
index 9f2ebab6bd9..69d05824d16 100644
--- a/source/blender/blenkernel/intern/dynamicpaint.c
+++ b/source/blender/blenkernel/intern/dynamicpaint.c
@@ -5945,7 +5945,7 @@ static int dynamicPaint_doStep(
 
 					/* Apply brush on the surface depending on it's collision type */
 					if (brush->psys && brush->psys->part &&
-					    ELEM(brush->psys->part->type, PART_EMITTER, PART_FLUID) &&
+					    ELEM(brush->psys->part->type, PART_EMITTER, PART_FLUID, PART_MANTA_FLIP, PART_MANTA_SPRAY, PART_MANTA_BUBBLE, PART_MANTA_FOAM, PART_MANTA_TRACER) &&
 					    psys_check_enabled(brushObj, brush->psys, for_render))
 					{
 						/* Paint a particle system */
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c
index 7fc36c423c1..7c46ed20967 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -608,16 +608,16 @@ static int  ptcache_smoke_write(PTCacheFile *pf, void *smoke_v)
 
 		ptcache_file_compressed_write(pf, (unsigned char *)sds->shadow, in_len, out, mode);
 		ptcache_file_compressed_write(pf, (unsigned char *)dens, in_len, out, mode);
-		if (fluid_fields & SM_ACTIVE_HEAT) {
+		if (fluid_fields & FLUID_DOMAIN_ACTIVE_HEAT) {
 			ptcache_file_compressed_write(pf, (unsigned char *)heat, in_len, out, mode);
 			ptcache_file_compressed_write(pf, (unsigned char *)heatold, in_len, out, mode);
 		}
-		if (fluid_fields & SM_ACTIVE_FIRE) {
+		if (fluid_fields & FLUID_DOMAIN_ACTIVE_FIRE) {
 			ptcache_file_compressed_write(pf, (unsigned char *)flame, in_len, out, mode);
 			ptcache_file_compressed_write(pf, (unsigned char *)fuel, in_len, out, mode);
 			ptcache_file_compressed_write(pf, (unsigned char *)react, in_len, out, mode);
 		}
-		if (fluid_fields & SM_ACTIVE_COLORS) {
+		if (fluid_fields & FLUID_DOMAIN_ACTIVE_COLORS) {
 			ptcache_file_compressed_write(pf, (unsigned char *)r, in_len, out, mode);
 			ptcache_file_compressed_write(pf, (unsigned char *)g, in_len, out, mode);
 			ptcache_file_compressed_write(pf, (unsigned char *)b, in_len, out, mode);
@@ -666,12 +666,12 @@ static int  ptcache_smoke_write(PTCacheFile *pf, void *smoke_v)
 
 		out = (unsigned char *)MEM_callocN(LZO_OUT_LEN(in_len_big), "pointcache_lzo_buffer");
 		ptcache_file_compressed_write(pf, (unsigned char *)dens, in_len_big, out, mode);
-		if (fluid_fields & SM_ACTIVE_FIRE) {
+		if (fluid_fields & FLUID_DOMAIN_ACTIVE_FIRE) {
 			ptcache_file_compressed_write(pf, (unsigned char *)flame, in_len_big, out, mode);
 			ptcache_file_compressed_write(pf, (unsigned char *)fuel, in_len_big, out, mode);
 			ptcache_file_compressed_write(pf, (unsigned char *)react, in_len_big, out, mode);
 		}
-		if (fluid_fields & SM_ACTIVE_COLORS) {
+		if (fluid_fields & FLUID_DOMAIN_ACTIVE_COLORS) {
 			ptcache_file_compressed_write(pf, (unsigned char *)r, in_len_big, out, mode);
 			ptcache_file_compressed_write(pf, (unsigned char *)g, in_len_big, out, mode);
 			ptcache_file_compressed_write(pf, (unsigned char *)b, in_len_big, out, mode);
@@ -716,7 +716,7 @@ static int ptcache_smoke_read_old(PTCacheFile *pf, void *smoke_v)
 		ptcache_file_compressed_read(pf, (unsigned char*)dens, out_len);
 		ptcache_file_compressed_read(pf, (unsigned char*)tmp_array, out_len);
 
-		if (fluid_fields & SM_ACTIVE_HEAT)
+		if (fluid_fields & FLUID_DOMAIN_ACTIVE_HEAT)
 		{
 			ptcache_file_compressed_read(pf, (unsigned char*)heat, out_len);
 			ptcache_file_compressed_read(pf, (unsigned char*)heatold, out_len);
@@ -797,7 +797,7 @@ static int ptcache_smoke_read(PTCacheFile *pf, void *smoke_v)
 	    sds->res[1] != ch_res[1] ||
 	    sds->res[2] != ch_res[2])
 	{
-		if (sds->flags & MOD_SMOKE_ADAPTIVE_DOMAIN)
+		if (sds->flags & FLUID_DOMAIN_USE_ADAPTIVE_DOMAIN)
 			reallocate = 1;
 		else
 			return 0;
@@ -810,12 +810,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);
+		smoke_reallocate_fluid(sds, ch_res, 1);
 		sds->dx = ch_dx;
 		VECCOPY(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);
+		if (sds->flags & FLUID_DOMAIN_USE_NOISE) {
+			smoke_reallocate_highres_fluid(sds, ch_res);
 		}
 	}
 
@@ -829,16 +829,16 @@ static int ptcache_smoke_read(PTCacheFile *pf, void *smoke_v)
 
 		ptcache_file_compressed_read(pf, (unsigned char *)sds->shadow, out_len);
 		ptcache_file_compressed_read(pf, (unsigned char *)dens, out_len);
-		if (cache_fields & SM_ACTIVE_HEAT) {
+		if (cache_fields & FLUID_DOMAIN_ACTIVE_HEAT) {
 			ptcache_file_compressed_read(pf, (unsigned char *)heat, out_len);
 			ptcache_file_compressed_read(pf, (unsigned char *)heatold, out_len);
 		}
-		if (cache_fields & SM_ACTIVE_FIRE) {
+		if (cache_fields & FLUID_DOMAIN_ACTIVE_FIRE) {
 			ptcache_file_compressed_read(pf, (unsigned char *)flame, out_len);
 			ptcache_file_compressed_read(pf, (unsigned char *)fuel, out_len);
 			ptcache_file_compressed_read(pf, (unsigned char *)react, out_len);
 		}
-		if (cache_fields & SM_ACTIVE_COLORS) {
+		if (cache_fields & FLUID_DOMAIN_ACTIVE_COLORS) {
 			ptcache_file_compressed_read(pf, (unsigned char *)r, out_len);
 			ptcache_file_compressed_read(pf, (unsigned char *)g, out_len);
 			ptcache_file_compressed_read(pf, (unsigned char *)b, out_len);
@@ -875,12 +875,12 @@ static int ptcache_smoke_read(PTCacheFile *pf, void *smoke_v)
 			smoke_turbulence_export(sds->wt, &dens, &react, &flame, &fuel, &r, &g, &b, &tcu, &tcv, &tcw);
 
 			ptcache_file_compressed_read(pf, (unsigned char *)dens, out_len_big);
-			if (cache_fields & SM_ACTIVE_FIRE) {
+			if (cache_fields & FLUID_DOMAIN_ACTIVE_FIRE) {
 				ptcache_file_compressed_read(pf, (unsigned char *)flame, out_len_big);
 				ptcache_file_compressed_read(pf, (unsigned char *)fuel, out_len_big);
 				ptcache_file_compressed_read(pf, (unsigned char *)react, out_len_big);
 			}
-			if (cache_fields & SM_ACTIVE_COLORS) {
+			if (cache_fields & FLUID_DOMAIN_ACTIVE_COLORS) {
 				ptcache_file_compressed_read(pf, (unsigned char *)r, out_len_big);
 				ptcache_file_compressed_read(pf, (unsigned char *)g, out_len_big);
 				ptcache_file_compressed_read(pf, (unsigned char *)b, out_len_big);
@@ -913,7 +913,7 @@ static void compute_fluid_matrices(SmokeDomainSettings *sds)
 
 	copy_v3_v3(bbox_min, sds->p0);
 
-	if (sds->flags & MOD_SMOKE_ADAPTIVE_DOMAIN) {
+	if (sds->flags & FLUID_DOMAIN_USE_ADAPTIVE_DOMAIN) {
 		bbox_min[0] += (sds->cell_size[0] * (float)sds->res_min[0]);
 		bbox_min[1] += (sds->cell_size[1] * (float)sds->res_min[1]);
 		bbox_min[2] += (sds->cell_size[2] * (float)sds->res_min[2]);
@@ -981,13 +981,13 @@ static int ptcache_smoke_openvdb_write(struct OpenVDBWriter *writer, void *smoke
 		wt_density_grid = OpenVDB_export_gri

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list