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

How to make a 60fps MMD Camera in blender with MMD_TOOLS? #370

Open
gk2qf opened this issue Sep 15, 2021 · 4 comments
Open

How to make a 60fps MMD Camera in blender with MMD_TOOLS? #370

gk2qf opened this issue Sep 15, 2021 · 4 comments

Comments

@gk2qf
Copy link

gk2qf commented Sep 15, 2021

Almost all of MMD producers make 60FPS MMD video. [So I wonder if MMD_TOOLS can set up 60fps camera, I don't see the relevant button.] If I manually set up 60fps, the two keyframes used to switch shots will automatically interpolate, which is likely to give the wrong shot result.

【60 fps wrong result】
01 wrongresult

【60fps right result】
02 rightresult

【Example Why】
1.In 30fps mode: keyframe 172 to 173. ( camera starts at 101)
03 30 172
04 30 173

2.In 60fps mode: keyframe 172x2-1 to 173x2-1, 344 is a interpolated frame. (camera starts at 201)
Unfortunately, this interpolated frame will get the wrong result. Maybe it goes into the character's body.It's on the wrong coordinates.
05 60 172x2

3.60fps correction
07

it works well :)

I hope I have expressed the problem clearly.
So I hope this process can be automated.
My friends and I were frustrated by the complexity of the manual process. :(

@nagadomi
Copy link
Collaborator

I have reported the same problem before. If you have some programming experience, the following comments will be helpful.
#133 (comment)

This problem is basically a problem on camera motion side. The same problem also occurs on MMD.
To fix it manually, set the Interpolation Mode to Constant for the keyframe before the camera switches.

@gk2qf
Copy link
Author

gk2qf commented Sep 16, 2021

@nagadomi Thank you for that infomation! Emmmm...well, I've modified the code(importer.py) as @powroupi said, and now it works well. :)
Emmmmmmmmm, why not integrate this function into MMD_TOOLS and use a Toggle to control it(ON/OFF)? @powroupi

【Importer.py】
g2

【It works!】
g3

【60fps Mode + TimeRemapping 100 to 200】
g4

@powroupi
Copy link
Owner

The function detectCameraChange is only working for single component/channel detection, so it has some limitations and flaws. For example, the Interpolation Mode of every frame may be set to CONSTANT when importing a baked camera motion, etc.

It's better to calculate delta rotation and delta location between 2 frames to determine the Interpolation Mode in vmd/importer.py#L325-L328. But I'm not sure what formula and threshold values are better, it might be better to take all (x, y, z, rx, ry, rz, dis, fov) in to account. 😢

  if prev_kps is not None:
      if delta_rotation > 30 degrees or delta_location > 2 units * self.__scale: # something like this...
          for prev_kp, kp in zip(prev_kps, curr_kps):
              self.__setInterpolation('CONSTANT', prev_kp, kp)
      else:
          interp = k.interp
          for idx, prev_kp, kp in zip(indices, prev_kps, curr_kps):
              self.__setInterpolation(interp[idx:idx+4:2]+interp[idx+1:idx+4:2], prev_kp, kp)

@gk2qf
Copy link
Author

gk2qf commented Sep 17, 2021

@powroupi :) I see that. Baked cameras really can't use this function. And this function does need to consider many factors. But I still suggest that it be integrated into the tool as an experimental function and use a toggle to control it. It will show its limitations and flaws to the user to determine whether to use this function. How about MikuMikuDance? When I used it, I found that it had no problem outputting 60fps. It also makes interpolation correction, right?

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