feat(paint): QML falloff slider + vertex color preview toggle - #350
feat(paint): QML falloff slider + vertex color preview toggle#350fernandotonon wants to merge 12 commits into
Conversation
Assimp-based exports now emit vertex colors from VES_DIFFUSE and FBX exports write LayerElementColor. Also load exported .material sidecars when reimporting .mesh so material names don't fall back to BaseWhite. Made-with: Cursor
Deferred GPU upload from vertex painting could leave Ogre buffers stale when export ran in the same frame. Sync EditableMesh colors to the entity before reading geometry for Assimp and FBX paths (including scene glTF export). Made-with: Cursor
…x colors - Sidecar material test: destroy export entity, release material handle, remove from MaterialManager when still loaded so reimport must parse .material. - FBX vertex color test: assert ByPolygonVertex Colors array length and RGBA order after reversed winding (v0 red, v2 blue, v1 green). - exportCurrentPose: copy VES_DIFFUSE from bind-pose buffers like UVs. - Shorten flushPendingVertexPaintForEntity doc comment. Made-with: Cursor
ensureResourceGroup initialises the mesh folder before tryLoadSidecarMaterialScript; a second initialiseResourceGroup is a no-op, so materials from the in-memory parse never reached a loaded state and mesh import fell back to BaseWhite. Made-with: Cursor
- Use mutable QByteArray and read-only MemoryDataStream instead of (void*)constData() (const-correctness / Sonar). - Extract loadUnloadedOgreMaterialsInGroup to keep tryLoadSidecarMaterialScript simpler. - Keep explicit load of UNLOADED materials in the mesh folder group so .mesh reimport resolves sidecar materials after parseScript. Made-with: Cursor
…aterials - Resolve sidecar as completeBaseName.material so model.v2.mesh finds model.v2.material. - After parseScript, load only materials declared on Ogre material script lines (prefix material + name); remove loadResourceGroup and full-group material iteration so unrelated broken scripts cannot fail import. - FBX vertex-color test: unique mesh/node names, ASSERT_NE(objects). - EditModeController: file.export Sentry breadcrumb in flushPendingVertexPaintForEntity; expand flush API doc comment (CodeRabbit docstring / observability). Made-with: Cursor
- Run loadResourceGroup immediately after parseScript (matches CI-passing flow). - Keep declared-name loads, then sweep only UNLOADED materials in the mesh folder group. - Removes try/catch that could mask load failures; declared-name trim/load unchanged. Made-with: Cursor
- loadMaterialsDeclaredInOgreMaterialScript returns whether any declared material exists in the mesh folder group after disk init - Run memory parseScript only when none were found (avoids duplicate- material exceptions that skipped loadResourceGroup and left BaseWhite) - Keep unload sweep after each load path Made-with: Cursor
MeshSerializer writes SubMesh::getMaterialName(); SubEntity::setMaterial does not update the mesh asset. Without this the exported .mesh did not reference SidecarMaterial and reimport always resolved to BaseWhite. Made-with: Cursor
- Add Vertex Paint section to QML Edit Mode Tools with radius/strength/falloff - Expose brush falloff parameter and apply it in distance weighting - Add per-entity vertex color preview material override toggle Made-with: Cursor
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (8)
✨ 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. Review rate limit: 0/1 reviews remaining, refill in 49 minutes.Comment |
|
Closing in favor of #351 (clean branch off master with only paint UI changes). |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 13f3e19233
ℹ️ 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".
| if (m_vertexColorPreviewEnabled) | ||
| applyVertexColorPreviewMaterials(); |
There was a problem hiding this comment.
Preserve original preview snapshot when toggling wireframe
When m_vertexColorPreviewEnabled is already true, this call re-enters applyVertexColorPreviewMaterials(), which clears m_vertexColorPreviewSavedMaterials and re-snapshots whatever override is currently applied. In the sequence “enable preview → toggle wireframe → disable preview”, the saved map is overwritten with preview/wireframe materials instead of the original sub-entity materials, so turning preview off no longer restores the true originals (and can leave the preview material stuck after exiting edit mode).
Useful? React with 👍 / 👎.
Summary
Closes #315.
Test plan
UnitTestsand runEditModeControllerGeometry.ApplyVertexColorBrushAffectsVerticesWithinRadius.Made with Cursor