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

Feature/mesh validator #929

Merged
merged 3 commits into from
May 6, 2021
Merged

Conversation

@ousttrue ousttrue requested a review from Santarh May 6, 2021 11:06
Copy link
Contributor

@Santarh Santarh left a 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)
Copy link
Contributor

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());
Copy link
Contributor

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());
Copy link
Contributor

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()}");
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@ousttrue ousttrue merged commit 42b7a9b into vrm-c:master May 6, 2021
@ousttrue ousttrue deleted the feature/mesh_validator branch May 17, 2021 05:21
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