France
Joined: Nov 7, 2005
Post Count: 9426
Status:
Offline
Re: Export to HTML5 plug-in
For your information, I just released a new version 1.0.2 that fixes various issues, mainly for developers interested to use SweetHome3DJS API.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator
France
Joined: Nov 7, 2005
Post Count: 9426
Status:
Offline
Re: Export to HTML5 plug-in
Tonight, the version 1.0.3 fixes a bug in the plug-in that could generate reduced images with a wrong color profile in the exported home. If you saw some issues on the textures of your home while viewing it in a browser (too dark images or mixed with a pink color), then you should export it again with this new version. Otherwise, this update fixes also an issue on selection management in the Javascript code, but that sould interest you only if you started to use SweetHome3DJS API.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator
France
Joined: Nov 7, 2005
Post Count: 9426
Status:
Offline
Re: Export to HTML5 plug-in
The last version 1.1, announced also in this article of the blog, fixes bugs on the position of the navigation panel when the user scrolls in the window where a canvas is displayed, brings a better management of the canvas when the window is resized, and also brings the new method getClosestItemAt in HomeComponent3D class to handle picking. In the current version, all objects in a home are pickable except the transparent parts of doors or windows, allowing you to pick objects visible through window panes!
Once I found out how to run the plug-in on a headless web server (as explained here), I also decided to add a new service on sweethome3d.com that lets registered users upload their .sh3d files on the web server to view them in 3D, like in this example. This should help the ones among you who wants to show their designs without the need to have their own web server or even run the Export to HTML5 plug-in on their computer. At the moment, this service allows .sh3d files with a maximum size of 15 MB which should be enough for small to medium designs. Don't forget to save and compress your .sh3d files with Sweet Home 3D before uploading them, to avoid useless upload traffic and to be able to upload larger designs.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator
----------------------------------------
[Edit 1 times,
last edit by Puybaret at May 5, 2016, 6:35:42 PM]
UK
Joined: May 8, 2016
Post Count: 434
Status:
Offline
Re: Export to HTML5 plug-in
Hi, just tried this, using mozilla firefox, and found it very easy to use, the detail in the image actually seemed slightly better. Spotted more flaws . Nice work Puybaret.
Joined: Sep 10, 2012
Post Count: 31
Status:
Offline
Re: Export to HTML5 plug-in
just for the ones with problems to load and test local files...at apachefriends.org you can find a complete webserver. in one package. you can also install as many cms you like. this will allow you also to develop some plugins for typo3, wordpress etc. and last but not least...great, great work. this plugin was the missing link to my specific project and guess it will make many, many things easier. basically i guess, if someone is able to manage it, it should be possible to create a fallback just for the reason of the device memory. raw idea is just to display four pngs with the view of model instead of the canvas. maybe the plugin can manage this in the future also.
----------------------------------------
WIN10 Pro 64bit * 16 GB RAM * AMD FX 6100 * Geforce GTX 660
France
Joined: Nov 7, 2005
Post Count: 9426
Status:
Offline
Re: Export to HTML5 plug-in
Thanks for your feedback
it should be possible to create a fallback just for the reason of the device memory.
Pixelwizard, if you have some information about this fallback, please give it, because as far as I know, there's no way to prevent a crash when memory is missing in JavaScript at the moment.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator
Joined: Sep 10, 2012
Post Count: 31
Status:
Offline
Re: Export to HTML5 plug-in
for sure i will, but actually i'm busy for the next weeks. was just a raw idea, just following a plugin for typo3 i just checking out for possible modification. but just following this idea, i thought about to identify the devices memory by a short script, then compare to the file size and memory usage. the pngs from four directions might be generated during export, basically same way when exporting plan to pdf with 3dview. once the pngs are there, th e js might be able to select automatically what to display, the model or the pictures. this will also reduce the load of files on mobile devices. i guess this might be better managed by common cms, because when i remember correctly, some of them support this by supporting responsive delivery of files more or less automatically. by the way, also for mobile devices (android) there is a webserver. is called ksweb. setup is easy, configuration might be a little bit tricky. so spent a little bit of time. but i was able to install wordpress as cms to it on my samsung galaxy tab4 with it. let me see what i can do, because this is exactly what i might need for my project. for may needs, i might be more orientated to a solution for typo3, but i will keep in mind to find a way which allows an independent solution, so that this will be hopefully one single package which could be used on any stage. to my needs, it must be finally responsive, which also means the canvas and the model needs this features. anyway, html5, javascript and css will do the job. ;)
----------------------------------------
WIN10 Pro 64bit * 16 GB RAM * AMD FX 6100 * Geforce GTX 660
Brasil
Joined: May 31, 2016
Post Count: 4
Status:
Offline
Re: Export to HTML5 plug-in
Hi Puybaret,
Great job with HTML export plugin! In the future, the HTML viewer will support lighting? The Home.xml format will be changed? The Home.xml is a best point of start for import sweethome3d houses in others softwares. I have made a python script that read Home.xml and inport the house in blender. I use blender render and blender game engine to interact with the house because the light support. But the light definition in Home.xml don't have the light power value, it's possible to include this field in the next version of plugin?
Thank you for sweethome3d, it is the best house editor!
France
Joined: Nov 7, 2005
Post Count: 9426
Status:
Offline
Re: Export to HTML5 plug-in
I'm glad you found some use for the Home.xml export. Do you plan to make your script available to the public? That would be a nice way to import a home in Blender with lights.
I don't know whether the HTML viewer will support some lighting, but you can already get in Home.xml file the light information you look for by changing some flags in the plug-in source code included in the sh3p file (or reusing plug-in classes in an other plug-in). The easiest way should be to remove HomeXMLFileRecorder.INCLUDE_VIEWER_DATA flag (and HomeXMLFileRecorder.REDUCE_IMAGES if you don't want images to be resized) in the getHomeRecorder method the end of the ExportHTML5PluginAction inner class of com.eteks.sweethome3d.plugin.exporthtml5.ExportHTML5Plugin. Then, rebuild the plug-in with the help of Plug-in developer's guide.
The XML format of Home.xml shouldn't change in the future, it will even become part of the updated format of Sweet Home 3D files. In the coming versions 5.x, the idea is to include the Home.xml file along with the existing Home Java serialized entry in .sh3d files + the ability to parse both entries even if they describe the same com.eteks.sweethome3d.model.Home instance. Then probably in versions 6+, the default Sweet Home 3D files will have a .sh3x extension and use a file format that will contain a Home.xml entry but no Home entry, to avoid slowing down Save operation. This transition will help users to read .sh3x files even with Sweet Home 3D version 5.3 and superior. Of course, the ability to read Home Java serialized entry included in .sh3d files will be kept to be able to read all files made with previous versions of Sweet Home 3D. The XML writer added to Sweet Home 3D 5.3 will be very close to the one in Export to HTML5 plug-in, using the same elements and attributes syntax when its INCLUDE_VIEWER_DATA flag is not set. Why only "very close" and not "the same as"? Because the plug-in needs to simplify the exported data to match SweetHome3DJS features, i.e. its inability to read 3D models at 3DS and DAE format as well as to compute walls and rooms in 3D. Quickly said, at the moment, the plug-in is "only" able to read 3D models at OBJ+MTL format listed in Home.xml and place them at the good location. Walls, floors, ceilings, holes in the ground and 3D labels are all precomputed by the plug-in in the HomeStructure/Home.obj entry which is displayed as one 3D object by SweetHome3DJS. This structure file and exporting only in OBJ format is not needed in Sweet Home 3D itself, that's why its XML writer will not perform these operations but will keep the same XML syntax, except for the structure attribute of the home. From the various tests I run with Blender, it seems that Blender supports better OBJ+MTL format than 3DS and DAE formats (but maybe it was improved recently). Blender is of course unable to compute in 3D the walls and rooms of a Sweet Home 3D file. So I guess that the format I chose for SweetHome3DJS is the best choice for Blender too, and you would prefer that the way 3D models and home structure are exported won't change! I'll keep that in mind and if needed I'll create an other Export to XML + OBJ plug-in. That could even become a Save option in Sweet Home 3D if this format becomes really useful for many people. Keep also in mind that DAE/Collada format is also able to store lights, so if you need only OBJ files + lights, it could be more logical to add Export to DAE format option (even if this will require more work from me).
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator