Normalized Time
3967 6 0- jderry2019
- Member
- 10 posts
- Joined: Jan. 2017
- Offline
- BabaJ
- Member
- 2024 posts
- Joined: Sept. 2015
- Offline
- jderry2019
- Member
- 10 posts
- Joined: Jan. 2017
- Offline
- BabaJ
- Member
- 2024 posts
- Joined: Sept. 2015
- Offline
I don't think Vex has direct access to the Frame Range values.
The only way I can think of is to create a parameter and use Python to ‘grab’ your current hip files Frame Range to put it there:
playbackRange returns two values, first for the beginning frame range and the second the end, hence the one in square brackets.
Then in vex you could use a channel reference to get that parameter.
Now your saying your building a ‘snippet’ so I assume your inside a vop node, so I don't know if this will work there but it will for a wrangle node at the sop level.
You could use an Hscript reference with backticks.
Edit: on an unrelated sidenote. I was just trying to figure out how to parse the lines of code in a wrangle with python. Looked at the parameter that holds the text, and it too is referred as a snippet.
The only way I can think of is to create a parameter and use Python to ‘grab’ your current hip files Frame Range to put it there:
hou.playbar.playbackRange()[1]
playbackRange returns two values, first for the beginning frame range and the second the end, hence the one in square brackets.
Then in vex you could use a channel reference to get that parameter.
Now your saying your building a ‘snippet’ so I assume your inside a vop node, so I don't know if this will work there but it will for a wrangle node at the sop level.
You could use an Hscript reference with backticks.
float End_Frame = `$FEND`;
Edit: on an unrelated sidenote. I was just trying to figure out how to parse the lines of code in a wrangle with python. Looked at the parameter that holds the text, and it too is referred as a snippet.
Edited by BabaJ - June 28, 2018 11:38:20
- jderry2019
- Member
- 10 posts
- Joined: Jan. 2017
- Offline
- AhmedHindy
- Member
- 128 posts
- Joined: Oct. 2020
- Offline
BabaJ
I don't think Vex has direct access to the Frame Range values.
The only way I can think of is to create a parameter and use Python to 'grab' your current hip files Frame Range to put it there:hou.playbar.playbackRange()[1]
playbackRange returns two values, first for the beginning frame range and the second the end, hence the one in square brackets.
Then in vex you could use a channel reference to get that parameter.
Now your saying your building a 'snippet' so I assume your inside a vop node, so I don't know if this will work there but it will for a wrangle node at the sop level.
You could use an Hscript reference with backticks.float End_Frame = `$FEND`;
Edit: on an unrelated sidenote. I was just trying to figure out how to parse the lines of code in a wrangle with python. Looked at the parameter that holds the text, and it too is referred as a snippet.
suprisingly didnt know ou can use python expressions in VEX, I tried this method in a SOP wrangler and it worked, thanks.
- tamte
- Member
- 8444 posts
- Joined: July 2007
- Offline
AhmedHindyjust to clarify, it's not executing the expression in VEX, any expression in the code parameter is evaluated first and the resulting string in that parameter will get compiled as snippet code
suprisingly didnt know ou can use python expressions in VEX, I tried this method in a SOP wrangler and it worked, thanks.
so while injecting constant values like $FEND or $FPS is totally fine, having for example time dependent expression would be very inefficient as it would trigger recompile every time so it's good to be aware of whats happening
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
-
- Quick Links