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

VRM0.xでMeshAnnotationsのmeshに-1が指定されていると一人称メッシュ作成時にNotImplementedExceptionが発生する問題を回避する #2214

Merged
merged 1 commit into from
Jan 9, 2024

Conversation

tsgcpp
Copy link
Contributor

@tsgcpp tsgcpp commented Jan 5, 2024

環境情報

  • UniVRM version: v0.116.0
  • Unity version: Unity-2021.3.27f1
  • OS: Windows 10

概要

MeshAnnotationのmeshに-1が指定されているとNotImplementedExceptionが発生することを確認したため、その問題を回避案を提出させていただきます。

問題の流れは以下です。

  • Migration時にmeshAnnotationsのmeshに-1が指定されているVRM0.xをロードする
  • glTFNode.nodeの初期値 -1 と一致してしまいMeshがあるNodeとして扱われる
  • Meshが存在しないNodeにMeshAnnotationsを設定しようとして ここに入り、NotImplementedException が発生する
        "meshAnnotations": [
          {
            "firstPersonFlag": "Auto",
            "mesh": 0
          },
          {
            "firstPersonFlag": "Auto",
            "mesh": -1
          },
          {
            "firstPersonFlag": "Auto",
            "mesh": 2
          }
        ]

UniVRM以外のツールでVRM0.xで上記のようなVRMが作られる場合が有るようでした。

問題の再現方法

対応案

  • meshAnnotationsのmeshに0未満が指定されていた場合は処理しない

@vrm-github-bot
Copy link
Collaborator

Can one of the admins verify this patch?

Copy link
Contributor

@ousttrue ousttrue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ありがとうございます。

json シリアライズの index 参照は int? 型にすればよかったと反省しています。
開発初期に使用した UnityEngine.JsonUtility は使える型が限られている、という事情もありました。

@ousttrue ousttrue merged commit 2c55dc9 into vrm-c:master Jan 9, 2024
@ousttrue ousttrue added the LookAt/FirstPerson create headless model for VR label Jan 9, 2024
@tsgcpp tsgcpp deleted the feature/ignore_invalid_mesh_indices branch January 11, 2024 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LookAt/FirstPerson create headless model for VR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants