Page History
...
Section | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
The following example will print the name of the simulator (node) , the current time (t) and the current time step (dt). The if() statement is used to stop the simulation if the current frame is 2. You can save the script below to a test.py file for Python or test.mel file for MEL and load it from Phoenix Simulator → Simulation → Scripting → Script File.
|
Function Declaration
...
Example MEL function declaration:
...
MEL Functions | ||||||||||||||||
phxfdSystem [-q] [-node(-n) string] [ system string] Specify which coordinate system to be used when calling phxfdGet, phxfdInject and phxfdParticle.
Return value: none | ||||||||||||||||
phxfdInject [-node(-n) string] -position(-pos) float float float -discharge(-d) float [-temperature(-t) float] [-smoke(-sm) float] [-fuel(-fl) float] [-velocity(-vel) float float float] [-uvw float float float] Inject fluid in a given point. Using this function you can create your own procedural sources. The result of the function CAN NOT be achieved by calling one or more phxfdSet functions, because they do not affect the quantity of the fluid, but only the parameters carried by the fluid. The injection of fluid in some point causes changes in the content only of the nearest 8 cells, but produces an outgoing flow in the entire grid. Nevertheless the function is not slower than the ordinary phfxSet function, because the outgoing flow appears later, when the simulation is executed. If phxfdGet function is executed immediately after phxfdInject in some near point, the velocity will be not changed.
Return value: true if the operation was completed successfully, and false otherwise. | ||||||||||||||||
phxfdSet [-node(-n) string] -position(-pos) int int int [-temperature(-t) float] [-smoke(-sm) float] [-fuel(-fl) float] [-velocity(-vel) float float float] [-uvw float float float] Directly set the content of a particular cell inside the grid. Note that this function works only in grid space and phxfdSystem do not have effect on it.
Return value: true if the operation was completed successfully, and false otherwise. | ||||||||||||||||
phxfdGet [-node(-n) string] -position(-pos) float float float [-temperature(-t)] [-smoke(-sm)] [-fuel(-fl)] [-velocity(-vel)] [-uvw] Get the content of the grid at a given point. Note that the point is in the coordinate system specified by phxfdSystem.
Return value: float[] An array of floats with the content of the grid at that point. The queued channels are return in a fixed order - temperature, smoke, fuel, velocity, uvw. | ||||||||||||||||
phxfdFreeze -position(-pos) int int int [ freeze bool] [ source bool] Freeze a cell during the simulation. The cell can be made optionally a source.
Return value: true if the operation was completed successfully, and false otherwise. | ||||||||||||||||
phxfdParticle [-node(-n) string] -position(-pos) float float float -partgroup(-pg) string [-velocity(-vel) float float float] [-radius(-rad) float] Create particle in given position with given properties.
Return value: true if the operation was completed successfully, and false otherwise. | ||||||||||||||||
phxfdSaveCache filename string node string Save the current content of the grid to an AUR or VDB cache file.
Return value: true if the operation was completed successfully, and false otherwise. |
Python Functions |
setsystem system string [ node string] Specify which coordinate system to be used when calling get, inject and particle. Return value: true if the operation was completed successfully, and false otherwise. |
getsystem [ node string] Return the current coordinate system. Return value: string The current coordinate system. |
inject (x float, y float z float) disch float [temp float] [smoke float] [(vx float, vy float, vz float)] [(ufloat, v float, w float)] Inject fluid in given point. Using this function you can create your own procedural sources. The result of the function CAN NOT be achieved by calling one or more set functions, because they do not affect the quantity of the fluid, but only the parameters carried by the fluid. The injection of fluid in some point causes changes in the content only of the nearest 8 cells, but produces an outgoing flow in the entire grid. Nevertheless the function is not slower than the ordinary phfxSet function, because the outgoing flow appears later, when the simulation is executed. If get function is executed immediately after inject in some near point, the velocity will be not changed. Return value: true if the operation was completed successfully, and false otherwise. |
set (cx int, cy int cz int) [temp float] [smoke float] [(vx float, vy float, vz float)] [(u float, v float, wfloat)] [ node string] Directly set the content of a particular cell inside the grid. Note that this function works only in grid space and setsystem do not have effect on it. Return value: true if the operation was completed successfully, and false otherwise. |
setT (cx int, cy int cz int) temp float [ node string] Directly set the temperature in K of a particular cell inside the grid. Note that this function works only in grid space and setsystem do not have effect on it. Return value: true if the operation was completed successfully, and false otherwise. |
setSm (cx int, cy int cz int) temp float [ node string] Directly set the value of the "Smoke" channel of a particular cell inside the grid. Note that this function works only in grid space and setsystem do not have effect on it. Return value: true if the operation was completed successfully, and false otherwise. |
setFl (cx int, cy int cz int) temp float [ node string] Directly set the value of the "Fuel" channel of a particular cell inside the grid. Note that this function works only in grid space and setsystem do not have effect on it. Return value: true if the operation was completed successfully, and false otherwise. |
setV (cx int, cy int cz int) temp float [ node string] Directly set the velocity of a particular cell inside the grid. Note that this function works only in grid space and setsystem do not have effect on it. Return value: true if the operation was completed successfully, and false otherwise. |
setUVW (cx int, cy int cz int) temp float [ node string] Directly set the value of the "UVW" channel of a particular cell inside the grid. Note that this function works only in grid space and setsystem do not have effect on it. Return value: true if the operation was completed successfully, and false otherwise. |
get (x float, y float z float) [ node string] Get the content of the grid at a given point. Note that the point is in the coordinate system specified by setsystem. Return value: [float float float tuple tuple] array with the content in this order - temperature, smoke, fuel, velocity, uvw. |
getT (x float, y float z float) [ node string] Get the temperature in K of the grid at a given point. Note that the point is in the coordinate system specified by setsystem. Return value: float the temperature in K. |
getSm (x float, y float z float) [ node string] Get the value of the "Smoke" channel at a given point. Note that the point is in the coordinate system specified by setsystem. Return value: float the smoke. |
getFl (x float, y float z float) [ node string] Get the value of the "Fuel" channel at a given point. Note that the point is in the coordinate system specified by setsystem. Return value: float the fuel. |
getV (x float, y float z float) [ node string] Get the velocity of the grid at a given point. Note that the point is in the coordinate system specified by setsystem. Return value: tuple the velocity. |
getUVW (x float, y float z float) [ node string] Get the value of the "UVW" channel at a given point. Note that the point is in the coordinate system specified by setsystem. Return value: tuple the uvw. |
freeze (cx int, cy int cz int) [ freeze bool] [ source bool] Freeze/Unfreeze the cell at a given point during the simulation, and optionally mark it as a source. Return value: true if the operation was completed successfully, and false otherwise. |
particle group string (x float, y float z float) [(vx float, vy float, vz float)] [ radius float] [ node string] Create a particle in a given position with given properties. Return value: true if the operation was completed successfully, and false otherwise. |
saveCache filename string [ node string] Save the current content of the grid to a cache file. Return value: true if the operation was completed successfully, and false otherwise. |
...
mayabatch.exe -file "D:\PHOENIX_QA\batchSimScene.ma" -command "phxfdBatchSim(\"PhoenixFDSimulator1\")"
Option
...
Vars
...
Maya Option Vars |
optionVar -sv "PhoenixFD_cachePath" string Set the current cache path that will be used with the template path names. |
optionVar -iv "PhoenixFD_safemode" number Run Phoenix in safe mode. This will turn off the shading preview when loading new scenes to prevent display problems. |