France
Joined: Nov 7, 2005
Post Count: 9420
Status:
Offline
Re: Export to HTML5 plug-in
The generated HTML files do not open in the browser.
You probably have to allow your browser to read local files. As it depends on the browser and system you use, you’ll have to search the solution on Internet.
Plugins for reading from local disk do not help.
I’m not aware of such plug-ins. It’s generally a parameter or a menu item of your browser which allows to read local files.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator
Netherlands
Joined: Apr 8, 2022
Post Count: 1251
Status:
Offline
Re: Export to HTML5 plug-in
A (possibly impossible) wish: Deformations in the HTML view like the Pan3Dview plugin does in Sweet Home 3D: allow deformation in the 3Dview but now of course in the HTML view.
Deformations is one of the great things that sets Sweet Home 3D apart from other design programs. Showing this ability on a web page is great advertising. I would like to integrate it on Dodecagon.nl to give a 3Dview of some models.
---------------------------------------- Dodecagon.nl 950+ 3D models, manuals, and projects
Netherlands
Joined: Apr 8, 2022
Post Count: 1251
Status:
Offline
Re: Export to HTML5 plug-in - Bug
Bug found:
From the viewHomeInOverlay.html file:
activateCameraSwitchKey: true, /* Switch between top view / virtual visit with space bar if not false or missing */
You can leave out or set the activateCameraSwitchKey parameter to false but it doesn't do anything. The space bar still switches to the virtual visit, which I do not want in my case. There are no camera's apart from the default observerCamera and topCamera. This problem was already present in the previous versions. (My overlay views are just one or two models in an otherwise empty space. There's nowhere to go with a virtual visit.)
France
Joined: Nov 7, 2005
Post Count: 9420
Status:
Offline
Re: Export to HTML5 plug-in - Bug
Strange, I tried again the activateCameraSwitchKey parameter and it seemed to work on my side. When set to false, pressing the space bar has no effect.
About deformations in the viewer, you can already modify the transformations of a piece of furniture at screen in a animation for example controlled with a call to setInterval JavaScript function. The transformations array requested in setModelTransformations method must contain instances of Transformation class, and the easiest way to create such objects is to deform an object in Sweet Home 3D and retrieve the matching transformation values in the <transformation> tags of its saved Home.xml entry.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator
Images with a 3D icon after the caption can be clicked for a 3D view. You can look at the page source code to see what parameters are used.
The first image has activateCameraSwitchKey:"false" The second image has activateCameraSwitchKey:false And the other images have no activateCameraSwitchKey parameter.
Neither should respond to the space bar but all do. (Debian Linux with Firefox). The whole page moves up with the space bar which is normal to scroll a page up but it should not interfere with the overlay view by switching it to a virtual visit. -- Great that transformations are possible! I'll have to study the information you pointed me to. I just have to find the time between all other Sweet Home 3D activities
---------------------------------------- Dodecagon.nl 950+ 3D models, manuals, and projects
France
Joined: Nov 7, 2005
Post Count: 9420
Status:
Offline
Re: Export to HTML5 plug-in - Bug
This would require a deeper investigation because the demo provided with the viewer does not works as expected when activateCameraSwitchKey is set to false .
About setting transformations for an animation, I wanted to share a test we made some time ago with Véronique who designed a home containing 22 mannequins showing different postures of a walking man. Only the first mannequin is actually displayed and a simple script changes each 50 ms the transformations and size of the mannequin from the hidden mannequins postures, moving the location of the mannequin to make it appear as if it's moving. As shown in the following animated GIF, it works pretty well even if it's not perfect (the location of the mannequin would probably need some refinements).
If you want to try with your own models, download the attached file and change the script of the HTML file marked at the comment
// Animate mannequins
Good luck!
---------------------------------------- WalkingMan.zip
(556943 bytes)
(Download count: 24)
(Simulation of a walking man with JavaScript)
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator
Netherlands
Joined: Apr 8, 2022
Post Count: 1251
Status:
Offline
Re: Export to HTML5 plug-in - Bug
That looks great! A walking character was the first thing I thought about and you and Véronique already did it. It must have been a lot of work creating all mannequin positions and transformations. I'm definitely going to study this.
-- The viewHome example works as expected but its a separate web page, not an overlay. I'm not going to create a separate page for each model that has a 3dview. Besides the spacebar problem the overlay moves the rest of the page too much with mouse scrolls for zooming, the overlay moves partially out of the visible area. The overlay should remain static in place and mouse actions should be limited to the overlay until it is closed.
I'm experimenting with using the viewHome code in a html <object> and show/hide with buttons. I'm just an amateur with html but I read that using iframes is discouraged. No luck so far. The overlay is perfect if it remained fixed in place and the spacebar can be blocked.
---------------------------------------- Dodecagon.nl 950+ 3D models, manuals, and projects
France
Joined: Feb 8, 2024
Post Count: 2
Status:
Offline
Re: Export to HTML5 plug-in - Bug
Hello :)
I think i borked my home ... For some reason i'm encountering 2 problematic issue, 1 the roof is nolonger rendering and i see my upper level flooring, and exporting the house in HTML5 crash Here is the log of it, but i really can't read java ><
Can i fix this ? does that error say anything obvious ? It use to work, and i hosted that on a private site for the renovation company to look at ><
Also, i got pointed at this thread about converting the xml into something that blender could import to add light with correct setting, and fix transparency of texture ... but it doesn't look like the right topic ?
Netherlands
Joined: Apr 8, 2022
Post Count: 1251
Status:
Offline
Re: Export to HTML5 plug-in
Is there a way to get the unminimized versions of the viewmodel.min.js and viewhome.min.js files?
---------------------------------------- Dodecagon.nl 950+ 3D models, manuals, and projects
France
Joined: Nov 7, 2005
Post Count: 9420
Status:
Offline
Re: Export to HTML5 plug-in
@vlycop You must use a plug-in which uses some data that the plug-in may not be able to handle.
@Keet In project SweetHome3DJS, you should remove the lines 375 to 391 in build.xml and run Ant viewerBuild target.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator