Provide a Data Exporter

Demonstrates the implementation of functions required to provide a data exporter.

Exporter Entry Points

  • implement VRPExport (Lua: export) to recieve the export request

  • implement VRPExportFormats (Lua: exportFormats) to provide a description of supported formats

  • optionally implement VRPExportSettingsInterface (Lua: exportSettingsInterface) to provide a description of configurable settings that affect the export behaviour

  • if providing settings interface, implement VRPExportDefaultRecipe (Lua: exportRecipe) to provide a default filename for the recipe file generated by the settings description

When a plugin implements these entry points, it appears in the application export menu.

Example Code

PLUGIN_ENTRY_POINT const char* VRTREE_APIENTRY VRPExportFormats()
{
  return "<filetypes><type ext=\"txt\" desc=\"Text File\" /></filetypes>";
}

PLUGIN_ENTRY_POINT int VRTREE_APIENTRY VRPExport(const char *file, 
                                                 HNode root, 
                                                 HNode scenes, 
                                                 HNode libs, 
                                                 const char *recipePath)
{
  //read nodes from scenes and/or libs and write them to the exported file format

  //return 0 on successful export
  return 1;
}
-- assuming module exports according to recommendation in "Getting Started"

local function exportFormats()
  return "<filetypes><type ext=\"txt\" desc=\"Text File\" /></filetypes>"
end

local function export(file, root, scenes, libs, recipePath)
  -- read nodes from scenes and/or libs and write them to the exported file format

  -- return 0 on successful export
  return 1
end

return {
  -- alongside existing exports
  exportFormats = exportFormats,
  export = export
}

Settings Interface

The exporter settings interface behaves in exactly the same way as the one for Importers.


No Results.

Getting StartedArchitectureBest PracticesHow ToAdvanced TopicsChangelogvrtree_cppCoreForeign Function InterfaceMetanodesMigrationsObserversPropertiesTreeUtilitiesAPI DefinitionsVR ExchangePluginsLua API