Hi,
How do you get an if() expression to do nothing?
e.g.
if($PT<5,3,leave the same)
so unless the point no. is less than 3 it will leave the value the same.
Is the only way to reference its own channel? if you know what I mean.
so
if($PT<5,3,ch(“/obj/geo/me/thisvalue”))
???
Thanks
Henster
getting an expression to do nothing!
5353 6 0- Henster
- Member
- 196 posts
- Joined: July 2005
- Offline
- edward
- Member
- 7710 posts
- Joined: July 2005
- Online
I don't think that will work as that will create infinite recursion.
For regular object values, cubic() often works. If you're using this in a Point SOP, for say Position, then use one of $TX, $TY, or $TZ. ie. the default expression when you add an attribute there. Basically, the method depends on where you're trying to do this.
For regular object values, cubic() often works. If you're using this in a Point SOP, for say Position, then use one of $TX, $TY, or $TZ. ie. the default expression when you add an attribute there. Basically, the method depends on where you're trying to do this.
- MichaelC
- Member
- 344 posts
- Joined: July 2005
- Offline
- kemijo
- Member
- 87 posts
- Joined: July 2005
- Offline
- edward
- Member
- 7710 posts
- Joined: July 2005
- Online
- ben simons
- Member
- 387 posts
- Joined: July 2005
- Offline
kemijo
Doesn't this work?
if ($PT < 5, 3, $PT)
:?
yeah, I was about to say the same thing, but couldn't log in. This expression would usually be used to limit a value, right? In which case the two numbers would be the same, eg: if($PT<5,5,$PT) which says $PT should not be less than 5.
If you want to a minimum AND maximum limits, then check out clamp() ie:
-> exhelp clamp
float clamp (float value, float minimum, float maximum)
This is a Houdini expression function that will clamp the value
between the minimum and maximum numbers. It is used to prevent
the value from going outside the specified range.
i.e. If the value is less than the minimum number, the
minimum number will be returned. If the value is greater
than the maximum number, the maximum number will be returned.
cheers,
ben.
''You're always doing this: reducing it to science. Why can't it be real?'' – Jackie Tyler
- jason_iversen
- Member
- 12433 posts
- Joined: July 2005
- Offline
Ah, this thread makes you wish for a $V local variable defined and loaded with the contents of the field, like whats available in the Expression CHOP.
Then you could:
if( $PT>6, 3, $V )
Otherwise, I'm not sure how to do this..
Then you could:
if( $PT>6, 3, $V )
Otherwise, I'm not sure how to do this..
Jason Iversen, Technology Supervisor & FX Pipeline/R+D Lead @ Weta FX
also, http://www.odforce.net [www.odforce.net]
also, http://www.odforce.net [www.odforce.net]
-
- Quick Links