Expand description
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.
The cutter is one phase of an attempt the engine owns
(docs/plans/batch.md 2.6; seam). The engine registers the view
([register]: X’s own open on M_X, the private Environment, each
bundle’s marked rows reached) and hands cut a Context: the
registered view, M_X, its hooks (the stop flag, the refusal count,
export work), the sink’s prefix, the archives’ member templates, the key
table and the sink. cut opens every top-level row of X’s own handle
(section 3’s selection), plans (4.4: names, the skips that need no
pixels, keys, in the textures, sprites, atlases order) and exports
(sprite groups, then sheet groups, then the other textures), handing
each output to the sink as it is made, and returns its skips (the
plan’s and the export’s apart), sheets and counts. Its reasons are
9.3’s, its details 7.3’s, classified as 2.7’s classify does
(classify). winners decides 4.5’s steps 1 to 3 over several
inputs’ cuts. The sprites kind (outputs.sprites, E17) is
[sprites]’s: one image per Sprite of the input’s own files, rendered by
unityrs_texture::sprite from a sheet that may be in a dependency.
Not here, being the engine’s: staging, the peek pass, the attempt’s budget and its counts, the spool and a file’s export work, the records’ files and 4.6.
Re-exports§
pub use classify::Class;pub use classify::Reason;pub use keys::KeyRule;pub use keys::KeyTable;pub use keys::Template;pub use keys::TemplateError;pub use keys::TemplateKind;pub use register::Admit;pub use register::Bits;pub use register::Data;pub use register::PeekBits;pub use register::Registration;pub use register::Staged;pub use register::peek;pub use register::register;pub use register::register_bytes;pub use register::same_open;pub use seam::Context;pub use seam::Hooks;pub use seam::MemberTemplate;pub use seam::NoHooks;pub use seam::Registered;pub use winners::Candidate;pub use winners::Decision;pub use winners::Prefer;pub use winners::Rule;pub use winners::decide;
Modules§
- classify
classify(docs/plans/batch.md2.7) as far as the cutter meets it: every error a read, a dereference, a resource read, a charge or a decode returns, to an object’s skip, the input’s failure or a run failure, with the reason and detaildocs/BATCH_SPEC.md7.3 and 9.3 name.- keys
- Key templates,
safe()and the key rules (docs/BATCH_SPEC.md2.1 to 2.3;docs/plans/extract.mdE27, E28). - read
- The cutter’s reads (
docs/BATCH_SPEC.md4.4 steps 1 and 2, section 5): a MonoBehaviour’s head, a peeked name, a texture’s fields, an atlas’s material name, each as the shape the cutter reads or aClass. - recognize
- Section 5’s recognition 2: whether an atlas’s typetree has an
mSpritesthat UnityPy 1.25.2’sread_valuereads as a list of sprites, decided from the nodes alone, before any value is read. - register
- 2.6 steps 2 and 4, the engine’s to drive before the cut: X’s own open on
M_X, the private Environment, and each bundle’s marked rows reached (docs/plans/batch.md2.6; review round 1’s B4, round 2’s S1 and S2). - seam
- The engine seam (
docs/plans/batch.md2.6; review round 1’s G1): the cutter is one phase of an attempt the engine owns. The engine registers the view ([super::register]), makesM_X, the key table and the sink, and hands them over in aContext; the cutter selects, plans and exports inside it, and returns what it recorded (super::Cut). - winners
- The winners across inputs (
docs/BATCH_SPEC.md4.5, steps 1 to 3;docs/plans/extract.mdE31, E32, E61): units decided first per unit key, their keys reserved, then every other key among its plain candidates. 4.6’s prefix conflicts are the engine’s phase 6, after this.
Structs§
- Cut
- What one input’s cut records beside its outputs, which went to the sink.
- Formats
- A set of formats, by
TextureFormatvalue. Every value UnityPy 1.25.2 names is below 128 (TEXTURE_FORMATS). - GlbDiagnostic
- Member
- A bundle of the view: its spec id and its bytes.
- Member
Path - An archive member path an output’s variables expand to (4.7): its archive’s index, and the path or why it is left out.
- Options
- What section 1.5’s
atlases(andoutputs.textures) ask for. - Output
- An output the cut made, handed to the sink as it is made.
- Picture
- An image output’s source pixels, before encoding.
- Prefab
Row - Stored row identity, separate from the resolved root and chosen key.
- Prefab
Skip - The prefab’s stored row accompanies its skip without growing 2D rows.
- Rejected
- A member path 2.3’s rules leave out, as 2.8’s
archive_membersrow records it: the rule, and the path as expanded (at most its first 1,025 bytes) under 7.3’s text rule: cut to 1,024 bytes at a code point boundary, each invalid byte U+FFFD, and whether it was cut (review round 2’s S5). - Sheet
Row - An atlas whose sheet was found: the atlas, how, and the texture.
- Skip
- A skip (7.3’s
skipsrow, but its input). - View
- One input’s view (4.2): the input, and every other bundle of the view.
Enums§
- Failure
- Why the input failed, or the run, or that the attempt stopped.
- Format
- The formats this crate decodes: the five of
docs/plans/extract.mdE15 and the rest of the formats UnityPy decodes with Pillow’s raw andbcndecoders (raw’s andbcn’s module docs), the eight ETC and EAC formats texture2ddecoder decodes for it (etc’s module docs), and the twelve ASTC LDR formats astcenc decodes for it (astc’s module docs), the four PVRTC and two ATC formats (pvrtcandatc), and twenty-two raw formats using independent closed forms (tierb).ArgbFloatis a refusal-only sentinel, excluded fromALL. - Image
Encoding - Still-image writer; keys and archive member templates stay caller-controlled.
- Output
Kind - An output’s kind (7.3’s
outputs.kind). - SheetBy
- How an atlas’s sheet was found (section 5 step 2).
- Skip
Output - What a skip skips (7.3’s
skips.output).
Constants§
- TEXTURE_
FORMATS - UnityPy 1.25.2’s
TextureFormatmembers, value and name, in its order (enums/TextureFormat.py:4-82). Values 37 to 40 are unassigned.
Functions§
- cut
- Cuts one input inside the engine’s attempt (
ctx): selects over X’s own handle, plans and exports, every output to the sink. A failure the site rules make the input’s, or the run’s, or a stop, ends the cut. - select_
own - Open every directory row first, including shadowed and unsupported rows,
before returning selected
SerializedFiles infiles()order. Never runs an Environment container pass.nestedobserves every nested row in order.