Blender V4.3
smoke_script.h File Reference
#include <string>

Go to the source code of this file.

Variables

const std::string smoke_variables
 
const std::string smoke_variables_noise
 
const std::string smoke_wavelet_noise
 
const std::string smoke_with_heat
 
const std::string smoke_with_colors
 
const std::string smoke_with_fire
 
const std::string smoke_alloc
 
const std::string smoke_alloc_noise
 
const std::string smoke_alloc_colors
 
const std::string smoke_alloc_colors_noise
 
const std::string smoke_init_colors
 
const std::string smoke_init_colors_noise
 
const std::string smoke_alloc_heat
 
const std::string smoke_alloc_fire
 
const std::string smoke_alloc_fire_noise
 

Variable Documentation

◆ smoke_alloc

const std::string smoke_alloc
Initial value:
=
"\n\
mantaMsg('Smoke alloc')\n\
shadow_s$ID$ = s$ID$.create(RealGrid, name='$NAME_SHADOW$', sparse=False)\n\
emission_s$ID$ = s$ID$.create(RealGrid, name='$NAME_EMISSION$', sparse=True)\n\
emissionIn_s$ID$ = s$ID$.create(RealGrid, name='$NAME_EMISSIONIN$')\n\
density_s$ID$ = s$ID$.create(RealGrid, name='$NAME_DENSITY$', sparse=True)\n\
densityIn_s$ID$ = s$ID$.create(RealGrid, name='$NAME_DENSITYIN$', sparse=True)\n\
heat_s$ID$ = None # allocated dynamically\n\
heatIn_s$ID$ = None\n\
flame_s$ID$ = None\n\
fuel_s$ID$ = None\n\
react_s$ID$ = None\n\
fuelIn_s$ID$ = None\n\
reactIn_s$ID$ = None\n\
color_r_s$ID$ = None\n\
color_g_s$ID$ = None\n\
color_b_s$ID$ = None\n\
color_r_in_s$ID$ = None\n\
color_g_in_s$ID$ = None\n\
color_b_in_s$ID$ = None\n\
\n\
# Set some initial values\n\
shadow_s$ID$.setConst(-1)\n\
\n\
# Keep track of important objects in dict to load them later on\n\
smoke_data_dict_final_s$ID$ = { 'density' : density_s$ID$, 'shadow' : shadow_s$ID$ }\n\
smoke_data_dict_resume_s$ID$ = { 'densityIn' : densityIn_s$ID$, 'emission' : emission_s$ID$ }\n"

Definition at line 66 of file smoke_script.h.

Referenced by MANTA::exportSmokeScript().

◆ smoke_alloc_colors

const std::string smoke_alloc_colors
Initial value:
=
"\n\
# Sanity check, clear grids first\n\
if 'color_r_s$ID$' in globals(): del color_r_s$ID$\n\
if 'color_g_s$ID$' in globals(): del color_g_s$ID$\n\
if 'color_b_s$ID$' in globals(): del color_b_s$ID$\n\
\n\
mantaMsg('Allocating colors')\n\
color_r_s$ID$ = s$ID$.create(RealGrid, name='$NAME_COLORR$', sparse=True)\n\
color_g_s$ID$ = s$ID$.create(RealGrid, name='$NAME_COLORG$', sparse=True)\n\
color_b_s$ID$ = s$ID$.create(RealGrid, name='$NAME_COLORB$', sparse=True)\n\
color_r_in_s$ID$ = s$ID$.create(RealGrid, name='$NAME_COLORRIN$', sparse=True)\n\
color_g_in_s$ID$ = s$ID$.create(RealGrid, name='$NAME_COLORGIN$', sparse=True)\n\
color_b_in_s$ID$ = s$ID$.create(RealGrid, name='$NAME_COLORBIN$', sparse=True)\n\
\n\
# Add objects to dict to load them later on\n\
if 'smoke_data_dict_final_s$ID$' in globals():\n\
smoke_data_dict_final_s$ID$.update(color_r=color_r_s$ID$, color_g=color_g_s$ID$, color_b=color_b_s$ID$)\n\
if 'smoke_data_dict_resume_s$ID$' in globals():\n\
smoke_data_dict_resume_s$ID$.update(color_r_in=color_r_in_s$ID$, color_g_in=color_g_in_s$ID$, color_b_in=color_b_in_s$ID$)\n"

