[Bf-blender-cvs] [1667a761722] fluid-mantaflow: fix in python cleanup function

Sebastián Barschkis noreply at git.blender.org
Thu Aug 2 01:47:05 CEST 2018


Commit: 1667a7617229b5f024216681d5c2e7c4d811f0b4
Author: Sebastián Barschkis
Date:   Thu Aug 2 01:46:55 2018 +0200
Branches: fluid-mantaflow
https://developer.blender.org/rB1667a7617229b5f024216681d5c2e7c4d811f0b4

fix in python cleanup function

new motion blur vertvel vector was not being deleted. clearing all dicts before deletion now.

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

M	intern/mantaflow/intern/strings/liquid_script.h
M	intern/mantaflow/intern/strings/shared_script.h

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

diff --git a/intern/mantaflow/intern/strings/liquid_script.h b/intern/mantaflow/intern/strings/liquid_script.h
index af7db108dc5..1ee4b18837f 100644
--- a/intern/mantaflow/intern/strings/liquid_script.h
+++ b/intern/mantaflow/intern/strings/liquid_script.h
@@ -99,7 +99,9 @@ gpi_sm$ID$     = sm$ID$.create(IntGrid)\n\
 \n\
 # Keep track of important objects in dict to load them later on\n\
 liquid_mesh_dict_s$ID$ = dict(lMesh=mesh_sm$ID$)\n\
-liquid_meshvel_dict_s$ID$ = dict(lVelMesh=mVel_mesh$ID$)\n";
+\n\
+if using_speedvectors_s$ID$:\n\
+    liquid_meshvel_dict_s$ID$ = dict(lVelMesh=mVel_mesh$ID$)\n";
 
 const std::string liquid_init_phi = "\n\
 phi_s$ID$.initFromFlags(flags_s$ID$)\n\
diff --git a/intern/mantaflow/intern/strings/shared_script.h b/intern/mantaflow/intern/strings/shared_script.h
index f6dd46167ee..f5f2e7de9aa 100644
--- a/intern/mantaflow/intern/strings/shared_script.h
+++ b/intern/mantaflow/intern/strings/shared_script.h
@@ -346,11 +346,23 @@ def fluid_post_step_$ID$():\n\
 
 const std::string fluid_delete_all = "\n\
 mantaMsg('Deleting fluid')\n\
-# Delete childs from objects first (e.g. pdata for particles)\n\
+# Clear all helper dictionaries first\n\
+mantaMsg('Clear helper dictionaries')\n\
+if 'liquid_data_dict_s$ID$' in globals(): liquid_data_dict_s$ID$.clear()\n\
+if 'liquid_flip_dict_s$ID$' in globals(): liquid_flip_dict_s$ID$.clear()\n\
+if 'liquid_mesh_dict_s$ID$' in globals(): liquid_mesh_dict_s$ID$.clear()\n\
+if 'liquid_meshvel_dict_s$ID$' in globals(): liquid_meshvel_dict_s$ID$.clear()\n\
+if 'smoke_data_dict_s$ID$' in globals(): smoke_data_dict_s$ID$.clear()\n\
+if 'smoke_noise_dict_s$ID$' in globals(): smoke_noise_dict_s$ID$.clear()\n\
+\n\
+# Delete all childs from objects (e.g. pdata for particles)\n\
+mantaMsg('Release solver childs childs')\n\
 for var in list(globals()):\n\
     if var.endswith('_pp$ID$') or var.endswith('_mesh$ID$'):\n\
         del globals()[var]\n\
+\n\
 # Now delete childs from solver objects\n\
+mantaMsg('Release solver childs')\n\
 for var in list(globals()):\n\
     if var.endswith('_s$ID$') or var.endswith('_sn$ID$') or var.endswith('_sm$ID$') or var.endswith('_sp$ID$') or var.endswith('_sg$ID$'):\n\
         del globals()[var]\n\



More information about the Bf-blender-cvs mailing list