Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -850,13 +850,13 @@ byte-identical on 4.5.11 and 5.1.2 and guarded against future renames.
</tr>
<tr>
<td width="46%" valign="middle">
<a href="examples/export-preset-axis/"><img src="examples/export-preset-axis/preview.webp" alt="Export preset axis: a radio beacon exported under Unity and Godot glTF presets and re-imported side by side on a dark studio floor - Unity standing with a glowing cap, Godot lying on its base - proving the two files have different vertex orientation" /></a>
<a href="examples/export-preset-axis/"><img src="examples/export-preset-axis/preview.webp" alt="Export preset axis: a red-and-white radio mast exported under Unity and Godot glTF presets and re-imported side by side on a dark studio floor, each beside a red-green-blue axis gizmo - Unity standing with blue Z up, Godot lying with green Y up and blue Z along the mast - proving the two files have different vertex orientation" /></a>
</td>
<td valign="middle">

### [export-preset-axis](examples/export-preset-axis/)

The same beacon mesh under the Unity (`export_yup=True`) and Godot
The same radio-mast mesh under the Unity (`export_yup=True`) and Godot
(`export_yup=False`) glTF presets. Re-importing each file proves the axis
conversion: Unity stands, Godot lies along `-Y`. `--same-axis` exports both
Y-up and the differ check exits 9. Neighbor of
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/gallery/assets/export-preset-axis-hero.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
383 changes: 311 additions & 72 deletions docs/gallery/export-preset-axis/index.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/gallery/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -618,11 +618,11 @@ <h2><a href="gltf-export-roundtrip/">gltf-export-roundtrip</a></h2>
</article>
<article class="card" data-tags="export">
<a class="card-media" href="export-preset-axis/" tabindex="-1" aria-hidden="true">
<img src="assets/export-preset-axis-hero.webp" alt="Two copies of a lamp-post beacon: the left one standing upright, the right one lying on its side." loading="lazy" decoding="async" />
<img src="assets/export-preset-axis-hero.webp" alt="Two re-imports of a red-and-white radio mast with axis gizmos: the Unity copy stands with blue Z up, the Godot copy lies on the floor with green Y up and blue Z along the mast." loading="lazy" decoding="async" />
</a>
<div class="card-body">
<h2><a href="export-preset-axis/">export-preset-axis</a></h2>
<p class="teaches">A radio beacon exported under Unity and Godot glTF presets and re-imported, proving the two files have different vertex orientation</p>
<p class="teaches">A radio mast exported under Unity and Godot glTF presets and re-imported, proving the two files have different vertex orientation</p>
<p class="witnesses"><span class="tag">witnesses</span> Unity export_yup=True round-trips standing (x,y,z); Godot export_yup=False reimports lying along -Y as (x,-z,y); --same-axis exits 9; exporter RNA is guarded so a future kwarg rename fails loudly</p>
<a class="card-link" href="export-preset-axis/">View example<span class="sr-only"> export-preset-axis</span> <span aria-hidden="true">&rarr;</span></a>
</div>
Expand Down
33 changes: 26 additions & 7 deletions examples/export-preset-axis/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Export Preset Axis

A runnable example that exports the same radio-beacon mesh under the Unity
A runnable example that exports the same radio-mast mesh under the Unity
and Godot glTF presets from
[`engine-export-presets`](../../skills/engine-export-presets/SKILL.md) and
re-imports both files. The check is on coordinates, not a screenshot: Unity
Expand All @@ -26,8 +26,25 @@ vs Z-up on disk for one file) and [`unapplied-scale-gltf`](../unapplied-scale-gl
(`export_apply` is modifiers, not object scale). This example names the
Unity vs Godot presets and asserts the re-imported orientations diverge.

The still stages the two reimports side by side: standing Unity left, lying
Godot right. If `export_yup` were the same on both, the pair would match.
The subject is a radio mast chosen because "up" is unmistakable on it: a
stepped concrete footing, a bolted base flange, a tapered mast in red and
white aviation bands with steel collars, three sector panel antennas, a
shrouded microwave dish on a raked arm, an equipment cabinet, and a red
obstruction lamp under a lightning rod. The rod's point is the witnessed tip
vertex.

The still stages the two re-imports side by side: the Unity copy standing on
the left, the Godot copy lying along the floor on the right. Beside each sits
a modelled X/Y/Z axis gizmo (red, green, blue) showing that re-import's
frame. The gizmo is measured, not placed: the render path tries all 24
axis-aligned rotations and keeps the one that maps the source vertices onto
the re-imported vertices (worst nearest-vertex distance, printed as
`fit_err`; exit 12 if it exceeds 1 mm). The Unity gizmo comes out as the
identity, blue Z up. The Godot gizmo comes out as `Y -> +Z, Z -> -Y`: green
Y points up and blue Z runs along the lying mast. The mast didn't fall over.
The Godot file stores Z-up coordinates, and the importer reads them as
Y-up. If `export_yup` were the same on both, the two copies and both gizmos
would match.

## Run

Expand All @@ -39,14 +56,15 @@ blender --background --python export_preset_axis.py --
blender --background --python export_preset_axis.py -- --same-axis

# Also render a still (EEVEE on a GPU host; use --engine cycles on GPU-less hosts):
blender --background --python export_preset_axis.py -- --output beacon.png
blender --background --python export_preset_axis.py -- --output beacon.png --engine cycles
blender --background --python export_preset_axis.py -- --output mast.png
blender --background --python export_preset_axis.py -- --output mast.png --engine cycles
```

## Exit codes

Per-script sequential checks. `9` is a valid check code; there is no rule
against it. `10` is the shared framing helper.
against it. `10` is the shared framing helper and `11` on the render path is
the shared asset-quality helper.

| Code | Meaning |
| --- | --- |
Expand All @@ -61,7 +79,8 @@ against it. `10` is the shared framing helper.
| 8 | Godot reimport is not lying along Y, or reimported tip mismatch |
| 9 | Reimported orientations did not differ (`--same-axis` lands here) |
| 10 | Gallery framing violation |
| 11 | `--same-axis` did not collapse the axis difference |
| 11 | `--same-axis` did not collapse the axis difference; also asset-quality floor violation (render path) |
| 12 | Render path: no axis-aligned rotation maps the source onto a re-import, so the gizmo frame could not be measured |

The `blender-smoke` workflow runs the check on Blender 5.2 LTS and 4.5 LTS
(5.1 on the weekly cron, the `needs-5.1` PR label, or manual dispatch).
Expand Down
Loading
Loading