• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scripting Issue fumeFXcmd
#1
Hello,

I'm having some trouble getting a simple script to run. The script would run the default sim, then the wavelet and be able to run as a shelf button or through the script editor.

Now in Max script it's as easy as:

Code:
$FumeFX001.runsimulation 0
$FumeFX001.runsimulation 2

But the Mel equivalent in Maya does not work:

Code:
setAttr "fumeFXShape1.sSimOp" 0;
ffx_startSim "fumeFXShape1";
setAttr "fumeFXShape1.sSimOp" 2;
ffx_startSim "fumeFXShape1";


or
Code:
fumeFXcmd -runSimulation 0 "fumeFXShape1";
fumeFXcmd -runSimulation 2 "fumeFXShape1";

It seems that the default and wavelet try to sim at the same time and I'm not sure how to go about solving it. They both run on their own perfectly but cannot together. I tried it in python as well.

Thanks,

-Kjell
  Reply
#2
Hi

This two:
Code:
setAttr "fumeFXShape1.sSimOp" 0;
ffx_startSim "fumeFXShape1";
setAttr "fumeFXShape1.sSimOp" 2;
ffx_startSim "fumeFXShape1";
and
Code:
fumeFXcmd -runSimulation 0 "fumeFXShape1";
fumeFXcmd -runSimulation 2 "fumeFXShape1";
are two very different things when it comes to what you're trying to do.

We had some reports of sims not working one after the other, but it should be impossible for FumeFX to run two sims (default and wavelet) simultaneously (especially when using ffx_startSim command). Why do you believe that's what happening?

This issue has been resolved in FumeFX 4 for Maya.

Current workaround would be to utilize FumeFX scripting support and Maya deffered events: assign the post sim script to your FumeFX grid.
Code:
proc ffx_mel_PostSim( string $node )
{
    evalDeferred("pause -sec 10;fumeFXcmd -runSimulation 2 \"fumeFXShape1\";");
}
Then run your default simulation:
Code:
setAttr "fumeFXShape1.sSimOp" 0;
ffx_startSim "fumeFXShape1";
This should force FumeFX to wait till the default sim is done, before starting wavelet sim.

Again, this issue is resolved in FumeFX 4 for Maya.
Regards,
Dino Malpera
  Reply
#3
This is a great workaround and it works but it just runs the post script over and over. So the wavelet keeps running, finishing and runs again. I'm sure there is a way to only have it run once, I am still pretty new to scripting.

-----

The reason I thought they were attempting to run at the same time was because the only file to be written out was the wt_.fxd It seemed the default sim wasn't even attempted. I'm seeing a lot of weird consistency when it comes to the order in which the code is executed.

For Example in Mel

Code:
FumeFXcmd -runSimulation 0 "fumeFXShape1";
FumeFXcmd -makePreview 1 10 5 0 "fumeFXShape1";

This works great, runs sim and then a preview

With Python

Code:
import maya.cmd as mc
mc.fumeFXcmd( "fumeFXShape1", runSimulation=0)
mc.fumeFXcmd( "fumeFXShape1", makePreview=[1, 10, 5, 0)]

runs the preview first and then the sim which is no good

-----

I'm looking forward to Fume 4.0 for Maya and I'm hoping it will come out soon.

Thanks again for your help,

-Kjell
  Reply
#4
kjellstrode Wrote:This is a great workaround and it works but it just runs the post script over and over.
My bad. Should be something like:
Code:
global int ffx_seq_sim_flag = 0;
proc ffx_mel_PostSim( string $node )
{
    global int ffx_seq_sim_flag;
    if ( ffx_seq_sim_flag==0 ) {
        ffx_seq_sim_flag = 1;
        evalDeferred("pause -sec 10;fumeFXcmd -runSimulation 2 \"fumeFXShape1\";");
    }
}

-----

kjellstrode Wrote:For Example in Mel

Code:
FumeFXcmd -runSimulation 0 "fumeFXShape1";
FumeFXcmd -makePreview 1 10 5 0 "fumeFXShape1";

This works great, runs sim and then a preview

With Python

Code:
import maya.cmd as mc
mc.fumeFXcmd( "fumeFXShape1", runSimulation=0)
mc.fumeFXcmd( "fumeFXShape1", makePreview=[1, 10, 5, 0)]

runs the preview first and then the sim which is no good
I can confirm that. Wow. Will look into that. Thx.
Regards,
Dino Malpera
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)