review(pose-lib): D4 — mirror reads from stored snapshot, writes direct#598
Conversation
Codex P2 on PR #597 (merged): The mirror code rebuilt the source pose by applying it to the live skeleton then re-capturing every bone. For saved poses that only covered a subset of the current skeleton (LOD swap, partial save), that pulled live state of un-mirrored bones into the result — non-deterministic and not faithful to the saved data. ## Fix — two halves ### Read source from m_byEntity directly Member function has access to the private store. Look up the `{entity, srcName}` snapshot directly and iterate it. Only bones that were actually saved feed the mirror — matches `applyPose`'s "partial apply" contract on the read side. ### Write mirrored result directly Previously: applied mirrored snapshot to live skeleton, called `savePose`, restored live state. That was a 3-step round-trip through the public API only because the public API was the only write surface I'd given the mirror code. Now that we're inside the class anyway, write mirrored straight into `m_byEntity` plus the parallel `order` list, and emit `posesChanged` ourselves. Removes the temporary skeleton mutation entirely. Behaviour preserved on the test-visible surface — same X-flip math, same `posesChanged` signal, same insertion-order semantics. The new path is just simpler and deterministic. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe ChangesSnapshot-based pose mirroring
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~18 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
|



Codex P2 on PR #597 (merged):
The mirror code rebuilt the source pose by applying it to the live skeleton then re-capturing every bone. For saved poses that only covered a subset of the current skeleton (LOD swap, partial save), that pulled live state of un-mirrored bones into the result — non-deterministic and not faithful to the saved data.
Fix — two halves
Read source from
m_byEntitydirectlyMember function has access to the private store. Look up the
{entity, srcName}snapshot and iterate it. Only bones that were actually saved feed the mirror — matchesapplyPose's partial-apply contract on the read side.Write mirrored result directly
Previously: apply → savePose → restore (3-step round-trip through the public API). Now that we're inside the class anyway, write mirrored straight into
m_byEntity+ the parallelorderlist, and emitposesChangedourselves. Removes the temporary skeleton mutation entirely.Behaviour preserved on the test-visible surface — same X-flip math, same
posesChangedsignal, same insertion-order semantics. The new path is just simpler and deterministic.🤖 Generated with Claude Code
Summary by CodeRabbit