Skip to content

Write Wavefront materials alongside OBJ files - #281

Merged
mahach666 merged 1 commit into
mainfrom
codex/issue-93-obj-materials
Nov 20, 2026
Merged

mahach666 merged 1 commit into
mainfrom
codex/issue-93-obj-materials

Conversation

@mahach666

Copy link
Copy Markdown
Collaborator

Refs #93.

Path-based OBJ export now writes a sibling material library for document and assembly saves, including async document saves. Materials come from the meshes themselves, and each distinct material writes diffuse RGB and opacity. The OBJ references the library and assigns materials before the corresponding primitives. Stream and text-writer exports still produce standalone geometry.

Both files are staged before publication. The material library is restored if replacing the OBJ fails. Concurrent NwcIO saves serialize preparation and publication so the final OBJ and MTL come from the same export.

Acceptance criteria

  • The CHANGELOG documents flat OBJ materials and marks texture support as pending.
  • Path exports write the sibling MTL with Kd and d, plus mtllib and usemtl in the OBJ.
  • In-memory tests verify sync, async and assembly path exports, shared materials, meshes without a material, and a filename containing spaces.
  • Follow-up in OBJ export writes no materials (.mtl) despite CHANGELOG claim; no texture/UV support in OBJ or GLB #93 covers decoding UVs and texture references, emitting them in OBJ/MTL and GLB, and documenting the source format.

Verification

The Release build, format verification and native-only build passed. On each of .NET 8 and .NET 10, 1,509 tests passed and 12 fixture tests were skipped. Tests cover cancellation, rollback and concurrent saves. A separate Windows stress run completed 2,000 concurrent save operations with matching geometry and material output.

@mahach666
mahach666 merged commit 9407f09 into main Nov 20, 2026
5 checks passed
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.

1 participant