As I received an other request similar to lcgamboa's one, I finally programmed the additional
Export to XML/OBJ plug-in (see links at end of message) that proposes the
Tools > Export to XML/OBJ format menu item able to generate a ZIP file that contains:
- [font=courier new]Home.xml[/font] entry with all the data of the edited home at XML format (including furniture visible or not, walls, rooms, texts, dimensions lines, polylines...)
- [font=courier new]HomeStructure/Home.obj[/font] that contains the home structure computed by Sweet Home 3D classes (wall, rooms, ground and 3D labels)
- 3D models only at OBJ+MTL format (models at other format will be converted)
- furniture icons, texture images and other images.
This generated ZIP file is compatible with Sweet Home 3D JS viewer (it just contains more data that the home file generated by
Export to HTML5 plug-in, and will be readable with Sweet Home 3D 5.3 too, once the upcoming
changes in .sh3d file format will be programmed.
The XML schema used in the [font=courier new]Home.xml[/font] entry should be quite straightforward. Its elements and attributes match
com.eteks.sweethome3d.model API (except for the classes starting by [font=courier new]Home[/font] which is omitted, like [font=courier new]HomeLight[/font] class which becomes [font=courier new]light[/font] element). An exported
Home instance will have an XML structure looking like this:
Code: Select all
<home>
<furnitureVisibleProperty/>
<property/>
<environment/>
<compass/>
<observerCamera/>
<camera/>
<level/><level/>
<pieceOfFurniture/><doorOrWindow/><light/>
<wall/><wall/><wall/>
<room/><room/>
<polyline/><polyline/>
<dimensionLine/><dimensionLine/>
<label/>
</home>
At the moment, the only elements which have an [font=courier new]id[/font] are [font=courier new]level[/font] and [font=courier new]wall[/font] elements because they can be referenced in other elements. Lengths are in centimeters and angles in radians. If needed, look at [font=courier new]com.eteks.sweethome3d.plugin.exportxml.HomeXMLExporter[/font] class source code included in the plug-in or ask for more information in this forum. A more complete description of the schema will be available with next Sweet Home 3D release.
This plug-in reuses the same classes as
Export to HTML5 plug-in, that's why it uses the same version number 1.1.
Hope you'll find all kind of use for your Sweet Home 3D data [:)]
Download links for Export to XML/OBJ plug-in:
Export to XML/OBJ plug-in 1.1 was released on 06/07/2016
Export to XML/OBJ plug-in 1.2 was released on 12/13/2016
Export to XML/OBJ plug-in 1.3 was released on 10/10/2017