View Full Version : basicExpression has encountered a divide by zero. Result is unpredictable. ?

02 February 2006, 06:25 AM
hi ppl,

i have my rig where the hands have stretchy setup, and it works fine. its done with a distance tool, distance into MD nodes, driving my bone's translates etc..etc...

now since i wanted to shift some clavicle bones (oops! i know that shud'nt be ) ,.... i did by first disconnecting the translate inputs on the bone, disconnect the MD nodes, etc.. and then updated my distance_offset (MD node) with the new distance from the dist.tool .. and reconnected back the o/p into my bone's ty.

the problem i now face is > a warning :" basicExpression has encountered a divide by zero. Result is unpredictable. " i'm unable to trace out what is "basicExpression" ? is this to do with the MD nodes or expressions or what ?

i do have my hand_ctrl, participating in other exps too.. i checked them all.. but i didnt c any such numbers or stuff which might result in zero inthe divider terms. n one more thing i face is, now my hand_ctrl with the auto-stretch_hand attribute on, stretches the arm but it kicks in some extra values, there by making the arm stretch in a "V" pose - like in normal IK behaviour.

any ideas or similar probs any one faced before ? what cud possibly be wrong ?

02 February 2006, 07:21 AM
No F'in idea, I just know I had the same damned problem today at work everytime I went to update a rig. Caused Maya to hang up and freeze on me, god damnit!

02 February 2006, 04:31 PM
hi seven6ty,
did u fix that up ?

ahaa !
i think i found the problem causing culprit.. i got a new transform group on top of my elbow bone ( it crept in while i did unparent from the shoulder , adjusted the shoudler, and parented it back) .. i'll c if i i can put the bone back to the shoulder with out the grp.... ?? any tips or hacks in these situations any one ?

but i still get the same warning : encountered a divide by zero. Result is unpredictable. ? thing.. what could this be ? the expressions or the multiply nodes themselves ?

any one ?

02 February 2006, 07:59 AM

...well, the basic question is if you use division in any of your expressions?

If you do, I would start inserting 'if (divider == 0) trace "found it!";' lines in them to find the problem.

I do believe that multiplyDivide nodes handle these cases gracefully. This is from personal experience as I have never seen this message and use these nodes quite much.

I seldom use expressions and when I do I always protect divisions and make them fail gracefully by using code like this:

if (b == 0) then { c = 0; }
else { c = a / b; }

/ Daniel

02 February 2006, 06:32 PM
MD nodes use what they call a "basicExpression" call where the process of either multiplying or dividing is passed through such a call. If your operator is set to division and there's say an empty transform or just a random transform group that is zeroed out, it will cause a divide by zero (fatal error with pretty much every scripting/coding language).

freeze transforms on your shoulder and then re-parent... Maya creates those pesky little transforms as a means of matching up the matrices between objects for proper orientation inheritence etc.


CGTalk Moderation
02 February 2006, 06:32 PM
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.