Announcement

Collapse
No announcement yet.

Simulation via Maxscript/Deadline

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

  • Simulation via Maxscript/Deadline

    This is what I posted into the Thinkbox Forums and Bobo's answer:

    "Hey Guys,

    I want to use deadline to submit a PhoenixFD Simulation to the farm. So I have a little maxscript that starts the simulation while the job is sent as a maxscript job (Single Task, Workstation Mode, disable Progress Update timeout) Everything works like a charm, the sim starts - but then Max just closes. With a lot of trial and error I figured out that it works fine when I set the "Number of seconds between queries for new Tasks while the Slave is Rendering" (Repository Options, Slave Settings) to some large number. But that also affects all other jobs. Is there any other way to set this just for the job?

    Bobo's Answer:

    I guess that your MAXScript job is returning TRUE too soon. You launch the simulation and immediately after that the script says "I am done!". So the Max instance runs only until it gets checked and assumed to be finished, which causes Max to close and start another task...

    I am not familiar enough with Phoenix, so I am not sure how you launch the simulation. If your MAXScript simply "presses the UI button" of Phoneix and then exits, obviously the job will be considered done. If your MAXScript could continue running after that, say, in a For loop that checks whether the simulation is done (for example based on what files are written to disk, or what the current time of the scene is and so on), and this For loop does NOT prevent the Phoenix Simulation from running, this would be your ticket to success. Unfortunately, since MAXScript runs in the Main Thread of 3ds Max, it is quite possible that it cannot run at the same time as a Phoenix Simulation.

    This is only possible with MAXScript functions like render() where the Renderer is launched and MAXScript waits for it to return. It might require changes on the side of Phoenix to allow a MAXScript function to trigger simulation and wait for it to finish before continuing with the next MAXScript command...

    So I suspect right now the code looks like (in pseudo-code):
    CODE: SELECT ALL
    -Initialize DeadlineUtils
    -Press Simulate button of Phoenix (the sim starts, MAXScript continues)
    -Return TRUE (the sim is still running)


    But you need
    CODE: SELECT ALL
    -Initialize DeadlineUtils
    -Call a blocking simulatePhoenix() function (the sim starts, MAXScript waits for function's return)
    -Return TRUE or FALSE depending on the result of the previous line


    Please talk to Chaos Group to determine whether there is a way to do the latter in MAXScript..."
    Sascha Geddert
    www.geddart.de

  • #2
    hi, i think you can resolve the problem using the A_Wait function immediately after the A_StartSim
    it blocks the returning until the simulation is finished and according the bobo's words this should be enough.
    ______________________________________________
    VRScans developer

    Comment


    • #3
      Jup! Works like a charm!!! Thanks a Lot!
      Sascha Geddert
      www.geddart.de

      Comment

      Working...
      X