Is there a way to convert script animations to animation files, or even better, FBX files?

Recently, I’ve been messing around with C# script animations. This isn’t the actual code but I think you could get an idea of what I’m trying to do.

using UnityEngine;

public Transform tr;
public float b;

void FixedUpdate() {
b = b + 0.1f;
if (b > 70) {
   b = 0;
}
   tr.transform.rotation = new Vector3(b, 0);
}

Is there any way to turn that example into an unity animation file or fbx?
I’ve tried the ab clip files but i cant seem to find a way to get them to load into anim files

I did this in unity and just want to find a way to get it into Blender somehow

Any help is appreciated!

I imagine you could have an editor script that creates AnimationClips.

If you need it over in Blender3D, might be easier to just write it in Python directly in Blender.

The thing is, I dont know how to write in Python. Plus, I’m dealing with things that are only in Unity and would be harder to make in Python, like player distance, Vector3, and things like GameObjects, other components, and it just ends up getting complicated

It’s just data. If you need it in Blender, then at some stage of the process it must go into a format that Blender can read. FBX is certainly one option.

Another option might be Alembic:

https://en.wikipedia.org/wiki/Alembic_(computer_graphics)

All of that sounds like a lot of work compared to just writing a CSV file in Unity, then learning just enough Python in Blender to suck it into an animation clip in Blender.