Python ROP Current Frame

   144   2   1
User Avatar
Member
117 posts
Joined: 10月 2018
Offline
I'm trying to get the current frame in a python rop, but the regular hou.frame() doesn't work. In SOPs it prints out the frame being evaluated but in the ROP it just prints out the frame that I hit the render button on. Any ideas how to fix this?

frame = hou.frame()

print frame

In a SOP gives me this:
15.0
16.0
17.0
18.0
19.0
20.0

In a ROP gives me this:
1.0
1.0
1.0
1.0
1.0
1.0
User Avatar
Member
1890 posts
Joined: 6月 2008
Offline
Pre and Post Render fields do seem to have that problem. Try placing your script in the Pre-Frame Script field, instead.
Using Houdini Indie

Windows 7 32GB AMD FX8370 @ 4.1Ghz
nVidia 1070GTX 8BG RAM. Driver: 397.31
User Avatar
Member
117 posts
Joined: 10月 2018
Offline
Enivob
Pre and Post Render fields do seem to have that problem. Try placing your script in the Pre-Frame Script field, instead.

I was using the code in a python rop itself, not in the pre/post scripts. But using it in the pre-frame script does work correctly. Thanks!
  • Quick Links