Definition at line 140 of file smoke_script.h.

Referenced by MANTA::exportSmokeScript(), and MANTA::initColors().

◆ smoke_alloc_colors_noise

const std::string smoke_alloc_colors_noise
Initial value:
=
"\n\
# Sanity check, clear grids first\n\
if 'color_r_sn$ID$' in globals(): del color_r_sn$ID$\n\
if 'color_g_sn$ID$' in globals(): del color_g_sn$ID$\n\
if 'color_b_sn$ID$' in globals(): del color_b_sn$ID$\n\
\n\
mantaMsg('Allocating colors noise')\n\
color_r_sn$ID$ = sn$ID$.create(RealGrid, name='$NAME_COLORR_NOISE$', sparse=True)\n\
color_g_sn$ID$ = sn$ID$.create(RealGrid, name='$NAME_COLORG_NOISE$', sparse=True)\n\
color_b_sn$ID$ = sn$ID$.create(RealGrid, name='$NAME_COLORB_NOISE$', sparse=True)\n\
\n\
# Add objects to dict to load them later on\n\
if 'smoke_noise_dict_final_s$ID$' in globals():\n\
smoke_noise_dict_final_s$ID$.update(color_r_noise=color_r_sn$ID$, color_g_noise=color_g_sn$ID$, color_b_noise=color_b_sn$ID$)\n"

Definition at line 161 of file smoke_script.h.

Referenced by MANTA::exportSmokeScript(), and MANTA::initColorsHigh().

◆ smoke_alloc_fire

const std::string smoke_alloc_fire
Initial value:
=
"\n\
# Sanity check, clear grids first\n\
if 'flame_s$ID$' in globals(): del flame_s$ID$\n\
if 'fuel_s$ID$' in globals(): del fuel_s$ID$\n\
if 'react_s$ID$' in globals(): del react_s$ID$\n\
if 'fuelIn_s$ID$' in globals(): del fuelIn_s$ID$\n\
if 'reactIn_s$ID$' in globals(): del reactIn_s$ID$\n\
\n\
mantaMsg('Allocating fire')\n\
flame_s$ID$ = s$ID$.create(RealGrid, name='$NAME_FLAME$', sparse=True)\n\
fuel_s$ID$ = s$ID$.create(RealGrid, name='$NAME_FUEL$', sparse=True)\n\
react_s$ID$ = s$ID$.create(RealGrid, name='$NAME_REACT$', sparse=True)\n\
fuelIn_s$ID$ = s$ID$.create(RealGrid, name='$NAME_FUELIN$', sparse=True)\n\
reactIn_s$ID$ = s$ID$.create(RealGrid, name='$NAME_REACTIN$', sparse=True)\n\
\n\
# Add objects to dict to load them later on\n\
if 'smoke_data_dict_final_s$ID$' in globals():\n\
smoke_data_dict_final_s$ID$.update(flame=flame_s$ID$)\n\
if 'smoke_data_dict_resume_s$ID$' in globals():\n\
smoke_data_dict_resume_s$ID$.update(fuel=fuel_s$ID$, react=react_s$ID$, fuelIn=fuelIn_s$ID$, reactIn=reactIn_s$ID$)\n"

Definition at line 213 of file smoke_script.h.

Referenced by MANTA::exportSmokeScript(), and MANTA::initFire().

◆ smoke_alloc_fire_noise

