Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compatibiltiy with skeletal-animation-system? #26

Open
kevzettler opened this issue Dec 22, 2021 · 3 comments
Open

compatibiltiy with skeletal-animation-system? #26

kevzettler opened this issue Dec 22, 2021 · 3 comments

Comments

@kevzettler
Copy link
Contributor

kevzettler commented Dec 22, 2021

Hi @chinedufn I haven't looked very deeply but it seems the armature export structure is quite different from what I have in an older project that is using skeletal-animation-system The obvious thing I've noticed is the old JSON has fields for "frame_time_secs": 0.625 and skeletal-animation-system expects keyframes indexed by time. I'm not seeing any reference to animation time in the landon output. I know at one point landon was returning this frame_time field as I have an old pipeline that was parsing and acting on it.

@chinedufn
Copy link
Owner

chinedufn commented Dec 29, 2021

Ah yeah.

My skeletal animation needs have gotten much more complex since I wrote that skeletal-animation-system library, I've since written a much more robust skeletal animation library (currently closed source).

i.e. it supports things like additive blending https://devjournal.akigi.com/december-2020/098-2020-12-20.html


Ultimately it all stems from the same Blender keyframe data so you should be able to massage it back into the old format.

i.e. IIRC the new output has frame numbers and a framerate, so to get that frame_time_secs you can just divide the frame number by the framerate.

Let me know if you have any trouble with this! I'm more than happy to hop on a call to help get you up and running.

@kevzettler
Copy link
Contributor Author

Thanks @chinedufn

i.e. IIRC the new output has frame numbers and a framerate, so to get that frame_time_secs you can just divide the frame number by the framerate.

I'm not seeing framerate in the output.

image

I do see frame_range_inclusive. is that related?

@chinedufn
Copy link
Owner

Ah just checked my codebase and it looks like I have the framerate hard coded to Blender's default of 24 FPS.

So yeah blender-armature doesn't currently export the framerate from Blender, sorry!

Although if you haven't touched it then yours should also be 24.

So frame_time_secs = (frame_range_inclusive.1 - frame_range_inclusive.0) / 24.0

frame_range_inclusive is just the start and end frame of the action.

So if an action starts on frame 10 and ends on frame 34, it's frame range is [10, 34] and it's frame_time_secs would be 1 second.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants