Datablock API

editor.createDataBlock(name, type, copyFrom, filename)
Parameters:
  • 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)
Parameters:dataBlock – the data block object to be saved if dirty (modified)

Save a modified data block.

editor.removeDataBlockFromFile(dataBlock)
Parameters:dataBlock – the data block object to be removed from the file

Delete a data block from its containing file.

editor.addDataBlockToFile(dataBlock, filename)
Parameters:
  • 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)
Parameters:
  • 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()
Returns:true if data block was modified
editor.setDataBlockDirty(value)
Parameters:value – if true then data block was modified

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

editor.getDataBlocks()
Returns:the data block objects array
editor.findDataBlock(name)
Parameters:name – the name of the data block
Returns:the data block object by its name, or nil if none found