Python ROP Current Frame

   984   2   1
User Avatar
Member
191 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
2536 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 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
User Avatar
Member
191 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