Announcement

Collapse
No announcement yet.

Maya Batch simulation

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Maya Batch simulation

    Hello guys,

    I was trying to see if it's possible to batch simulate with PhoenixFD/Maya, like batch rendering from the command line. I couldn't really find anything relevant in the docs.
    The only thing I found is this, but it doesn't seem to work and tries to open Maya. Also, if it's possible (the batch simulation from command line), what would be the procedure with a simulation license on a node ? Is the best way to copy the project on this nodes hard drive (probably yes) or configure right away to cache the data on this nodes hard drive even if the project is on a distant drive ?

    Phoenix is just a really good software, and we would really like to enhance the work.
    Batch Scripting



    PhoenixFD can do simulation in batch mode. Like inside the GUI, only one simulation can be run at a time. The batch commands are blocking, i.e. they will return the execution to the script after finishing. This can be used to script more complicated setups, like one simulator depending on the result of another. These commands can also be run inside the GUI, but will effectively block it for interaction. Once started, they can't be stopped. However, the simulation can run slightly faster.
    Batch Functions
    phxfdBatchSim node string

    Start simulating the specified node. The command will return when the simulation is over.
    phxfdStartBatch node string startFrame int endFrame int

    The same as phxfdBatchSim, but the second and third arguments override the default start/stop frame for the simulation.
    phxfdBatchRestore node string startFrame int

    Restore the simulation in batch mode. The second argument specify the frame from which the simulation must be restored. This is analogue to moving the time slider and clicking the "Restore" button.
    phxfdBatchResim node string waiting bool

    Start simulating in resimulation mode. If waiting is true, the Cache Waiting is turned on.
    phxfdBatchResimRestore node string startFrame int waiting bool

    Restore the resimulation in batch mode. The second argument specify the frame from which the simulation must be restored. This is analogue to moving the time slider and clicking the "Restore" button. If waiting is true, the Cache Waiting is turned on.


    Example command line to launch Maya batch:
    render -r vray -preRender "phxfdBatchSim("PhoenixFDSimulator1")" -noRender phx_simple.ma
    Example command line calls to initialize Maya Batch and start a Phoenix FD simulation:
    cd "C:\Program Files\Autodesk\Maya2017\bin"
    mayabatch.exe -file "D:\PHOENIX_QA\batchSimScene.ma" -command "phxfdBatchSim("PhoenixFDSimulator1")"
    www.mirage-cg.com

  • #2
    Hey,

    You are in the right place in the docs. These examples show how to launch Maya and start a sim, but if you are already in Maya it's easier - you just need to call phxfdBatchSim("PhoenixFDSimulator1") from some callback - e.g. on scene open. You definitely must set the sim paths to some absolute path though (or a shared folder on the network if you are going to use other machines as well).

    Also, you can use the Phoenix Backburner or Deadline submitter, if batch is not a must

    Cheers!
    Svetlin Nikolov, Ex Phoenix team lead

    Comment


    • #3
      Thank you, Svetlin, for the fast response. I will look into it.

      But, wouldn't it be handy to be able to launch a Batch via command line ? I'm used to launch a lot of renders with such a script, which gives me the opportunity to launch different things, even for different projects.
      I know that this is mainly the purpose of Deadline or Backburner... but I'm not using those (for now)

      I'd like to just have "render -r vray -preRender "phxfdBatchSim("PhoenixFDSimulator1")" -noRender phx_simple.ma" and having phoenix simulate in the command line window (like the renders).

      Maybe I'm misunderstanding...
      www.mirage-cg.com

      Comment


      • #4
        Yup, I think we might not be on the same page here - you can start a Phoenix simulator by calling phxfdBatchSim("PhoenixFDSimulator1"). You can call this from anywhere - the render command, or from a scene open script, or from the simulation-end callback of another simulator. When you are running batch mode, you just have to make sure this command is called from somewhere and it will start the sim.
        Svetlin Nikolov, Ex Phoenix team lead

        Comment


        • #5
          It works like a charm. I don't know why I didn't get it to work some days ago :/
          www.mirage-cg.com

          Comment


          • #6
            Whew, no probs
            Svetlin Nikolov, Ex Phoenix team lead

            Comment

            Working...
            X