Why should it work? As I know the Controller superclass doesn't have the #tangents property
You have at least three options to achieve what you want (linear in/out tangents):
1. Use linear controller:
delete objects
b = box isselected:on
b.pos.controller = linear_position()
with animate on
(
at time animationrange.start
(
b.pos = [0,0,0]
)
at time ((animationrange.start + animationrange.end)/2)
(
b.pos = [50,0,50]
)
at time animationrange.end
(
b.pos = [100,0,0]
)
)
2. Use default new key tangent type:
delete objects
b = box isselected:on
def_in = BezierDefaultParams.inTangentType
def_out = BezierDefaultParams.outTangentType
BezierDefaultParams.inTangentType = #linear
BezierDefaultParams.outTangentType = #linear
--BezierDefaultParams.inTangentType = #flat
--BezierDefaultParams.outTangentType = #flat
with animate on
(
at time animationrange.start
(
b.pos = [0,0,0]
)
at time ((animationrange.start + animationrange.end)/2)
(
b.pos = [50,0,50]
)
at time animationrange.end
(
b.pos = [100,0,0]
)
)
BezierDefaultParams.inTangentType = def_in
BezierDefaultParams.outTangentType = def_out
3. Set key's tangents:
delete objects
b = box isselected:on
with animate on
(
at time animationrange.start
(
b.pos = [0,0,0]
)
at time ((animationrange.start + animationrange.end)/2)
(
b.pos = [50,0,50]
)
at time animationrange.end
(
b.pos = [100,0,0]
)
)
p = b.pos.controller
for k=1 to 3 do
(
for key in p[k].keys do
(
key.intangenttype = #linear
key.outtangenttype = #linear
)
)
Here is a homework:
Find another mxs built-in methods to do the same as in the solution #2
😉