Posted by: Jeff | 2017/04/27

Houdini: Simulation Timestamp

This is a short python script that I’m currently using to print out the total simulation processing time of the current DOP network.


import datetime

def simTimeStamp(event_type, frame):
    global tStart, tEnd
    if event_type == hou.playbarEvent.FrameChanged and frame == 1:
    if event_type == hou.playbarEvent.Started:
        tStart =
    if event_type == hou.playbarEvent.Stopped:
        tEnd =
        tDelta = tEnd - tStart
        print "Simulation time:", tDelta


if hou.frame() == 1:

Run the above code as a Shelf Tool.
It will reset the simulation, and restart it again from frame 1. Afterwards, the timestamp will be printed on the Python Shell like so:


Timestamp output

Instead of using the Performance Monitor, I created this so as to avoid the (albeit small) overhead of the utility. (And as an exercise in using Python within Houdini)


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: