Is it possible to define local variables in a scripted driver?
E.g., I have a corrective shapekey whose value is driven by a bone. the driver is
1 if (+0.985972*X-0.028508*Y-0.145316*Z)< -1.982759 else -1*(+0.985972*X-0.028508*Y-0.145316*Z) - 0.982759 if (+0.985972*X-0.028508*Y-0.145316*Z)< -0.982759 else 0
where X,Y,Z are the Euler angles of the bone rotation. I would like to define a local variable x to simplify things to
x = (+0.985972*X-0.028508*Y-0.145316*Z)
1 if x< -1.982759 else -1*x - 0.982759 if x< -0.982759 else 0
However, the scripted expression can only be a single line. I tried to connect the two lines with a comma, but that is apparently illegal. Is there some other way to achieve this?