Hi,
I was hoping if anyone would know the answer as in post title.
I've tried playing around with hou.frame() but haven't had any luck.
Because at the moment with wave nodes - the option of using start/end in the drop down parameter of channel range does not work ( current bug waiting to be fixed ).
In a previous post awong suggested as a work around I use:
# Start
($FSTART-1)/ch(“rate”)
# End
$FEND/ch(“rate”)
However, this wave node is part of a digital asset that is being used in relation to many other digital assets and I cannot change expression language just for this workaround because all the other code is in python.
So I need to be able to control the start and stop in python.
Any help is appreciated.
Thank you
Python Equivalent to Hscript $FSTART and $FEND
7143 6 2-
- BabaJ
- Member
- 2141 posts
- Joined: Sept. 2015
- Offline
-
- Enivob
- Member
- 2637 posts
- Joined: June 2008
- Offline
Houdini Tricks website suggests you can execute a python function to convert a hScript variable to a result.
http://houdinitricks.com/post/119009659799/quicktip-python-parameter-expressions-part-1 [houdinitricks.com]
hscriptExpression(“$F”)
Another site with some Houdini code on the topic.
https://sites.google.com/site/fujitarium/Houdini/expressions-by-python-houdini [sites.google.com]
http://houdinitricks.com/post/119009659799/quicktip-python-parameter-expressions-part-1 [houdinitricks.com]
hscriptExpression(“$F”)
Another site with some Houdini code on the topic.
https://sites.google.com/site/fujitarium/Houdini/expressions-by-python-houdini [sites.google.com]
Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
-
- BabaJ
- Member
- 2141 posts
- Joined: Sept. 2015
- Offline
Thanks very much Enivob.
This works just as I needed.
In case some newbies are following I'm just going to include the code I used that works with expression language set for Python.
(hscriptExpression(“$FSTART”) + 50)/ch(“rate”):
With frame range set from 1 to 240 and a change rate of 24 this code starts movement at frame 53 ( I know it should start at 52 but that detail isn't important for me to look into at the moment although I suspect with the division of “rate” at 24 that perhaps there is some rounding going on that doesn't let it kick in until one frame later.
(hscriptExpression(“$FEND”) - 140)/ch(“rate”):
This end code stops movement at frame 100.
Thanks again Enivob.
This works just as I needed.
In case some newbies are following I'm just going to include the code I used that works with expression language set for Python.
(hscriptExpression(“$FSTART”) + 50)/ch(“rate”):
With frame range set from 1 to 240 and a change rate of 24 this code starts movement at frame 53 ( I know it should start at 52 but that detail isn't important for me to look into at the moment although I suspect with the division of “rate” at 24 that perhaps there is some rounding going on that doesn't let it kick in until one frame later.
(hscriptExpression(“$FEND”) - 140)/ch(“rate”):
This end code stops movement at frame 100.
Thanks again Enivob.
-
- tamte
- Member
- 9129 posts
- Joined: July 2007
- Offline
just for completness, here is the direct python equivalent:
$FSTART, $FEND:
hou.playbar.timelineRange()
$RFSTART, $RFEND:
hou.playbar.playbackRange()
and since there is one frame offset while converting between frames/time, you can use hou.frameToTime() or hou.timeToFrame():
hou.frameToTime(hou.playbar.playbackRange())
hou.frameToTime(hou.playbar.playbackRange())
$FSTART, $FEND:
hou.playbar.timelineRange()
$RFSTART, $RFEND:
hou.playbar.playbackRange()
and since there is one frame offset while converting between frames/time, you can use hou.frameToTime() or hou.timeToFrame():
hou.frameToTime(hou.playbar.playbackRange())
hou.frameToTime(hou.playbar.playbackRange())
Tomas Slancik
CG Supervisor
Framestore, NY
CG Supervisor
Framestore, NY
-
- BabaJ
- Member
- 2141 posts
- Joined: Sept. 2015
- Offline
-
- graham
- Member
- 1925 posts
- Joined: Nov. 2006
- Offline
The timelineRange() function was a new addition for Houdini 15 so most definitely not deprecated. It simply does not appear to be documented, which with the new help server probably means not show up. Sadly there does not seem to be a corresponding setTimelineRange() function

Graham Thompson, Technical Artist @ Rockstar Games
-
- BabaJ
- Member
- 2141 posts
- Joined: Sept. 2015
- Offline
-
- Quick Links