SetLayout¶
Namespace Nfty.Core.Output in assembly Nfty.Core.
The parts a cooked Set is made of, named once.
Remarks¶
This exists because four places had their own copy of these four strings — the writer's Prepare, the writer's ReadExisting, SetReader, and SetReader.IsSetFolder() — and a fifth was about to be added by SetWriter.Pack, which is the one that has to be exactly right. A Set folder is a folder the user chose, so the only thing separating "the Set" from "everything else the user keeps there" is this list.
It is an INCLUDE list, and that direction is the whole point. Pack used to zip every file under the output folder and merely exclude a top-level .set, which is unbounded in exactly the wrong direction: cooking into a Kitchen — a folder whose entire purpose is to hold loose .cbk, .rcp and .igt parts — packed the author's complete source into the archive they were about to hand a buyer. No exclusion list can enumerate what a person might leave in a folder; a description of what a Set IS can. It is the same rule Archives.KindOf follows in refusing an unknown extension rather than guessing at it.
The three directories are taken WHOLE rather than filtered by extension. They are nfty's own namespace inside the user's folder, so the boundary that matters is the directory, not the file type — and filtering on .png would silently drop an asset the day the format grows a second image encoding.
Fields¶
ImagesDir¶
The generated art, one NNNN.png per asset.
ManifestFile¶
The Set manifest, which is also what identifies a folder as a Set at all.
MetadataDir¶
The standards-pure OpenSea metadata, one NNNN.json per asset.
ModelsDir¶
The 3D models a modeled cook writes, one per fully-opaque asset. Absent from a Set cooked without models. NOT taken whole: see SetLayout.ModelFilesIn().
NftyDir¶
The rich nfty metadata — dna, seed, rarity, per-layer color — one per asset.
Properties¶
Directories¶
The subdirectories taken whole, in the order a listing reads best. models/ is deliberately NOT here: it belongs to a Set only as far as set.json says (SetLayout.ModelFilesIn()), because a folder named models is a name an art workspace plausibly already uses.
Methods¶
FilesIn(string)¶
Every file that belongs to the Set in setDir, and nothing else in that folder.
Parameters
setDir(string) - The Set folder.
Returns. Absolute paths, in Ordinal order. Ordinal because these reach an output file: the default comparer sorts by the current culture, so the same Set would pack to a different archive on an en-US machine than on a sv-SE one — the rule every other sort that reaches disk here already follows.
Exceptions
ArgumentException-setDiris null or whitespace.
ManifestPath(string)¶
Where a Set folder keeps its manifest.
Parameters
setDir(string) - The Set folder.
Returns. The full path to set.json.
ModelCountIn(string)¶
How many assets have a model in setDir - a .gltf with its .bin is one model, not two.
Parameters
setDir(string) - The Set folder.
Returns. The count of distinct numbered assets among SetLayout.ModelFilesIn().
ModelFilesIn(string)¶
The model files set.json in setDir accounts for: for a Set that recorded a models block, NNNN.glb (or .gltf and .bin per the recorded format) for each numbered asset that was not recorded as skipped. Nothing else in models/, and nothing at all for a Set without the block.
Parameters
setDir(string) - The Set folder.
Returns. Absolute paths, in Ordinal order.
Exceptions
ArgumentException-setDiris null or whitespace.
Remarks
This is the one rule for "which of the folder's models/ is the Set's": the listing, Pack, the exporter and the export dialog all ask here, so a user's own models/secret-source.blend - or a stray 0001.glb beside a Set cooked without models - cannot ride along into a buyer's archive.
NamingOf(string)¶
How the Set in setDir names its per-asset files: what its set.json records, or the writer's own names when it records none or has no manifest.
Parameters
setDir(string) - The Set folder.
Returns. The naming; ask it for a number's file name rather than spelling one here.
Stem(int)¶
The name an asset's files share, without extension: its set number padded to four digits (growing past 9,999), invariant so no culture's digits or sign ever reach a file name.
Parameters
number(int) - The asset's number within the Set.
Returns. For example 0042.