Print at Dec 16, 2025, 2:05:52 AM

Posted by kingoftailor at Mar 27, 2022, 12:43:31 PM
Re: Sweet Home 3D JS Online
I successfully installed the war file in tomcat server.

Previously, the following script worked in html:

<script>
var homeName = "emptyHome";
var urlBase = "https://prod.sh3d.online/";
var application = new SweetHome3DJSApplication(
{
readHomeURL: urlBase + "api/readHome/*********/test/%s",
furnitureCatalogURLs: [urlBase + "lib/resources/DefaultFurnitureCatalog.json"],
furnitureResourcesURLBase: urlBase
});

application.getUserPreferences().setNewRoomFloorColor(0xFF9999A0);
application.getUserPreferences().setAerialViewCenteredOnSelectionEnabled(true);

application.getHomeRecorder().readHome(homeName,
{
homeLoaded: function (home) {
home.setName(homeName);
application.addHome(home);
setTimeout(function () {
document.getElementById('progress').style.display = "none";
}, 1000);

window.addEventListener("unload", function () {
application.deleteHome(home);
});
addSaveButton();
},
homeError: function (err) {
console.error(err);
},
progression: function (part, info, percentage) {
percentage = percentage * 100;
document.getElementById('progress-bar').style.width = `${percentage}%`;
}
});
</script>


How to use version 6.6.4 from my own server (in html page)? Unfortunately, I didn't find a description of this anywhere.

There is no emptyHome in the war file, only the default.

Thank You.