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

VMD file interpolation data - What does it mean? #41

Open
Hogarth-MMD opened this issue May 7, 2015 · 4 comments
Open

VMD file interpolation data - What does it mean? #41

Hogarth-MMD opened this issue May 7, 2015 · 4 comments

Comments

@Hogarth-MMD
Copy link

VMD file interpolation data - What does it mean?

Using the Interpolation Curve in MikuMikuDance:
http://learnmmd.com/http:/learnmmd.com/using-the-interpolation-curve-in-mikumikudance/

More Motion Interpolation Curve Instruction for MMDers:
http://learnmmd.com/http:/learnmmd.com/more-motion-interpolation-curve-instruction-for-mmders/

The curve and its control points are located on a 128 X 128 grid (0-127 X 0-127) There are 2 control points for each interpolation curve. Each control point has an x co-ordinate and a y co-ordinate. Each co-ordinate is defined by a 2-byte integer. The x, y and z axes of a camera or of an ordinary rotating object each need to have a pair of control points. Therefore 24 bytes of interpolation data for a camera or for an ordinary rotating object.

Each bone has w,x,y and z values for quaternion rotation. Each bone needs to have 2 sets of quaternion values. Therefore 64 bytes of interpolation data for each bone.
Unfortunately, I have absolutely no idea why a bone would need to have 2 sets of quaternion values instead of just 1.

I am not sure if these ideas are correct, but I hope that they give a helpful clue to solving the puzzle. These ideas are just my own inductive/deductive theorizing. Sorry, but I don't have any authoritative or complete information.

@Hogarth-MMD
Copy link
Author

Or instead of a 2 bytes integer, 2 1 bytes integers, 1 for location interpolation and 1 for rotation interpolation(?). And for the quaternions, 2 of these spaces: world space, local space, object space, local space with parent(?). Sorry, my understanding of this is all a work-in-progress.

@Hogarth-MMD
Copy link
Author

In Blender, this may be similar to the MMD animation interpolation curves which are stored in a .vmd animation file:

The making of Sintel : animation lee
https://www.youtube.com/watch?v=c4sCUgM7IBU

At 7 minutes 45 seconds in this video tutorial: keyframing of animated strip time in the NLA editor allows speed of an animation to be controlled by another curve in the graph editor.

I hope that you can use this information to make a .vmd exporter for Blender! MMD is awesome. Thanks so much for your efforts! :-)

@RenaKunisaki
Copy link

Did you ever figure this out?

@alloystorm
Copy link

From what I can find from here: https://github.com/benikabocha/saba/blob/master/src/Saba/Model/MMD/VMDAnimation.cpp

It seems for bone animation not all 64 bytes are used. It only uses 4 bytes each for x, y, z and rotation. Only 16 bytes within those 64 bytes are useful.

For camera motion, all 24 bytes are used, in addition to x, y, z and rot, it also has interpolation for distance and fov. So in total 4 x 6 = 24.

cnDengyu pushed a commit to cnDengyu/blender_mmd_tools that referenced this issue Oct 31, 2023
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

3 participants