-
Notifications
You must be signed in to change notification settings - Fork 423
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
Feature/mesh validator #929
Conversation
ousttrue
commented
May 6, 2021
- Materials.Length==0 または Materials.Contains(null) の場合は、メッセージを表示して、エクスポートボタンを押せないようにする #919 の実装
- gltf, vrm0, vrm1 で共有
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
UNKNOWN_SHADER, | ||
} | ||
|
||
public IEnumerable<Validation> Validate(GameObject ExportRoot) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👁️
if (info.Renderer.sharedMaterials.Length < info.Mesh.subMeshCount) | ||
{ | ||
// すべての submesh に material が割り当てられていない | ||
yield return Validation.Error(Messages.DIFFERENT_MATERIAL_COUNT.Msg()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
else if (info.Renderer.sharedMaterials.Length > info.Mesh.subMeshCount) | ||
{ | ||
// 未使用の material がある | ||
yield return Validation.Warning(Messages.DIFFERENT_MATERIAL_COUNT.Msg()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Unity の挙動としては正確には
「末尾の submesh を利用した重複描画の material がある」
とかかな
else if (info.Renderer.sharedMaterials.Any(x => x == null)) | ||
{ | ||
// material に null が含まれる(unity で magenta になっているはず) | ||
yield return Validation.Error($"{info.Renderer}: {Messages.MATERIALS_CONTAINS_NULL.Msg()}"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