Import / Conversion API
advanced scriptingVoxel Play 3 · Scripting / API
Overview
Voxel Play provides static classes for converting Qubicle objects and color data into Unity formats.
QubicleImporter Class
Converts Qubicle binary files into color array representations:
ColorBasedModelDefinition colorModel = QubicleImporter.ImportBinary(stream, System.Text.Encoding.UTF8);
ColorBasedModelDefinition Properties
colorModel.name- Object namecolorModel.sizeX / sizeY / sizeZ- DimensionscolorModel.offsetX / offsetY / offsetZ- Placement offsetcolorModel.colors- Linearized color array indexed as:x + z * sizeX + y * sizeX * sizeZ
VoxelPlayConverter Class
Generating GameObjects
GameObject go = VoxelPlayConverter.GenerateVoxelObject(
colorModel.colors, sizeX, sizeY, sizeZ, offset, scale);
Additional overloads accept textures and normal maps, or a ModelDefinition directly.
Generating Model Definitions
ModelDefinition model = VoxelPlayConverter.GetModelDefinition(
voxelTemplate, colorModel, ignoreOffset, colorToVoxelMapping);
Color-to-Voxel Mapping
ColorToVoxelMap colorToVoxelMapping = VoxelPlayConverter.GetColorToVoxelMapDefinition(
colorModel, ignoreTransparency);
This generates mapping entries containing colors and corresponding voxel definitions, allowing custom translations (e.g. white to sand, green to bush).
Was this page helpful?
Suggest an improvement
Help us improve this documentation page.