if OR then statements in expressions?

 10 October 2012 kronique Veteran portfolio kronique United States Minor Outlying Islands if OR then statements in expressions? Just wondering if this is possible with expressions ? I'm not a pro or anything, I just researched a bit, this is the result. My book doesn't say if i can or cant use OR. in theory i need something that does this: if (( boneA.rZ=5) && (boneB.rZ=4) OR (boneA.rZ=16) && (boneB.rZ=20)) then {cluster.envelope = 1.0;} else {cluster.envelope = 0.0;} if not what is an alternative? if i give the cluster a floating point will it gradually blend on automatically? thanks !! Last edited by kronique : 10 October 2012 at 05:22 AM. share quote
 10 October 2012 ristopuukko Earthling   portfolio Risto Puukko Senior fx td FrameStore London, United Kingdom If you need interpolation between values, checkout linstep and smoothstep - commands. /risto __________________ - Oh no, it's me - share quote
 10 October 2012 zaskar Expert portfolio franky****inFourFingaz - Dresden, Germany Btw the syntax for your example is almost exactly like your example: if( ((a == w) && (b == x)) || ((c == y) && (d == z)) ) Dont let you confuse by complexity, you simply reduce the statement to: if( trueA ) then do... while trueA is the case if ( trueB || trueC ) while trueB is the case if (trueD && trueE) with trueD being the case if (trueF == trueG) -> ad inifinitem share quote
 10 October 2012 newguy4life Generalist portfolio Quin Barclay 3d Generalist Chicago, USA Check out this website, it is a good reference for operators. ``````if ( ((boneA.rZ==5) && (boneB.rZ==4)) || ((boneA.rZ==16) && (boneB.rZ==20)) ) { cluster.envelope = 1.0; } else { cluster.envelope = 0.0; }`````` Using that code, the envelope will not interpolate. Like risto said, check out linstep and smoothstep, but you may also just want to check out driven keys if you don't have to do this an expression. share quote
 10 October 2012 kronique Veteran portfolio kronique United States Minor Outlying Islands Originally Posted by zaskar: Btw the syntax for your example is almost exactly like your example: if( ((a == w) && (b == x)) || ((c == y) && (d == z)) ) Dont let you confuse by complexity, you simply reduce the statement to: if( trueA ) then do... while trueA is the case if ( trueB || trueC ) while trueB is the case if (trueD && trueE) with trueD being the case if (trueF == trueG) -> ad inifinitem Are you saying our examples are practically exactly alike? If so yeah i can kind of see that, but having hard time understanding. share quote
 10 October 2012 kronique Veteran portfolio kronique United States Minor Outlying Islands Originally Posted by newguy4life: Check out this website, it is a good reference for operators. ``````if ( ((boneA.rZ==5) && (boneB.rZ==4)) || ((boneA.rZ==16) && (boneB.rZ==20)) ) { cluster.envelope = 1.0; } else { cluster.envelope = 0.0; }`````` Using that code, the envelope will not interpolate. Like risto said, check out linstep and smoothstep, but you may also just want to check out driven keys if you don't have to do this an expression. Great its really appreciated. Thanks for getting in touch and I'll check it out. share quote
 10 October 2012 Aikiman Some guy   portfolio Jeremy Raven Wellington, New Zealand C (Mel) uses '||' whereas Python uses 'OR' __________________ Vimeo share quote
 10 October 2012 CGTalk Moderation Expert Thread automatically closed This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum. __________________ CGTalk Policy/Legalities Note that as CGTalk Members, you agree to the terms and conditions of using this website. share quote

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts vB code is On Smilies are On [IMG] code is On HTML code is Off CGSociety Society of Digital Artists www.cgsociety.org Powered by vBulletinCopyright ©2000 - 2006, Jelsoft Enterprises Ltd.