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

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

Closed
TheR20 opened this issue Sep 22, 2024 · 10 comments · Fixed by #2470
Closed
Labels
bug Something isn't working SpringBone

Comments

@TheR20
Copy link

TheR20 commented Sep 22, 2024

  • 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
Copy link
Author

TheR20 commented Sep 26, 2024

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!

@kuni-0930
Copy link

kuni-0930 commented Oct 3, 2024

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のどれかがワールド座標を使っているのだと思います。

@ousttrue
Copy link
Contributor

ousttrue commented Oct 15, 2024

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).

@TheR20
Copy link
Author

TheR20 commented Oct 19, 2024

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

@kuni-0930
Copy link

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.

@ousttrue
Copy link
Contributor

ousttrue commented Oct 21, 2024

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.

@kuni-0930
Copy link

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);
        }

    }

@ousttrue
Copy link
Contributor

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 ousttrue changed the title Imported VRM hair and clothes goes to the left no matter the position [0.x][springbone][center] Imported VRM hair and clothes goes to the left no matter the position Oct 22, 2024
@ousttrue
Copy link
Contributor

@kuni-0930
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working SpringBone
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants