A model format can describe how a specific type of model can be made: Which features are available, which modes can be accessed and to which file formats can the model be exported.
new ModelFormat( data )
show_on_start_screenWhether to list the format as an option on the start screen
box_uvWhether to enable box UV in the format
optional_box_uvAllows the user to enable or disable box UV within the format
single_textureOnly allow one single texture at a time
bone_rigWhether to use groups as a bone rig
rotate_cubesAllow the user to rotate cubes
integer_sizeLimit cube sizes to full integers
canvas_limitEnable the 3x3x3 model size limmit
rotation_limitEnable the rotation limit to 22.5 degrees and one axis
display_modeEnable the display mode
codecWhich Codec to use as the default codec for the format
onActivationFunction to run on activation of the format
onDeactivationFunction to run on deactivation of the format
Selects the format
Creates a new project using this format.
Convert the model to this format
Codecs are used to define specific file formats. Codecs can have an importer and an exporter as well as a few other functions that can be overwritten to achieve custom import and export behavior.
new Codec(id, data)
idID of the Codec
nameName of the Codec
extensionDefault extension for the codec
rememberBoolean. Whether to remember the model in the recent files list and as the opened model file.
export_actionDefault action used to export for this format.
compile()Should return the compiled model
parse( model, path )Parse and add the provided model to Blockbench
export()Overwrite the default export function
load( model, file, add )Overwrite the default load function
fileName()Returns the suggested file name for exported files
filePathReturns the suggested start path for the export dialog
afterDownloadCalled after a model has successfully been downloaded. Displays the success message
afterSave(path)Overwrite the default afterSave function
Codec#load( model, file )
Loads a model with using the codec
model: Object/StringInput model. If JSON, this is a parsed object, otherwise this is a string