Skip to content

fix(snippets): export Y-up, meter glTF for Godot and Unreal too - #417

Merged
TMHSDigital merged 1 commit into
mainfrom
fix/gltf-engine-presets
Oct 5, 2026
Merged

TMHSDigital merged 1 commit into
mainfrom
fix/gltf-engine-presets

Conversation

@TMHSDigital

Copy link
Copy Markdown
Owner

Closes #346.

Problem

  • Godot preset: exported Z-up glTF (export_yup=False). The glTF 2.0 spec fixes +Y up and meters, and Godot is right-handed Y-up and imports glTF per the spec. So every Godot asset exported this way arrived rotated −90° about X. The skill's only justification was that matching Unity would make "the axis contract untestable".
  • Unreal glTF preset: baked 100x. Unreal's Interchange glTF importer already converts meters to centimeters (import_scale, default 100), so a baked file imports 100x too large.

Sources:

Change

  • snippets/export_preset_godot.py: export_yup=True. The header explains Godot's real per-engine lever: node-name hints such as -convcolonly.
  • snippets/export_preset_unreal.py: the glTF function drops the 100x location/scale bake and exports meters, Y-up. The FBX function (axis_forward/axis_up/global_scale=100) is unchanged.
  • skills/engine-export-presets:
    • a new "glTF is the same for every engine" section;
    • Godot and Unreal sections rewritten;
    • common mistakes 4–6 replaced: Z-up for any engine, baking 100x into Unreal glTF, using axes to express engine differences.
  • Pipeline template: export_preset() is now one spec-compliant call for every --preset, kept as the hook for engine import hints. The README drops the "Unreal mutates selected meshes" pitfall, which no longer applies.
  • examples/export-preset-axis: same mesh, checks, exit codes, falsifier and still. The second export is now named for what it is (a naive export_yup=False file, which is what any glTF engine would show), not "Godot":
    • identifiers renamed unity_*→preset_* and godot_*→zup_*;
    • the README explains the history;
    • gallery.json teaches/alt/witness text updated, gallery regenerated.
  • Text in the rule, CLAUDE.md skills table and ROADMAP line: corrected.

Evidence

Proven by live run (--factory-startup; binaries report 5.2.1 LTS and 4.5.11 LTS). Results were identical on both versions.

Run Result
Each preset snippet exports a 0.2×0.2×2 m post, re-imported (Blender's importer reads Y-up like the engines) godot / unreal / unity: span [0.2, 0.2, 2.0], standing. The old Unreal bake would give [20, 20, 200]; the old Godot preset would lie
export_preset_axis.py check exit 0. preset_reimport z=0..2.46 (standing), zup_reimport y=-2.46..0 (lying), tip_err 2.4e-07
export_preset_axis.py --same-axis (catalog falsifier) exit 9, unchanged
Pipeline template --preset godot / --preset unreal on the CI fixture exit 0 / exit 0
Render path --output --engine cycles (5.2.1) exit 0. Framing fill 0.794, margins ≥ 0.034; asset-quality gate passed; gizmo fit_err=0. The image has no text, so the committed hero is unchanged (the rename touches identifiers and gizmo object names only)

Validators: check_frontmatter, check_skill_refs, check_counts, check_import_export_rules, check_exit_code_readme, check_smoke_catalog, check_engine_id, check_render_gates and check_site_links (135 pages, 0 failures) pass. build_claude_rules --check is clean.

Generated HTML read: the card and detail alt text in docs/gallery/index.html and docs/gallery/export-preset-axis/index.html carry the new wording.

Not done: an engine-side import test (Godot or Unreal are not available here). The Unreal behaviour rests on Epic's documented import_scale default.

🤖 Generated with Claude Code

@github-actions github-actions Bot added skills rules snippets templates examples Runnable smoke-gated examples under examples/ documentation Improvements or additions to documentation labels Oct 5, 2026
The Godot preset exported Z-up glTF (export_yup=False) and the Unreal
glTF preset baked a 100x scale. Both contradict the glTF 2.0 spec (+Y up,
meters) and the engines: Godot is Y-up and imports glTF per the spec, so
every Godot asset arrived rotated -90 deg about X; Unreal's glTF importer
already converts meters to centimeters (Interchange import_scale defaults
to 100), so a baked file landed 100x too large. The Z-up choice was
justified in the skill only as keeping the axis test from being
"untestable".

All three engine glTF presets are now the same spec-compliant export
(export_yup=True, meters). Engine differences are documented where they
really live: Godot's node-name import hints (-convcolonly, -colonly,
-rigid) and Unreal's FBX axis_forward/axis_up/global_scale, which is
unchanged. The pipeline template's --preset now selects the same export
for every engine.

examples/export-preset-axis keeps its checks and still image but stops
calling the lying mast "Godot": it now contrasts the engine preset with a
naive export_yup=False file, which is what any glTF engine would show.

Closes #346

Signed-off-by: TMHSDigital <154358121+TMHSDigital@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@TMHSDigital
TMHSDigital force-pushed the fix/gltf-engine-presets branch from 469cee2 to 1fe0898 Compare October 5, 2026 00:09
@TMHSDigital

Copy link
Copy Markdown
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;

@TMHSDigital
TMHSDigital merged commit 74813ec into main Oct 5, 2026
13 checks passed
@TMHSDigital
TMHSDigital deleted the fix/gltf-engine-presets branch October 5, 2026 00:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation examples Runnable smoke-gated examples under examples/ rules skills snippets templates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

snippets: Godot glTF preset exports Z-up, but glTF and Godot are both Y-up

1 participant