Log overall simulation time or average frame time
#1
Is there a way to display not only the individual frame times, but also the average frame times or the time needed for the last simulation to be completed after hitting play?
I have found the debug settings printed to the Listener as well as the Profiler in the Utilities, but they only seem to display individual frames.


Edit: Here's an AI-script that seems to work fairly well:

Code:
t1 = timestamp()
-- Advance the time slider to the last frame (forces sim to compute)
slidertime = animationrange.end
t2 = timestamp()
timeTaken = (t2 - t1) / 1000.0
format "Simulation time: %.2f seconds\n" timeTaken
  Reply
#2
Advance the time slider forward and tyFlow will print the total time to the listener. It only shows per-frame time if you advance one frame at a time.
  Reply
#3
Thank you, that makes sense. No idea why I didn't figure that out myself.

Right now, jumping ahead to the end of the timeline seems to have caused a state where tyFlow calculates very fast and ignores at least cloth self collisions. (clothSelfCollision example scene changed to Cuda collision solver with Particle Physics deactivated but that might be a coincidence). Same thing happened yesterday once with the script. Unticking/ticking/changing the respective settings after that did nothing, restarting Max fixed it. Might be a lot of things, of course, including a feature like a preview mode. I'll try a couple more things if it happens again.
  Reply
#4
There's nothing about skipping forward that would disable collisions. Sounds more like a GPU driver crash is occurring. Check the editor/listener for error messages.
  Reply
#5
Thanks! Will do when it happens again.
  Reply
#6
Yep, it's a CUDA crash: "error: -100| code 700" "CUDA crash info: [code: 700 | file: __file__. | line: 21]."
  Reply


Forum Jump: