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

メッシュが無いオブジェクトに対する MeshExportValidator のテストを追加 #980

Merged

Conversation

oocytanb
Copy link
Contributor

MeshExportValidator のテストケースを追加しました。

以下のオブジェクトを Validator に渡すと NullReferenceException が発生します。

  • MeshFilter 無し、マテリアル有り
  • MeshFilter のメッシュが null、マテリアル有り

Validator は、例外を発生させることなく、適切な結果を返すことを期待します。

NullReferenceException: Object reference not set to an instance of an object

UniGLTF.MeshExportValidator.CalcMeshSize (UniGLTF.MeshExportInfo& info, System.String relativePath) (at Assets/UniGLTF/Editor/UniGLTF/ExportDialog/MeshExportValidator.cs:47)
UniGLTF.MeshExportValidator.TryGetMeshInfo (UnityEngine.GameObject root, UnityEngine.Renderer renderer, UniGLTF.MeshExportInfo& info) (at Assets/UniGLTF/Editor/UniGLTF/ExportDialog/MeshExportValidator.cs:156)
UniGLTF.MeshExportValidator.SetRoot (UnityEngine.GameObject ExportRoot, UniGLTF.MeshExportSettings settings) (at Assets/UniGLTF/Editor/UniGLTF/ExportDialog/MeshExportValidator.cs:172)

追記:
このテストケースでは、Validator はエクスポート可の結果を返すものとしています。
もし、エクスポート不可とすべきであれば、適切に修正されてください。

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.

TODO: Mesh の Export候補の列挙から除外して、Exception が飛ばないようにする

@ousttrue ousttrue merged commit 7382b3d into vrm-c:master May 26, 2021
@oocytanb oocytanb deleted the fix/add_tests_for_validating_null_mesh branch May 26, 2021 10:50
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

Successfully merging this pull request may close these issues.

2 participants