UniVRM icon indicating copy to clipboard operation
UniVRM copied to clipboard

[0.x][springbone][center] Imported VRM hair and clothes goes to the left no matter the position

Open TheR20 opened this issue 1 year ago • 8 comments

  • UniVRM version: 0.126.0
  • Unity version: Unity-2022.3.17
  • OS: Windows 10

Minimum steps to reproduce

0.126.0 ~

  • vrm-0.x that has center ( vroid model has center )
  • move vrm-0.x from origin( move center from origin )

Describe the bug

  • Using Vroid Studio 1.29.2 from Steam I create a character vertion VRM0.0 and update it using UniVRM, but all the models imported do the same
  • The hair and clothes goes to the left no matter where the character is looking once I start the game in Unity

image with the game off they looks good image

And sprint bones looks like this image

Here is the VRM character if you would like to test, maybe is the character but I have tried it in 2 different projects and always does the same. https://drive.google.com/file/d/1TlG2lNjFKh0vNnVsZu9cukKcWMTk0Tg2/view?usp=drive_link

One solution I found is in the file secondary inside the model every part of the model have hit radious as 0 and drag force as 1, the movement could be a little strange with some animations but it works till the new release :D

image

TheR20 avatar Sep 22 '24 09:09 TheR20

I add a solution to this problem, that is change the values manual, if someone is having the same problem with the vertion 0.126 will help :D

Regards!

TheR20 avatar Sep 26 '24 22:09 TheR20

It's not fixed in v0.127.0 either. What I have found is that SpringBone goes wrong if I load an avatar and then use SetParent on a parent object that is not the origin to make the avatar a child. If the parent object was at the origin, it may work properly.

スクリーンショット 2024-10-03 120714

Set avatars as GameObject children. If you move the position of the GameObject, SpringBone will go wrong. If you look at the direction SpringBone's Gizmo is facing, it points to where the avatar would be if it were at the origin. So I think one of the transforms in SpringBone is using world coordinates.

GameObjectの子供にアバターをセットします。 GameObjectの位置を動かすとSpringBoneがおかしくなります。 SpringBoneのGizmoの向いている方向を見ると、アバターが原点にいた場合の位置を指しています。 つまりSpringBoneの中にあるtransformのどれかがワールド座標を使っているのだと思います。

kuni-0930 avatar Oct 03 '24 02:10 kuni-0930

SpringBone has been cleaned up, so please try it with ~~v0.128~~ v0.127.1 or later. If it doesn't work, Please let us know which springbone (vrm0.x, vrm0.x-fast or vrm1.0).

ousttrue avatar Oct 15 '24 04:10 ousttrue

Hello I test the version v0.127.1 with a vrm0.x, and its working the same way

TheR20 avatar Oct 19 '24 05:10 TheR20

SpringBone has been cleaned up, so please try it with ~v0.128~ v0.127.1 or later. If it doesn't work, Please let us know which springbone (vrm0.x, vrm0.x-fast or vrm1.0).

I tried it myself, but v0.127.1 did not fix the problem.

kuni-0930 avatar Oct 19 '24 13:10 kuni-0930

Please tell me the steps to initialize SpringBone. Which of the following four?

  • 0.x runtime load
  • 0.x Scene placement start
  • 1.0 runtime load
  • 1.0 Start scene placement

I think runtime load has been resolved. If scene placement, I will add a solution when the model is not facing forward at the origin.

ousttrue avatar Oct 21 '24 14:10 ousttrue

Please tell me the steps to initialize SpringBone. Which of the following four?

  • 0.x runtime load
  • 0.x Scene placement start
  • 1.0 runtime load
  • 1.0 Start scene placement

I think runtime load has been resolved. If scene placement, I will add a solution when the model is not facing forward at the origin.

[0.x runtime load] It can also be reproduced in UniVRM_Samples-0.127.1_0214.

  1. Place a GameObject on the Scene and play it. GameObject should have rotation.y set to 180 (it does not have to be the origin).
  2. Make the runtime loaded model a child of the GameObject with SetParent. Then SpringBone will behave incorrectly.

    public class VRMRuntimeExporter : MonoBehaviour
    {
        [SerializeField]
        public GameObject obj;

        async void Load()
        {
            /*
            // omission
            */
            m_model = loaded.gameObject;
            m_model.transform.SetParent(obj.transform, false);
        }

    }

kuni-0930 avatar Oct 21 '24 15:10 kuni-0930

I thought it was an initialization bug. It doesn't reproduce on Alicia, but it occurs on Vroid, so I investigated. It seems like a bug in center. I'll fix it.

ousttrue avatar Oct 22 '24 06:10 ousttrue

https://github.com/vrm-c/UniVRM/releases/tag/v0.127.2

fixed !.

ousttrue avatar Oct 28 '24 06:10 ousttrue

https://github.com/vrm-c/UniVRM/releases/tag/v0.127.2

fixed !.

I have checked v0.127.2 and it seems to be working properly. thank you so much.

kuni-0930 avatar Oct 30 '24 07:10 kuni-0930