Skip to content
Christian Cuevas edited this page Jan 12, 2021 · 3 revisions

About

Reader is a static utility class that that automatically recognizes Voxel-Core supported file extensions and reads them accordingly.

Reader.read_file("C:\Bridge.vox")  -> { "voxels": Dictionary<Vector3, int>, "palette": Array<Dictionary> }
Reader.read_file("C:\Sword.jpg")   -> { "voxels": Dictionary<Vector3, int>, "palette": Array<Dictionary> }
Reader.read_file("C:\Palette.gpl") -> { "palette": Array<Dictionary> }

Note: All Readers are declared with class_name, which means that while Voxel-Core is active, you can access them from anywhere without having to load them.

Vox (Source)

MagicaVoxel file reader, returns voxels and palette.

VoxReader.read_file("C:\Bridge.vox") -> { "voxels": Dictionary<Vector3, int>, "palette": Array<Dictionary> }

Image (Source)

Image file reader, returns all non transparent pixels as voxels and indexes colors to palette. (supports all Godot supported raster formats)

ImageReader.read_file("C:\Sword.jpg") -> { "voxels": Dictionary<Vector3, int>, "palette": Array<Dictionary> }

GPL (Source)

GIMP color palette file reader, unlike other Readers, only returns palette.

GPLReader.read_file("C:\Palette.gpl") -> { "palette": Array<Dictionary> }