const std::string smoke_alloc_fire_noise
Initial value:
=
"\n\
# Sanity check, clear grids first\n\
if 'flame_sn$ID$' in globals(): del flame_sn$ID$\n\
if 'fuel_sn$ID$' in globals(): del fuel_sn$ID$\n\
if 'react_sn$ID$' in globals(): del react_sn$ID$\n\
\n\
mantaMsg('Allocating fire noise')\n\
flame_sn$ID$ = sn$ID$.create(RealGrid, name='$NAME_FLAME_NOISE$', sparse=True)\n\
fuel_sn$ID$ = sn$ID$.create(RealGrid, name='$NAME_FUEL_NOISE$', sparse=True)\n\
react_sn$ID$ = sn$ID$.create(RealGrid, name='$NAME_REACT_NOISE$', sparse=True)\n\
\n\
# Add objects to dict to load them later on\n\
if 'smoke_noise_dict_final_s$ID$' in globals():\n\
smoke_noise_dict_final_s$ID$.update(flame_noise=flame_sn$ID$)\n\
if 'smoke_noise_dict_resume_s$ID$' in globals():\n\
smoke_noise_dict_resume_s$ID$.update(fuel_noise=fuel_sn$ID$, react_noise=react_sn$ID$)\n"

Definition at line 235 of file smoke_script.h.

Referenced by MANTA::exportSmokeScript(), and MANTA::initFireHigh().

◆ smoke_alloc_heat

const std::string smoke_alloc_heat
Initial value:
=
"\n\
# Sanity check, clear grids first\n\
if 'heat_s$ID$' in globals(): del heat_s$ID$\n\
if 'heatIn_s$ID$' in globals(): del heatIn_s$ID$\n\
\n\
mantaMsg('Allocating heat')\n\
heat_s$ID$ = s$ID$.create(RealGrid, name='$NAME_TEMPERATURE$', sparse=True)\n\
heatIn_s$ID$ = s$ID$.create(RealGrid, name='$NAME_TEMPERATUREIN$', sparse=True)\n\
\n\
# Add objects to dict to load them later on\n\
if 'smoke_data_dict_final_s$ID$' in globals():\n\
smoke_data_dict_final_s$ID$.update(heat=heat_s$ID$)\n\
if 'smoke_data_dict_resume_s$ID$' in globals():\n\
smoke_data_dict_resume_s$ID$.update(heatIn=heatIn_s$ID$)\n"

Definition at line 197 of file smoke_script.h.

Referenced by MANTA::exportSmokeScript(), and MANTA::initHeat().

◆ smoke_alloc_noise

const std::string smoke_alloc_noise

Definition at line 95 of file smoke_script.h.

Referenced by MANTA::exportSmokeScript().

◆ smoke_init_colors

const std::string smoke_init_colors
Initial value:
=
"\n\
mantaMsg('Initializing colors')\n\
color_r_s$ID$.copyFrom(density_s$ID$) \n\
color_r_s$ID$.multConst($COLOR_R$) \n\
color_g_s$ID$.copyFrom(density_s$ID$) \n\
color_g_s$ID$.multConst($COLOR_G$) \n\
color_b_s$ID$.copyFrom(density_s$ID$) \n\
color_b_s$ID$.multConst($COLOR_B$)\n"

Definition at line 177 of file smoke_script.h.

Referenced by MANTA::initColors().

◆ smoke_init_colors_noise

const std::string smoke_init_colors_noise
Initial value:
=
"\n\
mantaMsg('Initializing colors noise')\n\
color_r_sn$ID$.copyFrom(density_sn$ID$) \n\
color_r_sn$ID$.multConst($COLOR_R$) \n\
color_g_sn$ID$.copyFrom(density_sn$ID$) \n\
color_g_sn$ID$.multConst($COLOR_G$) \n\
color_b_sn$ID$.copyFrom(density_sn$ID$) \n\
color_b_sn$ID$.multConst($COLOR_B$)\n"

