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

mesh.vertices = 0 の場合にmeshとmaterialをexportしないように修正 #918

Merged
merged 1 commit into from
Apr 28, 2021

Conversation

hiroj
Copy link
Contributor

@hiroj hiroj commented Apr 28, 2021

概要

内容

  • mesh.verticesを見て0の場合はmeshを出力しないように変更
  • TMPの場合はmesh.vertices = 0になっているためこの方法で防御
  • TMPコンポーネントがGameObjectに存在しているか判定する方法だとTMP依存になってしまうため、いったんこの方法を取った。

@hiroj hiroj requested a review from ousttrue April 28, 2021 04:41
else if(mesh != null && !mesh.vertices.Any())
{
// 頂点データが無い場合
node.mesh = -1;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

-1で良いかどうか

Copy link
Contributor

Choose a reason for hiding this comment

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

glTFNode.mesh が int? になっているのがよいのだけど、現状 int で、-1 を無効な値のマジックナンバーとして運用しているので OK です。

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.

👍

else if(mesh != null && !mesh.vertices.Any())
{
// 頂点データが無い場合
node.mesh = -1;
Copy link
Contributor

Choose a reason for hiding this comment

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

glTFNode.mesh が int? になっているのがよいのだけど、現状 int で、-1 を無効な値のマジックナンバーとして運用しているので OK です。

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