How to apply a global axis rotation to an animated object hierarchy

I want to add an export option to the Collada exporter for changing the global orientation of the scene. The goal is to export the data as if it where rotated. This is important for certain target engines where a certain global orientation is mandatory. I have figured out how to do this correct for object hierarchies and armatures.

However when it comes to Animations i just can’t get it right. Here is an example for what i try to achieve:
This is the first frame of an animation for 3 Suzannes (the circles indicate the movement of the objects in space):

Now i want to rotate the entire scene from Blender’s default orientation (Forward Y, Up Z) to another global orientation (in this example i transform to (Forwad -X, Up Z) by rotating the mesh data of all Suzannes (Bake the global transformation into the objects).

While this solves the orientation for the static objects, the animations still work as before, so the first frame of the animation now looks like this:

And the objects still move along the circles as before. So i have to somehow “rotate the animations” so that the object move along the circles again:

Since i am exporting and not actually modifying the scene at all, my first thought was to just apply the global orientation to the local object matrix before exporting a frame. But this does not work as it also rotates the entire object.

There must be a solution to this, i just do not see it :frowning:
What am i missing ?