Skip to content

Collision at the root (sidecar): place nodes whatever Read/Write is - #397

Merged
SashaRX merged 2 commits into
mainfrom
fix/sidecar-placement-readable
Nov 4, 2026
Merged

SashaRX merged 2 commits into
mainfrom
fix/sidecar-placement-readable

Conversation

@SashaRX

@SashaRX SashaRX commented Nov 4, 2026

Copy link
Copy Markdown
Owner

The main coverage run after #396 ended at 1631 passed, 2 failed. This PR fixes both.

Place Collision at Root (Sidecar) did nothing on a model with Read/Write off

The test log #396 now prints showed the cause:

'Seat_COL' has 'Seat_COL' unreadable; the sidecar does not place it at the root
0 collision node(s) placed at the root's placement by the sidecar

  • Cause:
    • Inside OnPostprocessModel, a mesh's isReadable follows the model's Read/Write setting, and Read/Write is off by default.
    • So every import refused the listed nodes, and PlaceInSidecar then dropped them from the sidecar.
    • Unity lets the import change a mesh whatever that setting; Uv2AssetPostprocessor already relies on this when it rebuilds meshes.
  • Fix:
    • MeshTransform.BakeMatrix takes an importing flag that skips the readability guard.
    • CollisionRootPlacement.ApplyOnImport passes that flag and no longer refuses an unreadable mesh.
  • Refactor: BakeMatrix is split into its normals, tangents and winding parts. Behaviour is the same, and its cognitive complexity drops below Sonar's limit; the S3776 it carried before is gone.

ToolAssetSaveTests.ModelReplacementInvalidatesOnlyUvSidecarBeforeFailingFirstImport

  • Cause: a regression in the test from Prepare: fix the Unity tests that failed in the main coverage run #396. The test put a default ToolSettings into the sidecar directly, and since ToolSettings.saved that counts as no settings. The UV reset then deleted the sidecar, which was empty, and the test's import hook hit a null sidecar.
  • Fix: the test now marks the settings saved, as SidecarStore.SaveSettings does.

Checks

  • python3 Tools~/compile_check.py: 0 errors with and without LIGHTMAP_UV_TOOL_FBX_EXPORTER.
  • Local SonarAnalyzer.CSharp: no findings on the changed lines.
  • Unity tests run only on main. The rest of PlaceInSidecar… (instance, unpacked copy, clear) runs for the first time once the node is placed; the coverage script prints its log if anything there fails.

Generated by Claude Code

Every import refused the listed nodes as "unreadable" on a model whose
Read/Write is off (Unity's default), and PlaceInSidecar then dropped them
from the sidecar. In OnPostprocessModel a mesh's isReadable follows that
setting, yet Unity lets the import change the mesh: BakeMatrix takes an
`importing` flag that skips the readability guard, and ApplyOnImport no
longer refuses an unreadable mesh.

BakeMatrix is split into its normals, tangents and winding parts (same
behaviour), bringing its cognitive complexity under Sonar's limit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9SukSbP376zkY7oEgVTpH
ModelReplacementInvalidatesOnlyUvSidecarBeforeFailingFirstImport set a
default ToolSettings directly, which since ToolSettings.saved counts as
no settings: the UV reset deleted the then empty sidecar and the test's
import hook hit a null sidecar. It now marks them saved.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9SukSbP376zkY7oEgVTpH
@coderabbitai

coderabbitai Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab.

Next included review available in 1 minute.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 109 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0370ed4f-f4cc-4efb-8fe2-06605a03b1d4
Commits

Reviewing files that changed from the base of the PR and between 3cd4b7f and cf0e794.

Files selected for processing: 4
  • CHANGELOG.md
  • Editor/Mesh/CollisionRootPlacement.cs
  • Editor/Mesh/MeshTransform.cs
  • Tests/Editor/ToolAssetSaveTests.cs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-04T00:12:48.054501Z cf0e794 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@SashaRX
SashaRX merged commit c24850b into main Nov 4, 2026
16 checks passed

@graphify-labs graphify-labs Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Graphify reviewed this change.

No issues found by static checks — no coupling regressions or blocking issues in the code graph. That is not the same as safe to merge: see what was not checked.

Not checked: tests were not run; no formal proof of the changed code.


Graphify review — findings

Fixes Place Collision at Root (Sidecar) on models with Read/Write off (Unity's default): the import no longer refuses the listed nodes as "unreadable" and drops them from the sidecar. The UnreadableMesh check is gone, and placement now bakes with a new importing: true flag on MeshTransform.BakeMatrix, which skips the isReadable guard because Unity allows mesh changes inside OnPostprocessModel regardless of that setting. Outside an import, BakeMatrix still returns early on unreadable meshes. Also splits BakeMatrix into BakeNormals, BakeTangents and FlipWinding helpers without changing the transform math, and adjusts a sidecar save test to set saved = true on its ToolSettings, matching what SaveSettings leaves. A changelog entry covers the fix.

No blocking issues surfaced. 1 lower-confidence candidate did not survive cross-model review.

Analysis details — impact, health, verification

Impact & health

Graphify review

Impact — 364 functions depend on the 239 functions this change touches.

Health — grade B; 10 existing hotspot(s) in the area this change touches (pre-existing, not introduced here):

  • Source() — 22 callers, 5 callees (high)
  • ExportBench() — 9 callers, 3 callees (medium)
  • ExportDocumentGroups() — 1 callers, 25 callees (high)
  • ExportHierarchyGroupPrepared() — 1 callers, 17 callees (high)
  • PrepareExportHierarchy() — 1 callers, 16 callees (high)
  • ExportFile() — 2 callers, 6 callees (medium)
  • ExportOffsetBench() — 3 callers, 4 callees (medium)
  • SidecarRetainsSharedMeshInstancesAndRebuildUsesEachHierarchyFrame() — 0 callers, 18 callees (high)
  • …and 2 more

Verification — 364 functions in the blast radius were not formally verified this run (proofs are advisory here).

Gate & verification

graphify gate

PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.

Advisory (not blocking):

  • verification_scope: 321 function(s) in the blast radius were not formally verified this run

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