$F in python

   6269   3   0
User Avatar
Member
861 posts
Joined: Oct. 2008
Offline
Why does the following:

frame = hou.hscriptExpression('$F')
print frame

print the frame number, but only once and not update as I press play?
--
Jobless
User Avatar
Member
110 posts
Joined:
Offline
Because you're just doing that, defining ‘frame’ as the $F that you where on when you assigned the value.

if you want to make a constantly updated one, you have to make a call tot he timeline so it checks what frame it's on and it prints the frame number it's on.

With this you just made a specific assignment. Scripting 101.
User Avatar
Member
861 posts
Joined: Oct. 2008
Offline
Cool. I wish we had that 101 somehwere. :wink:

The reason I was wondering is because I used a stamp expression in the same manner and that updates automatically as I change something in the scene. I thought perhaps Houdini expressions in python are updated/cooked automatically.
--
Jobless
User Avatar
Member
1908 posts
Joined: Nov. 2006
Online
The problem is that hou.hscriptExpression() isn't properly being flagged as time dependent so it doesn't update each frame. This is a known bug. You'll have to use hou.frame() or hou.intFrame() instead.
Graham Thompson, Technical Artist @ Rockstar Games
  • Quick Links