Datablock API

editor.createDataBlock(name, type, copyFrom, filename)
  • name - the data block unique name
  • type - the data block type
  • copyFrom - the data block to be copied, can be nil
  • filename - the data block filename

Create a new data block.

editor.saveDirtyDataBlock(dataBlock)
  • dataBlock - the data block object to be saved if dirty (modified)

Save a modified data block.

editor.removeDataBlockFromFile(dataBlock)
  • dataBlock - the data block object to be removed from the file

Delete a data block from its containing file.

editor.addDataBlockToFile(dataBlock, filename)
  • dataBlock - the data block to be added to the file
  • filename - the file where to add the data block

Add a data block to a file.

editor.saveDataBlockToFile(dataBlock, filename)
  • dataBlock - the data block to be saved into the file
  • filename - the file where to save the data block

Save a data block to a file.

editor.isDataBlockDirty(dataBlock)

Returns true if data block was modified

editor.setDataBlockDirty(dataBlock)
  • dataBlock - the datablock to report as modified

Set the dirty state (was modified) of the data block.

editor.getDataBlocks()

Returns the data block objects array

editor.findDataBlock(name)
  • name - the name of the data block to find

Returns the datablock object by its name, or nil if none found

Last modified: 7 December 2021, at 14:30

Any further questions?

Join our discord