View Full Version : Expresion value erroneously showing as 0

03-08-2010, 12:53 AM
This weird problem has been causing me no end of trouble, and after a week of trying to solve it on my own with no results I figured I'd pester you people with it. :bangwall:

So I'm calculating this value, as shown below:


MC.Util_Camera_Angle is being calculated correctly. Hooray.

Then I tried using it in another expression and got an "Illegal division by zero" error. To make sure this really was the source of the problem, I removed everything but MC.Util_Camera_Angle in the expression and applied that expression to another channel. Sure enough, it shows up as zero:


I also tried (1 / [MC.Util_Camera_Angle]) and verified that it throws a divide-by-zero error. I cannot fathom why this would be since that channel is obviously non-zero (as shown in the first image).

Edit: This is in Lightwave 9.6 build 1539 (Mac 32) running under Mac OS 10.6.2

03-08-2010, 01:34 PM
Uh oh... total silence from the community. This does not bode well. :)

Would I be better off packing this stuff into an LScript file?

03-16-2010, 10:57 AM
I'll bump this up one more time before pestering Lightwave tech support with it. :)

Has no one else ever run into this kind of problem? Some of my expressions work just fine, but others fail to work and just return '0' for no apparent reason. Maybe it's leprechauns... evil, devious leprechauns...

03-16-2010, 11:52 AM
Ok... the first channel is getting a value above 0 as driven by expression, but its still keyed as 0.

What you're doing with the second expression is referencing a channel that's being controlled by an expression... that wont work. It will only reference the channels keyed value, not its expression driven value.

What you should do instead is reference the first expression inside the second expression (done by just typing the expression name with [] around it.

Remember though also when doing this... that expressions can only run 2 deep. So one expression can reference a subexpression, but any 2nd level subexpression referenced in that expression will be ignored.

03-16-2010, 11:56 AM
Oh lordy, that's good to know. Thank you!

I think I'm going to have to convert some of this stuff to LScript to get around those particular limitations.

03-16-2010, 12:10 PM
The other thing u can try is the expression motion modifier in the motions panel for a given item. The expression modeifier has a scratch pad that holds 4 expressions, A, B, C, D... and then these can be combined in various ways in the actual channel application slots... such as (A+B) - (C (sinD)... etc, etc.

03-16-2010, 12:16 PM
oh, and when I say A+B, etc... thats how the expression names work in the expression modifier, rather than you giving them names.