Commit: d74149c6fd6f5ad6cf23b1cc95c42bd63048d610
Author: Sebastián Barschkis
Date:   Fri May 6 14:55:29 2016 +0200
Branches: fluid-mantaflow
https://developer.blender.org/rBd74149c6fd6f5ad6cf23b1cc95c42bd63048d610

formatting (indentation) smoke script to match liquid and mantaflow scripts in 
general

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

D       intern/mantaflow/intern/strings/smoke.h
A       intern/mantaflow/intern/strings/smoke_script.h

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

diff --git a/intern/mantaflow/intern/strings/smoke.h 
b/intern/mantaflow/intern/strings/smoke.h
deleted file mode 100644
index dc3cb73..0000000
--- a/intern/mantaflow/intern/strings/smoke.h
+++ /dev/null
@@ -1,613 +0,0 @@
-/*
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version. 
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * The Original Code is Copyright (C) 2016 Blender Foundation.
- * All rights reserved.
- *
- * Contributor(s): Sebastian Barschkis (sebbas)
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/** \file mantaflow/intern/strings/smoke.h
- *  \ingroup mantaflow
- */
-
-#include <string>
-
-//////////////////////////////////////////////////////////////////////
-// GENERAL SETUP
-//////////////////////////////////////////////////////////////////////
-
-const std::string manta_import = "\
-from manta import *\n\
-import os, shutil, math, sys, gc\n";
-
-const std::string flags = "\n\
-using_colors = $USING_COLORS$\n\
-using_heat = $USING_HEAT$\n\
-using_fire = $USING_FIRE$\n\
-using_wavelets = $USE_WAVELETS$\n";
-
-const std::string uv_setup = "\n\
-# create the array of uv grids\n\
-uv = []\n\
-mantaMsg('Initializing UV Grids')\n\
-for i in range(uvs):\n\
-  uvGrid = s.create(VecGrid)\n\
-  uv.append(uvGrid)\n\
-  resetUvGrid(uv[i])\n\
-# Need to initialize helper grids for uvw as well\n\
-copyVec3ToReal(source=uv[0], targetX=texture_u, targetY=texture_v, 
targetZ=texture_w)\n\
-copyVec3ToReal(source=uv[1], targetX=texture_u2, targetY=texture_v2, 
targetZ=texture_w2)\n";
-
-//////////////////////////////////////////////////////////////////////
-// LOW RESOLUTION SETUP
-//////////////////////////////////////////////////////////////////////
-
-const std::string solver_setup_low = "\n\
-# solver low params\n\
-dim = $SOLVER_DIM$\n\
-doOpen = $DO_OPEN$\n\
-boundConditions = '$BOUNDCONDITIONS$'\n\
-res = $RES$\n\
-gs = vec3($RESX$,$RESY$,$RESZ$)\n\
-if dim == 2:\n\
-  gs.z = 1\n\
-s = Solver(name='main', gridSize=gs, dim=dim)\n\
-dt_default = 0.1\n\
-dt_factor = $DT_FACTOR$\n\
-fps = $FPS$\n\
-dt0 = dt_default * (25.0 / fps) * dt_factor\n\
-s.frameLength = dt0\n\
-s.timestepMin = dt0 / 10\n\
-s.timestepMax = dt0\n\
-s.cfl = 4.0\n\
-s.timestep = dt0\n\
-vorticity = $VORTICITY$\n\
-boundaryWidth = 1\n";
-
-const std::string alloc_base_grids_low = "\n\
-# prepare grids low\n\
-flags = s.create(FlagGrid)\n\
-vel = s.create(MACGrid)\n\
-x_vel = s.create(RealGrid)\n\
-y_vel = s.create(RealGrid)\n\
-z_vel = s.create(RealGrid)\n\
-obvel = s.create(MACGrid)\n\
-x_obvel = s.create(RealGrid)\n\
-y_obvel = s.create(RealGrid)\n\
-z_obvel = s.create(RealGrid)\n\
-density = s.create(LevelsetGrid)\n\
-pressure = s.create(RealGrid)\n\
-forces = s.create(MACGrid)\n\
-x_force = s.create(RealGrid)\n\
-y_force = s.create(RealGrid)\n\
-z_force = s.create(RealGrid)\n\
-inflow_grid = s.create(LevelsetGrid)\n\
-fuel_inflow = s.create(LevelsetGrid)\n";
-
-const std::string prep_domain_low = "\n\
-# prepare domain low\n\
-flags.initDomain(boundaryWidth=boundaryWidth)\n\
-flags.fillGrid()\n\
-if doOpen:\n\
-  setOpenBound(flags=flags, bWidth=boundaryWidth, openBound=boundConditions, 
type=FlagOutflow|FlagEmpty)\n";
-
-//////////////////////////////////////////////////////////////////////
-// HIGH RESOLUTION SETUP
-//////////////////////////////////////////////////////////////////////
-
-const std::string solver_setup_high = "\n\
-# solver high params\n\
-upres = $UPRES$\n\
-xl_gs = vec3($HRESX$, $HRESY$, $HRESZ$)\n\
-if dim == 2:\n\
-  xl_gs.z = 1\n\
-xl = Solver(name = 'larger', gridSize = xl_gs)\n\
-xl.frameLength = s.frameLength\n\
-xl.timestepMin = s.timestepMin / 10\n\
-xl.timestepMax = s.timestepMax\n\
-xl.cfl = s.cfl\n\
-wltStrength = $WLT_STR$\n\
-octaves = 0\n\
-uvs = 2\n\
-if upres == 1:\n\
-  octaves = int(math.log(upres+1)/ math.log(2.0) + 0.5)\n\
-elif upres > 1:\n\
-  octaves = int(math.log(upres)/ math.log(2.0) + 0.5)\n";
-
-const std::string alloc_base_grids_high = "\n\
-# prepare grids high\n\
-xl_flags = xl.create(FlagGrid)\n\
-xl_vel = xl.create(MACGrid)\n\
-xl_density = xl.create(RealGrid)\n\
-energy = s.create(RealGrid)\n\
-tempFlag = s.create(FlagGrid)\n\
-texture_u = s.create(RealGrid)\n\
-texture_v = s.create(RealGrid)\n\
-texture_w = s.create(RealGrid)\n\
-texture_u2 = s.create(RealGrid)\n\
-texture_v2 = s.create(RealGrid)\n\
-texture_w2 = s.create(RealGrid)\n";
-
-const std::string prep_domain_high = "\n\
-# prepare domain high\n\
-xl_flags.initDomain(boundaryWidth=boundaryWidth)\n\
-xl_flags.fillGrid()\n\
-if doOpen:\n\
-  setOpenBound(flags=xl_flags, bWidth=boundaryWidth, 
openBound=boundConditions, type=FlagOutflow|FlagEmpty)\n";
-
-const std::string wavelet_turbulence_noise = "\n\
-# wavelet turbulence noise field\n\
-xl_wltnoise = NoiseField(parent=xl, loadFromFile=True)\n\
-xl_wltnoise.posScale = vec3(int(1.0*gs.x)) / $NOISE_POSSCALE$\n\
-xl_wltnoise.timeAnim = $NOISE_TIMEANIM$\n";
-
-//////////////////////////////////////////////////////////////////////
-// ADDITIONAL GRIDS
-//////////////////////////////////////////////////////////////////////
-
-const std::string set_color_codes = "\n\
-mantaMsg('Setting color codes')\n\
-manta_color_r = $COLOR_R$\n\
-manta_color_g = $COLOR_G$\n\
-manta_color_b = $COLOR_B$\n";
-
-const std::string alloc_colors_low = "\n\
-mantaMsg('Allocating colors low')\n\
-color_r = s.create(RealGrid)\n\
-color_g = s.create(RealGrid)\n\
-color_b = s.create(RealGrid)\n";
-
-const std::string alloc_colors_high = "\
-mantaMsg('Allocating colors high')\n\
-xl_color_r = xl.create(RealGrid)\n\
-xl_color_g = xl.create(RealGrid)\n\
-xl_color_b = xl.create(RealGrid)\n";
-
-const std::string init_colors_low = "\n\
-mantaMsg('Initializing colors low')\n\
-color_r.copyFrom(density) \n\
-color_r.multConst(manta_color_r) \n\
-color_g.copyFrom(density) \n\
-color_g.multConst(manta_color_g) \n\
-color_b.copyFrom(density) \n\
-color_b.multConst(manta_color_b)\n";
-
-const std::string init_colors_high = "\n\
-mantaMsg('Initializing colors high')\n\
-xl_color_r.copyFrom(xl_density) \n\
-xl_color_r.multConst(manta_color_r) \n\
-xl_color_g.copyFrom(xl_density) \n\
-xl_color_g.multConst(manta_color_g) \n\
-xl_color_b.copyFrom(xl_density) \n\
-xl_color_b.multConst(manta_color_b)\n";
-
-const std::string alloc_heat_low = "\n\
-mantaMsg('Allocating heat low')\n\
-heat = s.create(RealGrid)\n";
-
-const std::string alloc_fire_low = "\n\
-mantaMsg('Allocating fire low')\n\
-flame = s.create(RealGrid)\n\
-fuel = s.create(RealGrid)\n\
-react = s.create(RealGrid)\n";
-
-const std::string alloc_fire_high = "\n\
-mantaMsg('Allocating fire high')\n\
-xl_flame = xl.create(RealGrid)\n\
-xl_fuel = xl.create(RealGrid)\n\
-xl_react = xl.create(RealGrid)\n";
-
-const std::string with_heat = "\n\
-using_heat = True\n";
-
-const std::string with_colors = "\n\
-using_colors = True\n";
-
-const std::string with_fire = "\n\
-using_fire = True\n";
-
-const std::string gc_collect = "\n\
-gc.collect()\n";
-
-//////////////////////////////////////////////////////////////////////
-// STANDALONE MODE
-//////////////////////////////////////////////////////////////////////
-
-const std::string standalone = "\n\
-if (GUI):\n\
-  gui=Gui()\n\
-  gui.show()\n\
-  gui.pause()\n\
-\n\
-# import *.uni files\n\
-import_grids_low()\n\
-if using_wavelets:\n\
-  import_grids_high()\n\
-\n\
-start_frame = $CURRENT_FRAME$\n\
-# All low and high res steps\n\
-manta_step(start_frame)\n";
-
-//////////////////////////////////////////////////////////////////////
-// DESTRUCTION
-//////////////////////////////////////////////////////////////////////
-
-const std::string del_colors_low = "\n\
-mantaMsg('Deleting colors low')\n\
-if 'color_r' in globals() : del color_r\n\
-if 'color_g' in globals() : del color_g\n\
-if 'color_b' in globals() : del color_b\n";
-
-const std::string del_colors_high = "\n\
-mantaMsg('Deleting colors high')\n\
-if 'xl_color_r' in globals() : del xl_color_r\n\
-if 'xl_color_g' in globals() : del xl_color_g\n\
-if 'xl_color_b' in globals() : del xl_color_b\n";
-
-const std::string del_fire_low = "\n\
-mantaMsg('Deleting fire low')\n\
-if 'flame' in globals() : del flame\n\
-if 'fuel' in globals() : del fuel\n\
-if 'react' in globals() : del react\n";
-
-const std::string del_fire_high = "\n\
-mantaMsg('Deleting fire high')\n\
-if 'xl_flame' in globals() : del xl_flame\n\
-if 'xl_fuel' in globals() : del xl_fuel\n\
-if 'xl_react' in globals() : del xl_react\n";
-
-const std::string del_heat_low = "\n\
-mantaMsg('Deleting heat low')\n\
-if 'heat' in globals() : del heat\n";
-
-const std::string del_base_grids_low = "\n\
-mantaMsg('Deleting base grids low')\n\
-if 'flags' in globals() : del flags\n\
-if 'vel' in globals() : del vel\n\
-if 'x_vel' in globals() : del x_vel\n\
-if 'y_vel' in globals() : del y_vel\n\
-if 'z_vel' in globals() : del z_vel\n\
-if 'obvel' in globals() : del obvel\n\
-if 'x_obvel' in globals() : del x_obvel\n\
-if 'y_obvel' in globals() : del y_obvel\n\
-if 'z_obvel' in globals() : del z_obvel\n\
-if 'density' in globals() : del density\n\
-if 'pressure' in globals() : del pressure\n\
-if 'forces' in globals() : del forces\n\
-if 'x_force' in globals() : del x_force\n\
-if 'y_force' in globals() : del y_force\n\
-if 'z_force' in globals() : del z_force\n\
-if 'inflow_grid' in globals() : del inflow_grid\n\
-if 'fuel_inflow' in globals() : del fuel_inflow\n";
-
-const std::string del_base_grids_high = "\n\
-mantaMsg('Deleting base grids high')\n\
-if 'xl_flags' in globals() : del xl_flags\n\
-if 'xl_vel' in globals() : del xl_vel\n\
-if 'xl_density' in globals() : del xl

@@ Diff output truncated at 10240 characters. @@

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to