API Reference#
Modules#
Constants#
- SUPPORTED_FORMATS: set[FileFormat] = {FileFormat.EFKMODEL, FileFormat.MCSA, FileFormat.MCSB, FileFormat.MCVD, FileFormat.MDAT, FileFormat.MIC, FileFormat.NBT, FileFormat.OL, FileFormat.TEXARR}#
Formats available for conversion.
- SUPPORTED_SUFFIXES: set[str] = {'.efkmodel', '.mcsa', '.mcsb', '.mcvd', '.mdat', '.mic', '.nbt', '.ol', '.texarr'}#
Formats suffixes available for conversion.
- SUPPORTED_NBT: set[str] = {'common', 'itemnames.dat', 'prefs', 'sd0', 'sd1', 'sd2', 'sd3', 'sd4'}#
NBT filenames available for conversion.
- ALLOWED_SUFFIXES: set[str] = {'.efkmodel', '.mcsa', '.mcsb', '.mcvd', '.mdat', '.mic', '.nbt', '.ol', '.texarr', 'common', 'itemnames.dat', 'prefs', 'sd0', 'sd1', 'sd2', 'sd3', 'sd4'}#
All path suffixes available for conversion.
- class FileSignature[source]#
Format magic bytes.
- MCSA = b'MCSA'#
- MCAL = b'MCAL'#
- MIC = b'\x89MIC'#
- OL = b'\n\x95#\xfd'#
- DDS = b'DDS '#
- PNG = b'\x89PNG'#
- GLTF = b'glTF'#
- MS3D = b'MS3D000000'#
- class CLI[source]#
Command line interface constants.
-
NON_SKELETAL_FORMATS:
Sequence[FileFormat] = (FileFormat.OBJ, FileFormat.FBX)#
-
NON_ANIMATION_FORMATS:
Sequence[FileFormat] = (FileFormat.OBJ, FileFormat.FBX, FileFormat.DAE, FileFormat.MS3D)#
-
NON_SKELETAL_FORMATS:
- class OutputFormats[source]#
Supported output formats for file data types.
-
MODELS:
Sequence[FileFormat] = (FileFormat.OBJ, FileFormat.GLB, FileFormat.FBX, FileFormat.DAE, FileFormat.MS3D)#
-
TEXTURES:
Sequence[FileFormat] = (FileFormat.DDS,)#
-
IMAGES:
Sequence[FileFormat] = (FileFormat.PNG,)#
-
REGIONS:
Sequence[FileFormat] = (FileFormat.MCA,)#
-
TEXARR:
Sequence[FileFormat] = (FileFormat.ZIP,)#
-
NBT:
Sequence[FileFormat] = (FileFormat.JSON,)#
-
MODELS:
- class DefaultModelFormats[source]#
Default model formats for unset options.
-
STANDARD:
Sequence[FileFormat] = (FileFormat.OBJ,)#
-
ON_SKELETON:
Sequence[FileFormat] = (FileFormat.GLB,)#
-
STANDARD:
- class Factor[source]#
Integer range limits.
- I8 = 127#
- U8 = 255#
- I16 = 32767#
- U16 = 65535#
- I32 = 2147483647#
- U32 = 4294967295#
- class CubemapFaces[source]#
DDS cubemap faces.
- FACES = {'+x', '+y', '+z', '-x', '-y', '-z'}#
- COUNT = 6#
- class ModelDefaults[source]#
Model default constants.
- DECIMALS = 6#
- ROOT_BONE_ID = -1#
- GEOMETRY_LIMIT = 1000000#
Safety limit to prevent memory overflow on corrupted files.
- class Text[source]#
Shared text constants.
- FORMATS = "Supported Formats: ['.efkmodel', '.mcsa', '.mcsb', '.mcvd', '.mdat', '.mic', '.nbt', '.ol', '.texarr']"#
- NBT = "Supported NBTs: ['common', 'itemnames.dat', 'prefs', 'sd0', 'sd1', 'sd2', 'sd3', 'sd4']"#
- EXCEPTION = '[b yellow]Input file appears to be corrupted or invalid.[/]'#
Enums#
- class FileFormat(value)[source]#
Bases:
StrEnumFile extension without dot.
- NONE = ''#
- DAE = 'dae'#
- DDS = 'dds'#
- EFKMODEL = 'efkmodel'#
- FBX = 'fbx'#
- GLB = 'glb'#
- JSON = 'json'#
- MCA = 'mca'#
- MCAL = 'mcal'#
- MCSA = 'mcsa'#
- MCSB = 'mcsb'#
- MCVD = 'mcvd'#
- MDAT = 'mdat'#
- MIC = 'mic'#
- MS3D = 'ms3d'#
- NBT = 'nbt'#
- OBJ = 'obj'#
- OL = 'ol'#
- PNG = 'png'#
- TEXARR = 'texarr'#
- ZIP = 'zip'#
- property suffix#
- class FileType(value)[source]#
Bases:
StrEnumFile content kind.
- NONE = 'none'#
- MODEL = 'model'#
- TEXTURE = 'texture'#
- IMAGE = 'image'#
- TEXARR = 'texarr'#
- NBT = 'nbt'#
- REGION = 'region'#
- class ByteOrder(value)[source]#
Bases:
StrEnumFile data byte order.
- NATIVE = '@'#
- STANDARD = '='#
- LITTLE = '<'#
- BIG = '>'#
- NETWORK = '!'#
- class UnicodeErrors(value)[source]#
Bases:
StrEnumUnicode error handling policy.
- STRICT = 'strict'#
Raise UnicodeDecodeError on invalid bytes
- IGNORE = 'ignore'#
Skip invalid bytes silently
- REPLACE = 'replace'#
Replace invalid bytes with a replacement marker (οΏ½)
- BACKSLASH = 'backslashreplace'#
- BACKSLASHREPLACE = 'backslashreplace'#
Replace with backslash-escaped sequences (xHH)
- NAME = 'namereplace'#
- NAMEREPLACE = 'namereplace'#
Replace with N{β¦} escape sequences
- XML = 'xmlcharrefreplace'#
- XMLCHARREFREPLACE = 'xmlcharrefreplace'#
Replace with XML/HTML numeric entities (&#β¦;)
- SURROGATE = 'surrogateescape'#
- SURROGATEESCAPE = 'surrogateescape'#
Preserve invalid bytes as surrogate codes
- class StructFormat(value)[source]#
Bases:
StrEnumC-type struct format codes.
- BOOL = '?'#
BOOL 1 byte [False, True]
- Type:
boolean
- I8 = 'b'#
BYTE 1 byte [-128, 127]
- Type:
signed char
- I16 = 'h'#
WORD 2 bytes [-32768, 32767]
- Type:
signed short
- I32 = 'i'#
DWORD 4 bytes [-2147483648, 2147483647]
- Type:
signed int
- I64 = 'q'#
QWORD 8 bytes [-9223372036854775808, 9223372036854775807]
- Type:
signed long long
- U8 = 'B'#
BYTE 1 byte [0, 255]
- Type:
unsigned char
- U16 = 'H'#
WORD 2 bytes [0, 65535]
- Type:
unsigned short
- U32 = 'I'#
DWORD 4 bytes [0, 4294967295]
- Type:
unsigned int
- U64 = 'Q'#
QWORD 8 bytes [0, 18446744073709551615]
- Type:
unsigned long long
- F16 = 'e'#
half-precision 2 bytes
- Type:
float
- F32 = 'f'#
single-precision 4 bytes
- Type:
double
- F64 = 'd'#
double-precision 8 bytes
- Type:
double
- F#
StructFormat Alias.
- class ConsoleLabel(value)[source]#
Bases:
StrEnumColored console output labels.
- INFO = '[b blue]INFO:[/]'#
- HINT = '[b cyan]HINT:[/]'#
- DONE = '[b green]DONE:[/]'#
- WARN = '[b yellow]WARN:[/]'#
- ABORTED = '[b yellow]ABORTED:[/]'#
- ERROR = '[b red]ERROR:[/]'#
- INVALID = '[b red]INVALID INPUT:[/]'#
- EXCEPTION = '[b red]UNEXPECTED ERROR:[/]'#
- L#
ConsoleLabel Alias.
Types#
- Formats#
Sequence of file formats.
alias of
Sequence[FileFormat]
- PathLike: TypeAlias = str | pathlib.Path | os.PathLike[str]#
Path represented as string, pathlib.Path, or OS path-like object.
- Output#
Optional output path.
alias of
Path|None
- OutputLike#
Optional path-like output.
alias of
str|Path|PathLike[str] |None
- FilesWhitelist#
Iterable of file suffixes for filtering.
alias of
Iterable[str]
- FilesPaths#
Iterable of file paths.
alias of
Iterable[Path]
- FilesSources#
Iterable of path-like sources.
alias of
Iterable[str|Path|PathLike[str]]
Exceptions#
- exception DecodingError[source]#
Bases:
ScFileExceptionBase exception occurring while file decoding.
- exception EncodingError[source]#
Bases:
ScFileExceptionBase exception occurring while file encoding.
- exception ParsingError[source]#
Bases:
ScFileExceptionBase exception occurring due to unexpected file structure.
- exception UnsupportedError[source]#
Bases:
ScFileExceptionBase exception occurring intentionally for unsupported formats.
- exception BaseIOError[source]#
Bases:
ScFileExceptionBase exception occurring i/o operations.
- prefix#
- exception FileError(location)[source]#
Bases:
BaseIOErrorBase exception occurring file i/o operations.
-
location:
str#
-
location:
- exception UnsupportedFormatError(location, suffix)[source]#
Bases:
FileErrorRaised when file format (by suffix) is not supported.
-
suffix:
str#
-
suffix:
- exception InvalidSignatureError(location, actual, expected)[source]#
Bases:
FileErrorRaised when file signature doesnβt match expected.
-
actual:
bytes#
-
expected:
bytes#
-
actual:
- exception InvalidStructureError(location, position=None)[source]#
Bases:
FileErrorRaised when file structure is invalid.
-
position:
Optional[int] = None#
-
position:
- exception RegionError[source]#
Bases:
ScFileExceptionBase exception for region operations.
- exception RegionFileError(path)[source]#
Bases:
RegionErrorRaised when a region file fails to decode.
-
path:
str#
-
path:
- exception MergeInterrupted[source]#
Bases:
RegionErrorRaised when region merge is interrupted by user.