[Bf-blender-cvs] [4aa6d74ae4e] fluid-mantaflow: minor cleanup and fix memory leak (resulted from active fields commit)
Sebastián Barschkis
noreply at git.blender.org
Fri Aug 3 00:07:37 CEST 2018
Commit: 4aa6d74ae4ef8f801a5cd1c3f030dd0f6d194456
Author: Sebastián Barschkis
Date: Fri Aug 3 00:07:28 2018 +0200
Branches: fluid-mantaflow
https://developer.blender.org/rB4aa6d74ae4ef8f801a5cd1c3f030dd0f6d194456
minor cleanup and fix memory leak (resulted from active fields commit)
===================================================================
M intern/mantaflow/intern/FLUID.cpp
M release/scripts/startup/bl_operators/object_quick_effects.py
M release/scripts/startup/bl_ui/properties_physics_smoke.py
M source/blender/blenkernel/intern/pointcache.c
M source/blender/blenkernel/intern/smoke.c
M source/blender/makesdna/DNA_smoke_types.h
M source/blender/makesrna/intern/rna_smoke.c
===================================================================
diff --git a/intern/mantaflow/intern/FLUID.cpp b/intern/mantaflow/intern/FLUID.cpp
index f10224f134d..88fd75abea3 100644
--- a/intern/mantaflow/intern/FLUID.cpp
+++ b/intern/mantaflow/intern/FLUID.cpp
@@ -1012,8 +1012,8 @@ int FLUID::updateMeshStructures(SmokeModifierData *smd, int framenr)
cacheDir[0] = '\0';
targetFile[0] = '\0';
- std::string mformat = getCacheFileEnding(smd->domain->cache_surface_format);
- std::string dformat = getCacheFileEnding(smd->domain->cache_volume_format);
+ std::string mformat = getCacheFileEnding(smd->domain->cache_mesh_format);
+ std::string dformat = getCacheFileEnding(smd->domain->cache_data_format);
BLI_path_join(cacheDir, sizeof(cacheDir), smd->domain->cache_directory, FLUID_CACHE_DIR_MESH, NULL);
ss << "lMesh_####" << mformat;
@@ -1104,7 +1104,7 @@ int FLUID::writeData(SmokeModifierData *smd, int framenr)
char cacheDirData[FILE_MAX];
cacheDirData[0] = '\0';
- std::string dformat = getCacheFileEnding(smd->domain->cache_volume_format);
+ std::string dformat = getCacheFileEnding(smd->domain->cache_data_format);
std::string pformat = getCacheFileEnding(smd->domain->cache_particle_format);
BLI_path_join(cacheDirData, sizeof(cacheDirData), smd->domain->cache_directory, FLUID_CACHE_DIR_DATA, NULL);
@@ -1143,7 +1143,7 @@ int FLUID::readData(SmokeModifierData *smd, int framenr)
char cacheDirData[FILE_MAX];
cacheDirData[0] = '\0';
- std::string dformat = getCacheFileEnding(smd->domain->cache_volume_format);
+ std::string dformat = getCacheFileEnding(smd->domain->cache_data_format);
std::string pformat = getCacheFileEnding(smd->domain->cache_particle_format);
BLI_path_join(cacheDirData, sizeof(cacheDirData), smd->domain->cache_directory, FLUID_CACHE_DIR_DATA, NULL);
@@ -1249,7 +1249,7 @@ int FLUID::readGuiding(SmokeModifierData *smd, int framenr, bool sourceDomain)
char cacheDirGuiding[FILE_MAX];
cacheDirGuiding[0] = '\0';
- std::string gformat = getCacheFileEnding(smd->domain->cache_volume_format);
+ std::string gformat = getCacheFileEnding(smd->domain->cache_data_format);
const char *subdir = (sourceDomain) ? FLUID_CACHE_DIR_DATA : FLUID_CACHE_DIR_GUIDING;
BLI_path_join(cacheDirGuiding, sizeof(cacheDirGuiding), smd->domain->cache_directory, subdir, NULL);
@@ -1281,7 +1281,7 @@ int FLUID::bakeData(SmokeModifierData *smd, int framenr)
cacheDirData[0] = '\0';
cacheDirGuiding[0] = '\0';
- std::string dformat = getCacheFileEnding(smd->domain->cache_volume_format);
+ std::string dformat = getCacheFileEnding(smd->domain->cache_data_format);
std::string pformat = getCacheFileEnding(smd->domain->cache_particle_format);
std::string gformat = dformat; // Use same data format for guiding format
@@ -1309,7 +1309,7 @@ int FLUID::bakeNoise(SmokeModifierData *smd, int framenr)
cacheDirData[0] = '\0';
cacheDirNoise[0] = '\0';
- std::string dformat = getCacheFileEnding(smd->domain->cache_volume_format);
+ std::string dformat = getCacheFileEnding(smd->domain->cache_data_format);
std::string nformat = getCacheFileEnding(smd->domain->cache_noise_format);
BLI_path_join(cacheDirData, sizeof(cacheDirData), smd->domain->cache_directory, FLUID_CACHE_DIR_DATA, NULL);
@@ -1336,8 +1336,8 @@ int FLUID::bakeMesh(SmokeModifierData *smd, int framenr)
cacheDirData[0] = '\0';
cacheDirMesh[0] = '\0';
- std::string dformat = getCacheFileEnding(smd->domain->cache_volume_format);
- std::string mformat = getCacheFileEnding(smd->domain->cache_surface_format);
+ std::string dformat = getCacheFileEnding(smd->domain->cache_data_format);
+ std::string mformat = getCacheFileEnding(smd->domain->cache_mesh_format);
std::string pformat = getCacheFileEnding(smd->domain->cache_particle_format);
BLI_path_join(cacheDirData, sizeof(cacheDirData), smd->domain->cache_directory, FLUID_CACHE_DIR_DATA, NULL);
@@ -1364,7 +1364,7 @@ int FLUID::bakeParticles(SmokeModifierData *smd, int framenr)
cacheDirData[0] = '\0';
cacheDirParticles[0] = '\0';
- std::string dformat = getCacheFileEnding(smd->domain->cache_volume_format);
+ std::string dformat = getCacheFileEnding(smd->domain->cache_data_format);
std::string pformat = getCacheFileEnding(smd->domain->cache_particle_format);
BLI_path_join(cacheDirData, sizeof(cacheDirData), smd->domain->cache_directory, FLUID_CACHE_DIR_DATA, NULL);
@@ -1390,7 +1390,7 @@ int FLUID::bakeGuiding(SmokeModifierData *smd, int framenr)
char cacheDirGuiding[FILE_MAX];
cacheDirGuiding[0] = '\0';
- std::string gformat = getCacheFileEnding(smd->domain->cache_volume_format);
+ std::string gformat = getCacheFileEnding(smd->domain->cache_data_format);
BLI_path_join(cacheDirGuiding, sizeof(cacheDirGuiding), smd->domain->cache_directory, FLUID_CACHE_DIR_GUIDING, NULL);
BLI_path_make_safe(cacheDirGuiding);
diff --git a/release/scripts/startup/bl_operators/object_quick_effects.py b/release/scripts/startup/bl_operators/object_quick_effects.py
index a7383988ed3..ee54ff20ef0 100644
--- a/release/scripts/startup/bl_operators/object_quick_effects.py
+++ b/release/scripts/startup/bl_operators/object_quick_effects.py
@@ -368,7 +368,7 @@ class QuickSmoke(Operator):
# set correct cache file format for smoke
obj.modifiers[-1].domain_settings.use_surface_cache = False
obj.modifiers[-1].domain_settings.use_volume_cache = True
- obj.modifiers[-1].domain_settings.cache_volume_format = 'UNI'
+ obj.modifiers[-1].domain_settings.cache_data_format = 'UNI'
# Setup material
@@ -634,7 +634,7 @@ class QuickLiquid(Operator):
# set correct cache file format for liquid
obj.modifiers[-1].domain_settings.use_surface_cache = True
obj.modifiers[-1].domain_settings.use_volume_cache = False
- obj.modifiers[-1].domain_settings.cache_surface_format = 'BOBJECT'
+ obj.modifiers[-1].domain_settings.cache_mesh_format = 'BOBJECT'
# allocate and show particle system for FLIP
obj.modifiers[-1].domain_settings.use_flip_particles = True
diff --git a/release/scripts/startup/bl_ui/properties_physics_smoke.py b/release/scripts/startup/bl_ui/properties_physics_smoke.py
index 071cdd0b70a..ddd62c190c6 100644
--- a/release/scripts/startup/bl_ui/properties_physics_smoke.py
+++ b/release/scripts/startup/bl_ui/properties_physics_smoke.py
@@ -348,6 +348,7 @@ class PHYSICS_PT_smoke_adaptive_domain(PhysicButtonsPanel, Panel):
class PHYSICS_PT_smoke_quality(PhysicButtonsPanel, Panel):
bl_label = "Fluid Quality"
+ bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER'}
@classmethod
@@ -374,6 +375,7 @@ class PHYSICS_PT_smoke_quality(PhysicButtonsPanel, Panel):
class PHYSICS_PT_smoke_noise(PhysicButtonsPanel, Panel):
bl_label = "Fluid Noise"
+ bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER'}
@classmethod
@@ -431,6 +433,7 @@ class PHYSICS_PT_smoke_noise(PhysicButtonsPanel, Panel):
class PHYSICS_PT_smoke_mesh(PhysicButtonsPanel, Panel):
bl_label = "Fluid Mesh"
+ bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER'}
@classmethod
@@ -504,6 +507,7 @@ class PHYSICS_PT_smoke_mesh(PhysicButtonsPanel, Panel):
class PHYSICS_PT_smoke_particles(PhysicButtonsPanel, Panel):
bl_label = "Fluid Particles"
+ bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER'}
@classmethod
@@ -579,6 +583,7 @@ class PHYSICS_PT_smoke_particles(PhysicButtonsPanel, Panel):
class PHYSICS_PT_smoke_diffusion(PhysicButtonsPanel, Panel):
bl_label = "Fluid Diffusion"
+ bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER'}
@classmethod
@@ -719,8 +724,8 @@ class PHYSICS_PT_smoke_cache(PhysicButtonsPanel, Panel):
layout = self.layout
domain = context.smoke.domain_settings
- cache_surface_format = domain.cache_surface_format
- cache_volume_format = domain.cache_volume_format
+ cache_mesh_format = domain.cache_mesh_format
+ cache_data_format = domain.cache_data_format
split = layout.split()
@@ -728,20 +733,20 @@ class PHYSICS_PT_smoke_cache(PhysicButtonsPanel, Panel):
col.prop(domain, "use_surface_cache", text="Surface format:")
sub = col.column()
sub.active = domain.use_surface_cache
- sub.prop(domain, "cache_surface_format", text="")
+ sub.prop(domain, "cache_mesh_format", text="")
col = split.column()
col.prop(domain, "use_volume_cache", text="Volumetric format:")
sub = col.column()
sub.active = domain.use_volume_cache
- sub.prop(domain, "cache_volume_format", text="")
+ sub.prop(domain, "cache_data_format", text="")
split = layout.split()
- if cache_volume_format == 'POINTCACHE':
+ if cache_data_format == 'POINTCACHE':
layout.label(text="Compression:")
layout.row().prop(domain, "point_cache_compress_type", expand=True)
- elif cache_volume_format == 'OPENVDB':
+ elif cache_data_format == 'OPENVDB':
if not bpy.app.build_options.openvdb:
layout.label("Built without OpenVDB support")
return
@@ -757,7 +762,6 @@ class PHYSICS_PT_smoke_cache(PhysicButtonsPanel, Panel):
class PHYSICS_PT_manta_cache(PhysicButtonsPanel, Panel):
bl_label = "Fluid Cache"
- bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER'}
@classmethod
@@ -782,7 +786,7 @@ class PHYSICS_PT_manta_cache(PhysicButtonsPanel, Panel):
row = layout.row(align=True)
row.label(text="Data file format:")
- row.prop(domain, "cache_volume_format", text="")
+ row.prop(domain, "cache_data_format", text="")
if md.domain_settings.smoke_domain_type in {'GAS'}:
if domain.use_noise:
@@ -799,7 +803,7 @@ class PHYSICS_PT_manta_cache(PhysicButtonsPanel, Panel):
if domain.use_mesh:
row = layout.row(align=True)
row.label(text="Mesh file format:")
- row.prop(domain, "cache_surface_format", text="")
+ row.prop(domain, "cache_mesh_format", text="")
row = layout.row()
row.operator("manta
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list