THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 26/07/2011 at 11:51, xxxxxxxx wrote:
Hey guys,
I can't seem to figure out the proper syntax python needs run ternary conditions.
Here's an example that works in Coffee:
main(doc,op)
{
var distance = 1.5; // the larger the number the farther the travel
var pos = op->GetAbsPos() ? vector(0,0,0) : vector(0,100,0) * distance;
op->SetAbsPos(pos);
}
I can't seem to get this same code to work in python:
import c4d
def main() :
distance = 1.5 # the larger the number the farther the travel
pos = op.GetAbsPos() if c4d.Vector(0,0,0) else c4d.Vector(0,100,0) * distance
op.SetAbsPos(pos)
c4d.EventAdd()
if __name__=='__main__':
main()
What am I doing wrong?
-ScottA