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

v0.119.0での正規化の処理順が逆な気がする #2244

Open
FujiSunflower opened this issue Feb 9, 2024 · 1 comment
Open

v0.119.0での正規化の処理順が逆な気がする #2244

FujiSunflower opened this issue Feb 9, 2024 · 1 comment

Comments

@FujiSunflower
Copy link
Contributor

FujiSunflower commented Feb 9, 2024

該当箇所

正規化処理後の頂点座標を入れたあとに、処理前の相対座標を計算しようとしている


vertices[j] = m.MultiplyPoint(vertices[j] - meshVertices[j]);

提案

ブレンドシェイプを先に格納してみる

            //
            // BlendShapes
            //
            {
                // var m = src.localToWorldMatrix; // include scaling
                // m.SetColumn(3, new Vector4(0, 0, 0, 1)); // no translation
                var m = Matrix4x4.TRS(Vector3.zero, src.transform.rotation, Vector3.one); // The mesh will scale by the GameObject
                CopyBlendShapes(src, srcMesh, mesh, m);
            }
            {
                // apply SkinnedMesh.transform rotation
                var m = Matrix4x4.TRS(Vector3.zero, src.transform.rotation, Vector3.one);
                mesh.ApplyMatrix(m);
            }

補足

メッシュ変更後のバウンディングボックスの再計算がされていなかったので、色々試したところUpdate When Offscreenを有効にして再計算を行うと良さそうでした。

@Iruyan-Zak
Copy link

Iruyan-Zak commented Feb 27, 2024

上記の提案を手元のUnityで試したところ、表情変化(ブレンドシェイプ)によって変形するメッシュが顔から大きく飛び出してしまう問題が解決しました!ありがとうございます!

v0.119で発生していたまばたきする際に顔のメッシュが大きく飛び出す例
image

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