• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scripting batch simulation in MEL
#1
hi,

I want to run multiple simulations sequentially, i.e. one after another, however I cannot find a way to do that in MEL script. Obviously, the MEL command "fumeFXcmd -runSimulation simMode fume;" spawns a simulation thread and returns control to the caller and I cannot find a function to tell whether the spawned fumeFX simulation thread has been completed or not. What I wish I had is either: (1) a fumeFX callback that tells me : I am done simulation (so I am ready to run another simulation, or maybe start rendering...), OR (2) a fumeFX function that tests whether a simulation job has completed or not.

Without having this functionality, I have to set in front of my PC and wait for one sim to finish, then start the other one manually...

Thanks in advance,
  Reply
#2
Hello,

Actually, there is a possibility to do so.
You could set some flag on the "PostSim" or "ffx_mel_PostSim" event.
I hope this helps.

Regards,
Kresimir Tkalcec
  Reply
#3
Thanks for your reply. I have two fumeFX grids, let's say A and B, I have modified A script such as:

proc ffx_mel_PostSim( string $node )
{
fumeFXcmd -runSimulation 0 trunk_p2a_g1Shape1;
}

so, basically in A postSim event, I try to start B simulation, however this did not work and I got an error message : //Error: (FumeFX) Simulation already running!

I think, during these functions, FumeFX is considered running, so it won't start another sim, is this correct? If so, any idea how to overcome this issue?
  Reply
#4
Hello,

You can do it like this:

proc ffx_mel_PostSim( string $node )
{
evalDeferred("pause -sec 10;fumeFXcmd -runSimulation 0 \"trunk_p2a_g1Shape1\";");
}


It will wait 10 seconds after it's done to allow first FumeFX to finish everything and then it'll start simming the other FumeFX.

I hope this helps.

Regards,
Kresimir Tkalcec
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)