Skip to main content

Crate pite_assets

Crate pite_assets 

Source
Expand description

pite-assets: asset scan, uid manifest, rename detection, reimport.

Single assets.pite.toml manifest at the project root maps res:// paths to opaque uids. Scans are content-aware: identical bytes keep the uid across renames, changed bytes flag reimport.

Re-exports§

pub use atlas::atlas_report;
pub use atlas::load_sidecar;
pub use atlas::resolve_sprite_source;
pub use atlas::sheet_path;
pub use atlas::AtlasUse;
pub use atlas::SpriteSource;

Modules§

atlas
Sprite-source rules (texture vs atlas + frame) and project-wide atlas reference checks for pite check.

Structs§

AssetEntry
One manifest row: stable uid plus the content it was last scanned with.
FlacImporter
Mp3Importer
OggImporter
PngImporter
ReimportReport
Outcome of reimport_project: importer results plus ref rewrites.
ScanReport
Pure diff between the last manifest and the current file set. Every vector is sorted for stable, diffable output.
ScannedFile
One importer-matched file found under the project root.
UidRegistry
WavImporter

Constants§

MANIFEST_FILE
Single manifest file at the project root.

Traits§

Importer

Functions§

apply_renames
Rewrite every *.ptscn / *.py file under root (same skip rules as scan_files) for each (old, new) rename. Only files with at least one quote-wrapped hit are written back. Returns the sorted res://-style paths of touched files.
default_importers
load_registry
Load the manifest; a missing file means an empty registry, not an error.
reconcile
Pure manifest-vs-files diff, no IO. Same path + same hash keeps the uid; same path + new hash is changed; a manifest path missing from disk but shadowed by an unclaimed file with equal (hash, size) is a rename (uid travels); otherwise removed / added (fresh uid).
reimport_project
Scan, re-run the matching importer over every changed/added path (one failure never aborts the rest), rewrite refs for renamed paths, save, and return the fresh registry plus the report.
replace_res_ref
Replace only quote-wrapped res:// refs ("res://old", 'res://old') with the new ref. Bare, unquoted occurrences are left untouched.
save_registry
Save the manifest with entries always sorted by path (diffable).
scan_files
Recursive walk of root, skipping hidden files/dirs (any component starting with .), target/, dist/, .git/. Keeps only files whose lowercase extension matches a default_importers entry.
scan_project
Load + scan + reconcile + save in one step.