[Bf-blender-cvs] [37f0c4f] fluid-mantaflow: cleaned up a bit in scripts and now using new readParticle() function instead of temp file hack
Sebastián Barschkis
noreply at git.blender.org
Mon Nov 7 00:57:31 CET 2016
Commit: 37f0c4f57221aa5ad106459066c998ff08e5d54f
Author: Sebastián Barschkis
Date: Fri Nov 4 19:38:45 2016 +0200
Branches: fluid-mantaflow
https://developer.blender.org/rB37f0c4f57221aa5ad106459066c998ff08e5d54f
cleaned up a bit in scripts and now using new readParticle() function instead of temp file hack
===================================================================
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 a7f0cea..475d2fc 100644
--- a/intern/mantaflow/intern/strings/liquid_script.h
+++ b/intern/mantaflow/intern/strings/liquid_script.h
@@ -221,23 +221,19 @@ def liquid_step():\n\
phiParts.copyFrom(phi)\n\
phiParts.setBound(0.5,0)\n\
phiParts.createMesh(mesh)\n\
- \n\
+ \n\
# set source grids for resampling, used in adjustNumber!\n\
pVel.setSource(vel, isMAC=True)\n\
adjustNumber(parts=pp, vel=vel, flags=flags, minParticles=1*minParticles, maxParticles=2*minParticles, phi=phi, exclude=phiObs, radiusFactor=radiusFactor, narrowBand=narrowBandWidth)\n\
flipVelocityUpdate(vel=vel, velOld=velOld, flags=flags, parts=pp, partVel=pVel, flipRatio=0.95)\n\
\n\
- # TODO (sebbas): HACK - saving particle system for highres step\n\
- if using_highres:\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";
const std::string liquid_step_high = "\n\
def liquid_step_high():\n\
mantaMsg('Liquid step high')\n\
- xl_pp.load(os.path.join(tempfile.gettempdir(), 'partfile.uni'))\n\
+ xl_pp.readParticles(pp)\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 208b4ba..fbcec43 100644
--- a/intern/mantaflow/intern/strings/shared_script.h
+++ b/intern/mantaflow/intern/strings/shared_script.h
@@ -35,8 +35,7 @@
const std::string manta_import = "\
from manta import *\n\
-from pathlib import Path\n\
-import os, shutil, math, sys, gc, tempfile\n";
+import os, shutil, math, sys, gc\n";
//////////////////////////////////////////////////////////////////////
// SOLVERS
More information about the Bf-blender-cvs
mailing list