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

特定のVRM1 BetaモデルインポートでNullReferenceExceptionが発生 #1692

Closed
saturday06 opened this issue Jun 11, 2022 · 2 comments · Fixed by #1715
Closed

特定のVRM1 BetaモデルインポートでNullReferenceExceptionが発生 #1692

saturday06 opened this issue Jun 11, 2022 · 2 comments · Fixed by #1715
Labels
1.0 bug Something isn't working importer
Milestone

Comments

@saturday06
Copy link
Contributor

環境情報

  • UniVRM version: 0.99.0
  • Unity version: Unity-2021.3.4f1
  • OS: Windows 11 Pro 21H2 22000.675

バグについて

  • バグの内容

添付したVRM1 Betaの再現ファイルAssets フォルダ以下に配置すると UniVRM10.MeshImporterDivided.UpdateVerticesAndBindPose() でNullReferenceExceptionが発生して処理が中断します。

  • 再現ファイルをglTF Validatorにかけたところエラーは発生していませんでした。
  • 拡張子を.glbに変更して Assets フォルダに配置すると正常にインポートが完了しました。
  • ConsoleLog
NullReferenceException: Object reference not set to an instance of an object
UniVRM10.MeshImporterDivided.UpdateVerticesAndBindPose (VrmLib.MeshGroup meshGroup, System.Int32 vertexCount, UnityEngine.Mesh resultMesh) (at Library/PackageCache/com.vrmc.vrm@f9ee070a7b/Runtime/IO/Model/MeshImporterDivided.cs:259)
UniVRM10.MeshImporterDivided.LoadDivided (VrmLib.MeshGroup meshGroup) (at Library/PackageCache/com.vrmc.vrm@f9ee070a7b/Runtime/IO/Model/MeshImporterDivided.cs:27)
UniVRM10.Vrm10Importer.LoadGeometryAsync (VRMShaders.IAwaitCaller awaitCaller, System.Func`2[T,TResult] MeasureTime) (at Library/PackageCache/com.vrmc.vrm@f9ee070a7b/Runtime/IO/Vrm10Importer.cs:196)
UniGLTF.ImporterContext.LoadAsync (VRMShaders.IAwaitCaller awaitCaller, System.Func`2[T,TResult] MeasureTime) (at Library/PackageCache/com.vrmc.gltf@f9ee070a7b/Runtime/UniGLTF/IO/ImporterContext.cs:114)
UniVRM10.Vrm10Importer.LoadAsync (VRMShaders.IAwaitCaller awaitCaller, System.Func`2[T,TResult] MeasureTime) (at Library/PackageCache/com.vrmc.vrm@f9ee070a7b/Runtime/IO/Vrm10Importer.cs:163)
Rethrow as AggregateException: One or more errors occurred. (Object reference not set to an instance of an object)
Rethrow as AggregateException: One or more errors occurred. (One or more errors occurred. (Object reference not set to an instance of an object))
UniGLTF.ImporterContextExtensions.Load (UniGLTF.ImporterContext self) (at Library/PackageCache/com.vrmc.gltf@f9ee070a7b/Runtime/UniGLTF/IO/ImporterContextExtensions.cs:29)
UniVRM10.VrmScriptedImporterImpl.Process (UniVRM10.Vrm10Data result, UnityEditor.AssetImporters.ScriptedImporter scriptedImporter, UnityEditor.AssetImporters.AssetImportContext context, UniGLTF.RenderPipelineTypes renderPipeline, System.Boolean doNormalize) (at Library/PackageCache/com.vrmc.vrm@f9ee070a7b/Editor/ScriptedImporter/VrmScriptedImporterImpl.cs:53)
UniVRM10.VrmScriptedImporterImpl.Import (UnityEditor.AssetImporters.ScriptedImporter scriptedImporter, UnityEditor.AssetImporters.AssetImportContext context, System.Boolean doMigrate, UniGLTF.RenderPipelineTypes renderPipeline, System.Boolean doNormalize) (at Library/PackageCache/com.vrmc.vrm@f9ee070a7b/Editor/ScriptedImporter/VrmScriptedImporterImpl.cs:89)
UniVRM10.VrmScriptedImporter.OnImportAsset (UnityEditor.AssetImporters.AssetImportContext ctx) (at Library/PackageCache/com.vrmc.vrm@f9ee070a7b/Editor/ScriptedImporter/VrmScriptedImporter.cs:25)
UnityEditor.AssetImporters.ScriptedImporter.GenerateAssetData (UnityEditor.AssetImporters.AssetImportContext ctx) (at <36f62d8e760b48f7af5d32916f997ce1>:0)
  • スクリーンショット

再現ファイルの拡張子を .glb に変更し、 Assets フォルダにコピーするとエラー無くPrefabが作成されます。そのPrefabをシーンに追加した状態のスクリーンショットです。正常に動作した場合もこのスクリーンショットのようになることを期待します。

glTF 2.0サンプルモデルのBuggy.glbにVRM1エクステンションとヒューマンボーンを追加したモデルになります。

  • 再現方法
    (バグ内容に記載)

  • エラーの発生するファイル(ここに貼り付けても差し支えの無いもの)
    Buggy.zip

@saturday06 saturday06 added the bug Something isn't working label Jun 11, 2022
@ousttrue
Copy link
Contributor

修正します。

@ousttrue
Copy link
Contributor

v0.101

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

Successfully merging a pull request may close this issue.

2 participants