Repository navigation
fix(templates): apply rotation as well as scale before grounding the origin - #412
Merged
Merged
Conversation
…origin ai-mesh-cleanup and the pipeline template applied transforms only when scale was non-identity. origin_to_base() shifts geometry along local Z, so an imported glTF node with a rotation and unit scale (common) was grounded along the wrong axis and moved in world space: a cube rotated 90 deg on X at z=5 shifted -1 in Y and Z. The gate is now rot_scale_is_identity(), which checks the whole 3x3 of matrix_basis, so rotation is applied too and local Z equals world Z before grounding. origin_to_base() states the precondition and the skill explains why steps 3 and 4 must run in that order. Closes #389 Signed-off-by: TMHSDigital <154358121+TMHSDigital@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
CI evidence before merge: all checks pass ( 13 pass ). Blender Smoke on PR head: Blender 5.2.2 LTS / Blender 4.5.14 LTS. Summaries (happy path; falsifiers) per leg: 141 passed, 3 skipped, 0 failed;136 passed, 6 skipped, 0 failed;143 passed, 1 skipped, 0 failed;142 passed, 0 skipped, 0 failed; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #389.
Problem
ai-mesh-cleanupand the pipeline template applied transforms only when scale was non-identity.origin_to_base()shifts the geometry along local Z. So an imported glTF node with a rotation and unit scale, which is common, was grounded along the wrong axis and moved in world space.Change
scale_is_identity()is replaced byrot_scale_is_identity(), which checks the full 3×3 ofmatrix_basis, in both the skill and the template. Rotation is now applied too, so local Z equals world Z before grounding. The template's existing log line ("Applied object scale/rotation") is now accurate.origin_to_base()documents its precondition.Evidence
Proven by live run (
--factory-startup; binaries report 5.2.1 LTS and 4.5.11 LTS). The probe imports the real template helpers; the cube is rotated 90° on X at z=5 with unit scale:rot_scale_is_identitymake_pipeline_glb.py, unity preset,--collider convex) exits 0 on both versions:evaluated_tris=2208, LOD0 = 1024.Not done: a rotated-input smoke fixture for the template. The CI fixture has no rotation, so CI exercises the new gate only on the identity path. The probe above is the rotated-case evidence.
🤖 Generated with Claude Code