quads chunk 3: importer quad detection (re-targeted) - #331
Conversation
Adds the n-gon-aware re-import path discussed on #326. The existing AssimpToOgreImporter pipeline is untouched; this chunk only: 1. Caches the source file path on the imported Ogre::Mesh via UserObjectBindings("qtme.source_path"). MeshImporterExporter attaches it after every Assimp-backed import. 2. Adds EditableMesh::loadFromAssimpFile(path) which spins up an independent Assimp::Importer with aiProcess_Triangulate deliberately OFF, so source quads survive into aiMesh::mFaces and get recorded as EditableFace entries. Vertex attributes (positions/normals/UVs/colors/bone weights) are read out of the same scene; skeleton, animation, material, and tangent processing are skipped — Edit Mode operates on geometry only. Notes & deferred work: - Not yet wired into EditModeController::enterEditMode. Doing so safely needs a "user has modified this mesh" flag so re-importing doesn't discard prior edits — that's a follow-up chunk. - Re-import cost (~10–100ms typical, more on huge FBX) is acceptable as a one-time Tab-into-Edit-Mode cost. Tests (+6, standalone): - empty path / missing file rejected - OBJ quad → 1 EditableFace (4 verts), 2 fan triangles - triangle-only OBJ leaves `faces` empty (chunk-1 invariant) - mixed tri+quad OBJ produces both face types - non-empty mesh is replaced 197 standalone tests green (was 191; +6). Towards #326. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|



Summary
Chunk 3 of the quad migration (#326). Re-opening from #329 because that PR auto-closed when its base branch (
feat/quads-2-gpu-upload) was deleted on chunk 2's merge.Same content as the (now-closed) #329 — fully green CI on the previous run. No code changes since.
Changes
MeshImporterExporter::importercaches the source file path on the importedOgre::MeshviaUserObjectBindings("qtme.source_path").EditableMesh::loadFromAssimpFile(path)re-imports through Assimp withaiProcess_Triangulatedeliberately OFF, recording source quads asEditableFaceentries.Deliberately NOT done in this chunk
EditModeController::enterEditModeis NOT yet wired to use this path. Doing so safely needs a "user has modified this mesh" flag — that's chunk 4. This chunk only adds the new code path without changing any existing flows. Net user-visible behavior: zero change.Tests (+6 standalone)
EditableFace(4 verts) + 2 fan triangles.facesempty (chunk-1 invariant).EditableMeshis replaced.OBJs written via
QFiletoQDir::tempPath()and removed after each test.Closes
Re-opens #329 (auto-closed due to base-branch deletion). Towards #326.
🤖 Generated with Claude Code