Skybar Posted April 4, 2013 Share Posted April 4, 2013 Instead of keyframing something, I sometimes use $F >1 & $F <10 if I would want something to be active between frames 1-10. In my opinion it's just faster and easier than putting down a keyframe for certain things, like activating a fluid emitter, it's also easier to change it later if I would want to. However, and this is where I have no clue. Say I would want the emitter to be active between frame 1-10, and then also 20-30. How do I do that? Is there a sign for OR, or something? Like this: $F >1 & $F <10 OR $F >20 & $F <30 I've tried lots of variations with brackets and the &-sign in the middle (since that is the only thing I know of), but it obviously doesn't work since it all evaluates to 1-10 AND 20-30; and a frame can't be between both at the same time, making it impossible. Does anyone know? Quote Link to comment Share on other sites More sharing options...
graham Posted April 4, 2013 Share Posted April 4, 2013 OR is double bars (||) ($F > 1 && $F < 10) || ($F > 20 && $F < 30) Quote Link to comment Share on other sites More sharing options...
Skybar Posted April 4, 2013 Author Share Posted April 4, 2013 Thank you! Also, what is the difference between & and &&? Is it preferred to use &&? Quote Link to comment Share on other sites More sharing options...
graham Posted April 4, 2013 Share Posted April 4, 2013 A singular & isn't a valid operator, you need to use 2 of them. http://www.sidefx.com/docs/houdini12.5/expressions/_operators Quote Link to comment Share on other sites More sharing options...
Skybar Posted April 4, 2013 Author Share Posted April 4, 2013 Oh I see, I actually thought it worked for me using only one before, but now when I try it doesn't.. Just my mind fooling myself I guess, my bad. Thank you again, Graham! Quote Link to comment Share on other sites More sharing options...
WesleyE Posted April 4, 2013 Share Posted April 4, 2013 An exmplenation about why it 'may' have worked before: The singular AND (&) is a bitwise operator rather than an logical operator. The bitwise AND operation will compare the two and return every bit that are set in both variables, so for example: if: a = 0011001b = 1010001c = a & b1011001 = c[/CODE]The logical AND (&&) operator chains two comparrisons together. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.