Blender  V3.3
Variables
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
 
const std::string smoke_adaptive_step
 
const std::string smoke_step
 
const std::string smoke_step_noise
 
const std::string smoke_load_data
 
const std::string smoke_load_noise
 
const std::string smoke_save_data
 
const std::string smoke_save_noise
 
const std::string smoke_standalone
 

Variable Documentation

◆ smoke_adaptive_step

const std::string smoke_adaptive_step

Definition at line 256 of file smoke_script.h.

Referenced by MANTA::exportSmokeScript().

◆ 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 65 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 139 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 160 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 212 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 234 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 196 of file smoke_script.h.

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

◆ smoke_alloc_noise

const std::string smoke_alloc_noise

Definition at line 94 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 176 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 186 of file smoke_script.h.

Referenced by MANTA::initColorsHigh().

◆ smoke_load_data

const std::string smoke_load_data
Initial value:
=
"\n\
def smoke_load_data_$ID$(path, framenr, file_format, resumable):\n\
mantaMsg('Smoke load data')\n\
dict = { **fluid_data_dict_final_s$ID$, **fluid_data_dict_resume_s$ID$, **smoke_data_dict_final_s$ID$, **smoke_data_dict_resume_s$ID$ } if resumable else { **fluid_data_dict_final_s$ID$, **smoke_data_dict_final_s$ID$ }\n\
fluid_file_import_s$ID$(dict=dict, path=path, framenr=framenr, file_format=file_format, file_name=file_data_s$ID$)\n\
\n\
copyVec3ToReal(source=vel_s$ID$, targetX=x_vel_s$ID$, targetY=y_vel_s$ID$, targetZ=z_vel_s$ID$)\n"

Definition at line 530 of file smoke_script.h.

Referenced by MANTA::exportSmokeScript().

◆ smoke_load_noise

const std::string smoke_load_noise
Initial value:
=
"\n\
def smoke_load_noise_$ID$(path, framenr, file_format, resumable):\n\
mantaMsg('Smoke load noise')\n\
dict = { **smoke_noise_dict_final_s$ID$, **smoke_noise_dict_resume_s$ID$ } if resumable else { **smoke_noise_dict_final_s$ID$ } \n\
fluid_file_import_s$ID$(dict=dict, path=path, framenr=framenr, file_format=file_format, file_name=file_noise_s$ID$)\n\
\n\
if resumable:\n\
# Fill up xyz texture grids, important when resuming a bake\n\
copyVec3ToReal(source=uvGrid0_s$ID$, targetX=texture_u_s$ID$, targetY=texture_v_s$ID$, targetZ=texture_w_s$ID$)\n\
copyVec3ToReal(source=uvGrid1_s$ID$, targetX=texture_u2_s$ID$, targetY=texture_v2_s$ID$, targetZ=texture_w2_s$ID$)\n"

Definition at line 539 of file smoke_script.h.

Referenced by MANTA::exportSmokeScript().

◆ smoke_save_data

const std::string smoke_save_data
Initial value:
=
"\n\
def smoke_save_data_$ID$(path, framenr, file_format, resumable):\n\
mantaMsg('Smoke save data')\n\
start_time = time.time()\n\
dict = { **fluid_data_dict_final_s$ID$, **fluid_data_dict_resume_s$ID$, **smoke_data_dict_final_s$ID$, **smoke_data_dict_resume_s$ID$ } if resumable else { **fluid_data_dict_final_s$ID$, **smoke_data_dict_final_s$ID$ } \n\
if not withMPSave or isWindows:\n\
fluid_file_export_s$ID$(dict=dict, path=path, framenr=framenr, file_format=file_format, file_name=file_data_s$ID$, clipGrid=density_s$ID$)\n\
else:\n\
fluid_cache_multiprocessing_start_$ID$(function=fluid_file_export_s$ID$, file_name=file_data_s$ID$, framenr=framenr, format_data=file_format, path_data=path, dict=dict, do_join=False)\n\
mantaMsg('--- Save: %s seconds ---' % (time.time() - start_time))\n"

Definition at line 555 of file smoke_script.h.

◆ smoke_save_noise

const std::string smoke_save_noise
Initial value:
=
"\n\
def smoke_save_noise_$ID$(path, framenr, file_format, resumable):\n\
mantaMsg('Smoke save noise')\n\
dict = { **smoke_noise_dict_final_s$ID$, **smoke_noise_dict_resume_s$ID$ } if resumable else { **smoke_noise_dict_final_s$ID$ } \n\
if not withMPSave or isWindows:\n\
fluid_file_export_s$ID$(dict=dict, framenr=framenr, file_format=file_format, path=path, file_name=file_noise_s$ID$, clipGrid=density_sn$ID$)\n\
else:\n\
fluid_cache_multiprocessing_start_$ID$(function=fluid_file_export_s$ID$, file_name=file_noise_s$ID$, framenr=framenr, format_data=file_format, path_data=path, dict=dict, do_join=False)\n"

Definition at line 567 of file smoke_script.h.

◆ smoke_standalone

const std::string smoke_standalone
Initial value:
=
"\n\
# Helper function to call cache load functions\n\
def load_data(frame, cache_resumable):\n\
smoke_load_data_$ID$(os.path.join(cache_dir, 'data'), frame, file_format_data, cache_resumable)\n\
if using_noise_s$ID$:\n\
smoke_load_noise_$ID$(os.path.join(cache_dir, 'noise'), frame, file_format_data, cache_resumable)\n\
if using_guiding_s$ID$:\n\
fluid_load_guiding_$ID$(os.path.join(cache_dir, 'guiding'), frame, file_format_data)\n\
\n\
# Helper function to call step functions\n\
def step(frame):\n\
smoke_adaptive_step_$ID$(frame)\n\
if using_noise_s$ID$:\n\
smoke_step_noise_$ID$(frame)\n"

Definition at line 581 of file smoke_script.h.

Referenced by MANTA::exportSmokeScript().

◆ smoke_step

const std::string smoke_step

Definition at line 328 of file smoke_script.h.

Referenced by MANTA::exportSmokeScript().

◆ smoke_step_noise

const std::string smoke_step_noise

Definition at line 408 of file smoke_script.h.

Referenced by MANTA::exportSmokeScript().

◆ 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 14 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 35 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 43 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 53 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 57 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 49 of file smoke_script.h.

Referenced by MANTA::initHeat().