Definition at line 187 of file smoke_script.h.

Referenced by MANTA::initColorsHigh().

◆ smoke_variables

const std::string smoke_variables
Initial value:
=
"\n\
mantaMsg('Smoke variables low')\n\
preconditioner_s$ID$ = PcMGStatic\n\
using_colors_s$ID$ = $USING_COLORS$\n\
using_heat_s$ID$ = $USING_HEAT$\n\
using_fire_s$ID$ = $USING_FIRE$\n\
using_noise_s$ID$ = $USING_NOISE$\n\
vorticity_s$ID$ = $VORTICITY$\n\
buoyancy_dens_s$ID$ = float($BUOYANCY_ALPHA$) / float($FLUID_DOMAIN_SIZE$)\n\
buoyancy_heat_s$ID$ = float($BUOYANCY_BETA$) / float($FLUID_DOMAIN_SIZE$)\n\
dissolveSpeed_s$ID$ = $DISSOLVE_SPEED$\n\
using_logdissolve_s$ID$ = $USING_LOG_DISSOLVE$\n\
using_dissolve_s$ID$ = $USING_DISSOLVE$\n\
flameVorticity_s$ID$ = $FLAME_VORTICITY$\n\
burningRate_s$ID$ = $BURNING_RATE$\n\
flameSmoke_s$ID$ = $FLAME_SMOKE$\n\
ignitionTemp_s$ID$ = $IGNITION_TEMP$\n\
maxTemp_s$ID$ = $MAX_TEMP$\n\
flameSmokeColor_s$ID$ = vec3($FLAME_SMOKE_COLOR_X$,$FLAME_SMOKE_COLOR_Y$,$FLAME_SMOKE_COLOR_Z$)\n"

Definition at line 15 of file smoke_script.h.

Referenced by MANTA::exportSmokeScript(), and MANTA::updateVariables().

◆ smoke_variables_noise

const std::string smoke_variables_noise
Initial value:
=
"\n\
mantaMsg('Smoke variables noise')\n\
wltStrength_s$ID$ = $WLT_STR$\n\
uvs_s$ID$ = 2\n\
uvs_offset_s$ID$ = vec3($MIN_RESX$, $MIN_RESY$, $MIN_RESZ$)\n\
octaves_s$ID$ = int(math.log(upres_sn$ID$) / math.log(2.0) + 0.5) if (upres_sn$ID$ > 1) else 1\n"

Definition at line 36 of file smoke_script.h.

Referenced by MANTA::exportSmokeScript(), and MANTA::updateVariables().

◆ smoke_wavelet_noise

const std::string smoke_wavelet_noise
Initial value:
=
"\n\
# wavelet noise params\n\
wltnoise_sn$ID$.posScale = vec3(int($BASE_RESX$), int($BASE_RESY$), int($BASE_RESZ$)) * (1. / $NOISE_POSSCALE$)\n\
wltnoise_sn$ID$.timeAnim = $NOISE_TIMEANIM$\n"

Definition at line 44 of file smoke_script.h.

Referenced by MANTA::exportSmokeScript(), and MANTA::updateVariables().

◆ smoke_with_colors

const std::string smoke_with_colors
Initial value:
=
"\n\
using_colors_s$ID$ = True\n"

Definition at line 54 of file smoke_script.h.

Referenced by MANTA::initColors(), and MANTA::initColorsHigh().

◆ smoke_with_fire

const std::string smoke_with_fire
Initial value:
=
"\n\
using_fire_s$ID$ = True\n"

Definition at line 58 of file smoke_script.h.

Referenced by MANTA::initFire(), and MANTA::initFireHigh().

◆ smoke_with_heat

const std::string smoke_with_heat
Initial value:
=
"\n\
using_heat_s$ID$ = True\n"

Definition at line 50 of file smoke_script.h.

Referenced by MANTA::initHeat().