Baltor Get started

Gallery / Asset contracts

Axes, handedness and units checker and converter for glTF

In your harnessAsset contractMIT

Diagnose a glTF that is Z-up, mirrored or in the wrong unit (checked against expected dimensions and triangle winding) and convert it between up axes, handedness, front-face winding and units, transforming nodes, meshes, skins and animations.

Files, names only

  • ATTRIBUTION.md
  • LICENSE
  • README.md
  • asset_report.py
  • axes_units_converter.py
  • component.json
  • fixtures/door.gltf
  • fixtures/door_centimetres.gltf
  • fixtures/door_mirrored.gltf
  • fixtures/door_z_up.gltf
  • gltfio.py
  • pngio.py
  • schema_lite.py
  • test_axes_units_converter.py
  • test_package.py
  • verification/native.json

Full files in your harness.

What it takes and gives

Entry points
conversion, convert_document, winding_agreement, check, convert, run, main
Proves
check: the scene box equals the expected dimensions within tolerance, or the report names the axis swap or uniform unit factor that explains it, and at least half of the triangles wind with their stored normals. convert: every node transform, vertex attribute, morph target, inverse bind matrix and animation output is mapped by the same change of basis and unit, so world geometry keeps its shape…
Does not prove
Which way the asset should face (forward is a declaration, not something measured), that cameras and lights still look the right way (their local -Z convention is not corrected), or that quantized data converts (it is refused).
Catches
asset_unreadable, expectation_invalid, up_axis_mismatch, unit_scale_mismatch, dimensions_mismatch, winding_inverted, conversion_unsupported

Limits. Conventions are signed axis permutations with a uniform unit factor; arbitrary rotations are not offered. Quantized (integer) positions, normals or animation outputs are refused. Sparse accessors become dense, interleaved data becomes tightly packed, and every buffer is embedded in the output. Cameras and lights keep their node transform change but get no correction rotation. Winding agreement needs stored normals. The diagnosis recognises one axis swap or one uniform unit factor, not combinations.

Details

Kind
Asset contract
Engine
Python 3.10 or later
Files
16 files, 149.0 KB
Licence
MIT
Declared effects
reads files, runs commands, writes files
Checks
checker matches contract, repaired fixtures match the door in both engines, blender export mistakes are diagnosed and repaired, round trip matches in godot and blender
Techniques
Change of basis by conjugation: M L M^-1 for node transforms, Quaternion of Q R Q^T for a signed axis permutation: the axis is a pseudovector, Triangle winding against vertex normals as a mirroring test, glTF 2.0 specification: +Y up, +Z front, metres, right-handed
Tags
gltf, coordinate system, up axis, handedness, units, converter, blender, winding
Identity
library.supply.creative_originals.9f98050d034dd353539b92ab.503b2dfe8ab68c6f
Version
503b2dfe8ab68c6f1e27d0065e9cad362a0c30ce776bc854829f50143e89b2e4

The version is the SHA-256 of the item your harness downloads; every file in it names its own checksum.

Something wrong with this item, its rights or its safety? Report it on the support page, or from your harness after a download.