[Bf-blender-cvs] [8fd32cd] fluid-mantaflow: fixed temp directory for highres liquids (correct temp directory)

Sebastián Barschkis noreply at git.blender.org
Fri Oct 7 00:50:14 CEST 2016


Commit: 8fd32cdebf85535569b94abd9adce83caa7f67b9
Author: Sebastián Barschkis
Date:   Thu Oct 6 23:01:55 2016 +0200
Branches: fluid-mantaflow
https://developer.blender.org/rB8fd32cdebf85535569b94abd9adce83caa7f67b9

fixed temp directory for highres liquids (correct temp directory)

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

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 f0b63f7..143182d 100644
--- a/intern/mantaflow/intern/strings/liquid_script.h
+++ b/intern/mantaflow/intern/strings/liquid_script.h
@@ -250,7 +250,7 @@ def liquid_step():\n\
     \n\
     # TODO (sebbas): HACK - saving particle system for highres step\n\
     if using_highres:\n\
-        pp.save('/tmp/partfile.uni')\n\
+        pp.save(os.path.join(tempfile.gettempdir(), 'partfile.uni'))\n\
     \n\
     copyVec3ToReal(source=vel, targetX=x_vel, targetY=y_vel, targetZ=z_vel)\n\
     copyVec3ToReal(source=obvel, targetX=x_obvel, targetY=y_obvel, targetZ=z_obvel)\n";
@@ -259,7 +259,7 @@ const std::string liquid_step_high = "\n\
 def liquid_step_high():\n\
     mantaMsg('Liquid step high')\n\
     #xl_phi.setBound(value=0., boundaryWidth=1)\n\
-    xl_pp.load('/tmp/partfile.uni')\n\
+    xl_pp.load(os.path.join(tempfile.gettempdir(), 'partfile.uni'))\n\
     \n\
     # create surface\n\
     gridParticleIndex( parts=xl_pp , flags=xl_flags, indexSys=xl_pindex, index=xl_gpi )\n\
diff --git a/intern/mantaflow/intern/strings/shared_script.h b/intern/mantaflow/intern/strings/shared_script.h
index 36fba70..60979b4 100644
--- a/intern/mantaflow/intern/strings/shared_script.h
+++ b/intern/mantaflow/intern/strings/shared_script.h
@@ -35,7 +35,7 @@
 
 const std::string manta_import = "\
 from manta import *\n\
-import os, shutil, math, sys, gc\n";
+import os, shutil, math, sys, gc, tempfile\n";
 
 //////////////////////////////////////////////////////////////////////
 // SOLVERS




More information about the Bf-blender-cvs mailing list