Skip to content

Add MeshLabArtifactValidator to detect bad external MeshLab settings - #109

Merged
SashaRX merged 2 commits into
claude/bake-ao-single-hierarchy-27AwSfrom
claude/fix-meshlab-artifacts-clHBb
May 2, 2026
Merged

Add MeshLabArtifactValidator to detect bad external MeshLab settings#109
SashaRX merged 2 commits into
claude/bake-ao-single-hierarchy-27AwSfrom
claude/fix-meshlab-artifacts-clHBb

Conversation

@SashaRX

@SashaRX SashaRX commented May 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • Added MeshLabArtifactValidator — a read-only mesh inspection tool that detects three common symptoms of bad external MeshLab export settings: collapsed UV seams (from Merge Close Vertices), recalculated normals (UseExistingNormals OFF), and broken UV1 parameterization (Flat Plane / wiped channels).
  • Integrated validator into Editor menu (Tools → Mesh Lab → Validators → Check Imported MeshLab Artifacts) with support for selecting GameObjects, Mesh assets, and FBX files.
  • Added comprehensive documentation in EXPERIMENTS.md covering MeshLab filters to avoid, required FBX export settings, symptom descriptions, and verification workflow.
  • Fixed mesh naming in LightmapTransferTool.ExportFbx() to ensure exported meshes retain their canonical names instead of falling back to "Scene" on reimport.

Changed Zones

  • Editor/ — Editor tools / UI
  • Docs (EXPERIMENTS.md)

Checklist

  • .meta files present for all new files/directories
  • No Editor ↔ Runtime dependency leaks
  • Temporary meshes cleaned up (N/A — read-only inspection)

Test Plan

  1. Select a GameObject or Mesh asset in the Editor.
  2. Run Tools → Mesh Lab → Validators → Check Imported MeshLab Artifacts.
  3. Verify warnings appear in the Console for meshes with detected issues (split vertex ratio, flat-shaded triangles, degenerate UV1, etc.).
  4. Verify clean meshes log info messages without warnings.
  5. Test with FBX files exported from MeshLab with both correct and incorrect settings to confirm symptom detection.

Review Notes

  • The validator is purely read-only and does not modify meshes or assets.
  • Thresholds (e.g., 90% flat-shaded triangles, 5% degenerate UV1) are conservative to minimize false positives on legitimately flat-shaded or simple geometry.
  • The mesh name fix in LightmapTransferTool is a small but important correctness improvement that prevents all exported meshes from being named "Scene" on reimport.

https://claude.ai/code/session_01VcWmB88w3XUQMKQoDrohEp

claude added 2 commits May 2, 2026 07:27
Detects three classes of artifacts left by the desktop MeshLab tool when
processing FBX before Unity import:
- Collapsed UV seams (Merge Close / Remove Duplicate Vertices)
- Recalculated normals (UseExistingNormals OFF on FBX export)
- Broken or wiped UV1 parameterization (Flat Plane filter)

Exposed via Tools/Mesh Lab/Validators/Check Imported MeshLab Artifacts.
Operates on selected GameObject, Mesh asset, or imported FBX. Read-only;
logs through UvtLog.

EXPERIMENTS.md gets a new section listing the safe MeshLab filter and
export settings, mapped to the symptoms the validator emits.
Object.Instantiate(resultMesh) produced clones named "Original(Clone)"
which Unity FBX Exporter writes with empty/auto-generated mesh node
names; the FBX SDK then defaults the FbxMesh node to the scene name.
On reimport every mesh asset shows up as "Scene", erasing per-LOD and
per-renderer identifiers needed by sidecar lookup, scene relinking and
the new MeshLabArtifactValidator report.

Mirrors the existing fix at CopyVertexDataToClone (in-place overwrite
path): assign mesh.name = ResolveExportMeshName(...) before handing the
mesh to ExportObjects.
@SashaRX

SashaRX commented May 2, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@SashaRX
SashaRX merged commit 8f3a24c into claude/bake-ao-single-hierarchy-27AwS May 2, 2026
2 checks passed
@SashaRX
SashaRX deleted the claude/fix-meshlab-artifacts-clHBb branch July 23, 2026 12:15
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