how to force playback while setting frame in a Python loop?

   2887   3   0
User Avatar
Member
99 posts
Joined: March 2009
Offline
I have this script that I want to use as a benchmark tool and the same format works in Maya but in Houdini, it simply goes to the last frame without drawing the runup. How would I force Houdini to draw each frame for hou.setFrame ?

import time

runcount = 5
resultTime = {}
totalTime = 0
for n in range(0, runcount):
start = time.time()
for i in range(1, 100):
hou.setFrame(i)
end = time.time()
resultTime = end - start
print resultTime
totalTime = resultTime + totalTime
print totalTime
average = totalTime / runcount
print “average is ” + str(average)
User Avatar
Member
8536 posts
Joined: July 2007
Online
you can try forcing your obj level to cook or just certain nodes if you insert <node>.cook() in your loop


for i in range(1, 100):
hou.setFrame(i)
hou.node(“/obj”).cook()
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
99 posts
Joined: March 2009
Offline
that doesn't seem to update the camera
User Avatar
Member
99 posts
Joined: March 2009
Offline
actually, it doesn't seem to update anything.
  • Quick Links