How to fadeOut an action exactly to the end of the action?

Hi,
I want to exactly fadeout an action to the end of the action.
e.g.

  • The clip is from an .glb that rotates an object with constant velocity form 0-359°
  • The action duration is 2sec and loops infinity
  • fadeout duration 1sec
  • User event occurs and the rotation should fadeOut to 359 degree
  • if fadeout starts exactly at action.time=1sec it will never reach the 359°

I tried it with three.js fadeout() and gsap.to { timescale, weight,…}, but of course this cant work.

I also considered creating a new action via Blender .glb that only contains the fade-out. But I’m worried that the transition won’t be smooth.

Can anyone help me with how to generally solve such a requirement?
Thanks…

If I understand well, the issue is you don’t have enough frame/time left (in the full clip) to fade the weight for 1 second.

I’m not sure it work in practice, but here is a speculative method:
you can try creating a .subclip dynamically, instead of using weights fading. It’s similar to your blender suggestion, but in realtime.

When the even happen:
-get the current frame
-depending current frame, pick normal or reverse animation (longest path or not, your choice)
-create a .subclip from current frame to start or end (both reach ~360°)
-apply normal or reverse play on the subclip with a playtime of 1 second.

you may still miss a smooth change of direction when object return to 360°
because it’s not fading from the main clip anymore