var tween = gsap.timeline()
.set(".blue",{ duration: 0, x: 0 })
.to(".blue", 0.83333, { x: 500, ease: "steps(1, true)" }).pause();
var tl = gsap.timeline()
.fromTo(tween, {time: tween.time()}, {time: tween.duration(), ease:"none" })
.to(".blue", { duration: 0.23333, x: 1000, ease: "none" })
.timeScale(0.2);
Exactly. I exactly want this effect.
If you re-run codepen, the "blue square" displays exactly the "stepped" curve in spine.
This is the expected in spine I would like, but I have to create two instances in GSAP and replace the first instance/variable to mimic this effect.
time 0 |<----->| 0.83332 :: we hold the same value over (x = 0) a selected number of frames for a function over those two keyframes.
time 0.83333 |<----->| 1.06666 :: when reach the frame 25 (time=0.83333 --> x=500) we reshape the curve to create a linear velocity for instance, so that the values are interpolated (tweened) consistently between keyframes (time 1.06666 => x=1000)
This is a little Spine json output of an animation, notice that we have a some "stepped" curve. I need to find a way to recreate a simple stepped ease in GSAP to re-utilize this ease function. I want to create this effect using just one GSAP instance, the most simples way.
"hip": {
"rotate": [
{ "curve": "stepped" },
{ "time": 0.9333, "curve": "stepped" },
{ "time": 1.3667 }
],
"translate": [
{ "x": -11.57, "y": -3.01 },
{ "time": 0.2333, "x": -16.2, "y": -19.44 },
{ "time": 0.3333, "x": 7.67, "y": -8.49, "curve": 0.057, "c2": 0.07, "c3": 0.713 },
{ "time": 0.3667, "x": 15.39, "y": 5.02 },
{ "time": 0.4667, "x": -7.85, "y": 57.22 },
{ "time": 0.6, "x": -10.82, "y": 96.34, "curve": 0.241, "c2": -0.01 },
{ "time": 0.7333, "x": -7.02, "y": 54.71 },
{ "time": 0.8, "x": -10.58, "y": 32.2 },
{ "time": 0.9333, "x": -31.99, "y": 0.45 },
{ "time": 1.0667, "x": -12.48, "y": -29.48 },
{ "time": 1.3667, "x": -11.57, "y": -3.01 }
],
"scale": [
{ "curve": "stepped" },
{ "time": 0.9333, "curve": "stepped" },
{ "time": 1.3667 }
]
},
"left upper leg": {
"rotate": [
{ "angle": 17.14 },
{ "time": 0.2333, "angle": 44.35 },
{ "time": 0.3333, "angle": 16.47 },
{ "time": 0.4, "angle": -9.88 },
{ "time": 0.4667, "angle": -11.42 },
{ "time": 0.5667, "angle": 23.47 },
{ "time": 0.7667, "angle": 71.83 },
{ "time": 0.9333, "angle": 65.53 },
{ "time": 1.0667, "angle": 51.01 },
{ "time": 1.3667, "angle": 17.14 }
],
"translate": [
{ "x": -3, "y": -2.25, "curve": "stepped" },
{ "time": 0.9333, "x": -3, "y": -2.25, "curve": "stepped" },
{ "time": 1.3667, "x": -3, "y": -2.25 }
],
"scale": [
{ "curve": "stepped" },
{ "time": 0.9333, "curve": "stepped" },
{ "time": 1.3667 }
]
},