Skip to main content

Crate unityrs_export

Crate unityrs_export 

Source
Expand description

Exports beside the textures, for the batch engine (docs/DESIGN.md section 4’s unityrs-export row): the sprites kind (E17, gate row X2), the NGUI atlas cutter (docs/plans/extract.md E21 to E26, gate row X5) and the JSON writer it writes with.

  • ngui::cut: one input’s view to its Sprites’ PNGs, its atlases’ crops (PNG), each atlas’s JSON, the skips with their closed reasons and the sheet-to-atlas units, as docs/BATCH_SPEC.md sections 3, 4.3, 4.4 and 5 say, the textures outputs.textures selects among them.
  • ngui::winners: 4.5’s steps 1 to 3 over the cuts of several inputs.
  • keys: key templates, safe() and the key rules, which the engine’s validation checks a spec’s templates and keys with.
  • simple: metered single-object TextAsset, Font, MonoBehaviour JSON (or raw fallback), and Tier X VideoClip resource payloads.
  • shader::export: Tier A Shader text with metered platform-blob decoding.
  • extractor: UnityPy’s extraction order and names, typed reports, and corrected GameObject crawls, through a caller’s metered sink.
  • pyjson: CPython 3.11’s json.dumps(value, indent=2) of a typetree value, byte for byte (E24).

It is written from the specification, not ported from the Python references (tools/parity/ngui_cutter.py, tools/parity/sprites_kind.py), which record the fixtures it is tested against (unityrs-testkit‘s tests/fixtures/ngui.json and tests/fixtures/sprites.json). The sprites kind’s files port UnityPy 1.25.2’s Sprite rules (MIT), as do the reads’ names a Sprite or a Texture2D cannot be given (ngui::read::SETTERLESS), each saying so in its header, with the notice in the crate’s LICENSE-UNITYPY. The cutter checks max_attempt_evictions itself, after each Environment call (registration’s included), and max_export_work through the engine’s ngui::Hooks::export_work, as it does the stop, the decode work and the memory budgets; their values, the spool and 4.6’s prefix conflicts are the engine’s.

Re-exports§

pub use ngui::keys;

Modules§

audio
A multi-file AudioClip exporter; no batch kind is added. Inline bytes win over streamed data (export/AudioClipConverter.py:20-33). Old layouts hold m_AudioData and m_Type; 5.x layouts hold m_Resource and m_CompressionFormat (classes/generated.py:4180-4201). The pinned converter does not consult either format field during sample dispatch.
extractor
L9 extractor: tools/extractor.py:25-157, tools/extractor.py:165-319. Container entries are never deduplicated. Stable priority is implemented by sorting (priority, original ordinal), without allocating sort scratch. Tier C failures are retained in the report; failure to allocate the report itself ends the run. The caller supplies a confined filesystem sink; all names handed to it have passed paths::validate.
ngui
The NGUI atlas cutter (docs/plans/extract.md E21 to E26, X5; docs/BATCH_SPEC.md sections 3, 4.3, 4.4 and 5), over one input’s view.
pyjson
JSON as CPython 3.11’s json.dumps(value, indent=2) writes it at its other defaults (docs/plans/extract.md E24): ensure_ascii, so every character outside ' '..='~' is a \uXXXX escape (lowercase hex, a character past U+FFFF as its surrogate pair) but \b, \f, \n, \r and \t, which have short forms, as " and \ do; allow_nan, so a NaN is NaN and the infinities Infinity and -Infinity; a float as its repr; the separators , and : that indent implies; an empty list [] and an empty object {}, each on its line.
shader
Tier A Shader export and Tier C no-blob, Int, code and player/parameter corrections. Malformed legacy blobs and unfillable replacements have named Tier U refusals. Entry point: export/ShaderConverter.py:41-89; classes/legacy_patch/Shader.py:4-7.
simple
Single-object payloads, ready for a caller’s file sink. TextAsset and Font follow tools/extractor.py:165-187; MonoBehaviour follows tools/extractor.py:210-224, including its semantic .bin fallback. VideoClip is Tier X: UnityPy’s dispatch has no VideoClip entry (tools/extractor.py:307-319). Its StreamedResource fields are format facts, read through the core’s resource resolver, with no transcoding.

Structs§

VorbisHeaders
Runtime setup headers, retaining their memory charge. The caller supplies a path; there is no default path, network fetch or embedded fallback.