Download

Online

Gallery

Blog

  Index  | Recent Threads  | List Attachments  | Search
 Welcome Guest  |  Register  |  Login
Login Name  Password
 

Sweet Home 3D Forum



No member browsing this thread
Thread Status: Active
Total posts in this thread: 141
Posts: 141   Pages: 15   [ Previous Page | 1 2 3 4 5 6 7 8 9 10 | Next Page ]
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 1672001 times and has 140 replies Next Thread
Puybaret
Expert
Member's Avatar

France
Joined: Nov 7, 2005
Post Count: 9180
Status: Offline
Reply to this Post  Reply with Quote 
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:

<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 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 smile

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
----------------------------------------
Attachment Home.xml (14808 bytes) (Download count: 624) (Example of exported home at XML format)

----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
----------------------------------------
[Edit 3 times, last edit by Puybaret at Oct 10, 2017, 10:16:01 PM]
[Jun 7, 2016, 2:00:34 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
lcgamboa
Newbie



Brasil
Joined: May 31, 2016
Post Count: 4
Status: Offline
Reply to this Post  Reply with Quote 
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.
[Jun 7, 2016, 10:37:01 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
avamonster
Newbie



Russia
Joined: Sep 15, 2016
Post Count: 1
Status: Offline
Reply to this Post  Reply with Quote 
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.

WBR,
AVAmonster
[Sep 15, 2016, 5:20:19 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
ersteinmal
Newbie




Joined: Oct 14, 2016
Post Count: 5
Status: Offline
Reply to this Post  Reply with Quote 
Re: Export to HTML5 plug-in

I am sorry.

But in Opera 40.0.2308.81
The Html file start to load *.zip and stops there.

Regards Carsten
[Oct 14, 2016, 5:41:33 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Puybaret
Expert
Member's Avatar

France
Joined: Nov 7, 2005
Post Count: 9180
Status: Offline
Reply to this Post  Reply with Quote 
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 developer
[Oct 14, 2016, 6:15:16 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
okh
Advanced Member




Joined: May 12, 2013
Post Count: 1545
Status: Offline
Reply to this Post  Reply with Quote 
Re: Export to HTML5 plug-in

Opera is also one of my test browsers, never experienced problems.
[Oct 14, 2016, 7:16:54 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Puybaret
Expert
Member's Avatar

France
Joined: Nov 7, 2005
Post Count: 9180
Status: Offline
Reply to this Post  Reply with Quote 
Re: Export to HTML5 plug-in

Hello everybody,

Here's the new versions 1.2 of Export to HTML5 and Export to XML/OBJ plug-ins.
Both plug-ins are now based on the management of the new XML entry that was added to .sh3d files in Sweet Home 3D 5.3. The JavaScript part of the Export to HTML5 plug-in now supports pinch for zoom under Android and Windows, and was optimized to draw 3D lines faster.

To let the XML entry generated by Export to XML/OBJ plug-in share the same DTD as the Home.xml entry in .sh3d files, its XML format had to evolve a little to fix some typos and other small problems:
- logitude attribute of <compass> element was corrected as longitude
- nameVisible attribute of <room> element was renamed as areaVisible
- size attribute of <textStyle> element was renamed as fontSize
- <Text> element was renamed as <text> with lowercase letters
- the default value of wallsAlpha attribute of <environment> element is now 0 instead of 1
- the default value of thickness attribute of <polyline> element is now 1 instead of 0.
I sincerely hope these changes won't bother you too much. A few attributes were missing too but that won't change the way you could have already use the XML files generated by the plug-in. The properties stored in HomeObject instances were also saved in <property> elements, and read in JavaScript if needed. Finally, the attributes named structure and exportFlags are the only additional attributes in the <home> element written by Export to XML/OBJ plug-in.

Hope you'll enjoy these improvements smile
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
[Dec 13, 2016, 6:17:57 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
rhawke
Newbie



United States
Joined: Dec 27, 2016
Post Count: 11
Status: Offline
Reply to this Post  Reply with Quote 
Re: Export to HTML5 plug-in

Hi Emmanuel,

Do you think at some point in the future this plugin could be enhanced to add WebVR functionality? I have tried the obj2vr app and while it looked promising, there are bugs and issues (mainly the flipped objects, minimum viewing distance and lighting). It appears like it is not being developed anymore. I also tried uploading to Sketchfab since they use WebVR but it is difficult to get the same great sky textures and lighting options as in Sweet Home 3D. The rooms just don't look as good.

This is the link to the WebVR project:
https://webvr.info/

I have recently used a few apps that have WebVR enabled and it is already at a very usable level despite the beta status.

Or are there any other recommendations on how to view homes with VR?

Thanks

Robert
[Jan 3, 2017, 12:36:49 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
DemiChron
Newbie



Russia
Joined: Jan 14, 2017
Post Count: 1
Status: Offline
Reply to this Post  Reply with Quote 
Re: Export to HTML5 plug-in

Where can i find unminified JS code ?
thanks)
[Jan 14, 2017, 12:20:59 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Puybaret
Expert
Member's Avatar

France
Joined: Nov 7, 2005
Post Count: 9180
Status: Offline
Reply to this Post  Reply with Quote 
Re: Export to HTML5 plug-in

Rhawke, sorry, I don't have knowledge about WebVR yet, so it's difficult for me to answer.

DemiChron, source code of Sweet Home 3D JS project is available here.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
----------------------------------------
[Edit 1 times, last edit by Puybaret at Sep 6, 2017, 3:02:05 PM]
[Jan 14, 2017, 11:41:21 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Posts: 141   Pages: 15   [ Previous Page | 1 2 3 4 5 6 7 8 9 10 | Next Page ]
[ Jump to Last Post ]
Show Printable Version of Thread  Post new Thread

    Get Sweet Home 3D at SourceForge.net. Fast, secure and Free Open Source software downloads
   
© Copyright 2006-2024 eTeks - All rights reserved