if($F>12)then chkey -f 15 else chkey -f 5 endifwhich gives me an error ? As well I can't use it because the if clauses must be on seperate lines ?
HExpression Error ?
2953 11 1- _Christopher_
- Member
- 766 posts
- Joined: April 2014
- Offline
- Enivob
- Member
- 2537 posts
- Joined: June 2008
- Offline
You can use multiple line expressions in Houdini. Click in the field where you type the expression and press CTRL-E/CMD-E to activate the multi-line editor. You also get a syntax warning log in the lower areas as well.
You may want to look up the syntax for IF, I don't think then is part of it in this Script language.
More C like…
You may want to look up the syntax for IF, I don't think then is part of it in this Script language.
More C like…
if($F>12 0:1)
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.
- _Christopher_
- Member
- 766 posts
- Joined: April 2014
- Offline
Open Textport and do a help for if, you'll see the example does place the word ‘then’
I keep getting the error extra tokens detected
Does it matter if I give a value for the frame; if it does, this is what I've attempted although I can't figure out my syntax errors ?
I keep getting the error extra tokens detected
if($F>12 0:1) chkey -f 15 chkey -f 5
if($F>12 0:1) ? (chkey -f 15)(chkey -f 5)
Does it matter if I give a value for the frame; if it does, this is what I've attempted although I can't figure out my syntax errors ?
if($F>12 0:1) (chkey -f 15 -v 8 -F ‘bezier()’)(chkey -f 5 -v 7 ‘bezier()’)
Edited by _Christopher_ - June 27, 2016 10:24:44
【T】【C】【S】
- Enivob
- Member
- 2537 posts
- Joined: June 2008
- Offline
Ok, after looking up the Hscript IF syntax it looks like you need commas, not space colon.
So you don't really need to set a chkey at all, The result will become the value at that time. The first value is if the statement is True and the second value is if the statement is False.
Place the above code in the Y-Translate field to achieve your original request.
if($F>12,15,5)
Place the above code in the Y-Translate field to achieve your original request.
Edited by Enivob - June 27, 2016 11:48:12
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.
- _Christopher_
- Member
- 766 posts
- Joined: April 2014
- Offline
- Enivob
- Member
- 2537 posts
- Joined: June 2008
- Offline
- _Christopher_
- Member
- 766 posts
- Joined: April 2014
- Offline
- Enivob
- Member
- 2537 posts
- Joined: June 2008
- Offline
The expression does not add a keyframe. It takes the place of the keyframe and returns a value for the channel instead. You can't effectively have both on the same field. This means you either keyframe the field or you program the field. The expression programs the field and returns a result.
The two trailing values are the result for the True/False case of the If statement.
For instance we can re-write the expression so the result only moves up and down for the first 24 frames then jumps to a final location of 2.
The two trailing values are the result for the True/False case of the If statement.
For instance we can re-write the expression so the result only moves up and down for the first 24 frames then jumps to a final location of 2.
if(($F<24),(sin($F)*10),2)
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.
- _Christopher_
- Member
- 766 posts
- Joined: April 2014
- Offline
- Enivob
- Member
- 2537 posts
- Joined: June 2008
- Offline
Move the timeline to frame #18, type in 15 for the Y value then ALT-CLICK on the field to create a keyframe with the current value (it turns green). Then Middle-CLICK on the field to bring up the curve editor where you can manipulate the keyframes.
Edited by Enivob - June 29, 2016 11:16:35
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.
- _Christopher_
- Member
- 766 posts
- Joined: April 2014
- Offline
- _Christopher_
- Member
- 766 posts
- Joined: April 2014
- Offline
-
- Quick Links