Brasil
Joined: May 31, 2016
Post Count: 4
Status:
Offline
Re: Export to HTML5 plug-in
Of course, I will distribute the script in GLP, when a finish it. (there are some bugs to fix yet)
I asked about lighting support in HTML viewer because the webgl has support to it. There are some nice examples of webgl lighting on the web.
Looking the plugin code, I think that remove HomeXMLFileRecorder.INCLUDE_VIEWER_DATA flag, only for HomeLight in my case, will solve the problem.
About the SweetHome3DJS and SweetHome3D XML format is exactly what had thought.
I agree that SweetHome3DJS XML format (added with the lamp color and power ) plus the obj+mtl files is the best choice for blender export.
About export in DAE/Collada format for now I think you should focus on sweethome 3d. After you import the file XML+obj+mtl in blender(or other software) they can be converted to other formats.
France
Joined: Nov 7, 2005
Post Count: 9426
Status:
Offline
Re: Export to HTML5 plug-in
Does this mean the .sh3d file will contain all files needed by the export to html javascripts for the canvas?
It's one of my goals at the end, but that requires to port to JavaScript the classes DAELoader, Max3DSLoader for DAE/3DS support, and Wall3D, Room3D,Ground3D and other model classes to manage the structure of a home. Porting these 5000 lines of code will require probably two weeks of work and will avoid to use the Export to HTML5 plug-in, but without adding any new feature to the end user. I wonder if it wouldn't be better to be able to add and arrange furniture in the plan first. This second task requires more work but would bring some nice features in SweetHome3DJS...
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator
Joined: May 12, 2013
Post Count: 1545
Status:
Offline
Re: Export to HTML5 plug-in
Absolutely. But as an end goal for some time in a distant future, it would be nice if the (super great) HTML export could use standard .sh3d files. But urgent, not at all. The HTML export works very nicely as is.
France
Joined: Nov 7, 2005
Post Count: 9426
Status:
Offline
Re: Export to HTML5 plug-in
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: - Home.xml entry with all the data of the edited home at XML format (including furniture visible or not, walls, rooms, texts, dimensions lines, polylines...) - HomeStructure/Home.obj 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 Home.xml entry should be quite straightforward. Its elements and attributes match com.eteks.sweethome3d.model API (except for the classes starting by Home which is omitted, like HomeLight class which becomes light element). An exported Home instance will have an XML structure looking like this:
At the moment, the only elements which have an id are level and wall elements because they can be referenced in other elements. Lengths are in centimeters and angles in radians. If needed, look at com.eteks.sweethome3d.plugin.exportxml.HomeXMLExporter 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
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator
----------------------------------------
[Edit 3 times,
last edit by Puybaret at Oct 10, 2017, 10:16:01 PM]
Brasil
Joined: May 31, 2016
Post Count: 4
Status:
Offline
Re: Export to HTML5 plug-in
Puybaret thank's for the Export to XML/OBJ plug-in!
Now I have to change my blender import script to work with the new XML schema. With the new XML the light will can be edited in Sweet Home and blender will be used only as viewer.
I published the python script to import SweetHome 3D HTML5 to blender in GitHub: SweetHome3D HTML5 to Blender importer. The script creates one object for each obj file (leaving easier editing of objects in blender), this is the the main difference to use the obj file generated by SweetHome 3D.
Russia
Joined: Sep 15, 2016
Post Count: 1
Status:
Offline
Re: Export to HTML5 plug-in
Hi all,
This thing does not work in Chrome out of the box.
to run the exported ViewHome*.html in Chrome browser, you have to start chrome.exe with "--allow-file-access-from-files" commandLine option (no quotes).
Else it will just stuck on "loading model" message.
Probably it's good to add info on that to blog/manual e.t.c., or m.b. even add a message on local file access to ViewHome.html.
M.b. it's possible to somehow detect that accessing files from files is disabled right from the page script, and display corresponding message.
France
Joined: Nov 7, 2005
Post Count: 9426
Status:
Offline
Re: Export to HTML5 plug-in
Just tried this version of Opera under Windows 10 and Mac OS X, and I didn't notice any issue... Did you try with another browser? Maybe your file is very big.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator