Joined: Jan 18, 2011
Post Count: 29
Status:
Offline
Running the SweetHome3D java applet in a browser - textures & furniture issues
I have been attempting to install SweetHome3d to my local server (running apache) so I can share it between my various machines on my internal network. I want it to run in the browser window, so I'm not using Java Web Start.
I successfully compiled the applet, and it starts just fine in the browser. But (as expected), there are no furniture models or textures.
Per this thread I modified furnitureCatalog.zip, additionalFurnitureCatalog.zip and texturesCatalog.zip to remove references to the SweetHome3D server, and replaced it with the address to mine.
I placed the three zip files mentioned above in a directory called "online" inside the main sweethome3d directory (so http://192.168.0.100/sweethome/online
Here's a example entry from the PluginFurnitureCatalog.properties file from furnitureCatalog.zip:
Inside of the SweetHome3DApplet.html, I added the following:
var parameters = {java_arguments:"-Xmx512m -Dcom.eteks.sweethome3d.deploymentInformation=Online", showMemoryStatus:"true", userLanguage:"en", furnitureCatalogURLs:"online/furnitureCatalog.zip online/additionalFurnitureCatalog.zip", texturesCatalogURLs:"online/texturesCatalog.zip",
listHomesURL:"", readHomeURL:"", writeHomeURL:""
};
I then used wget to download all the models from the SweetHome3D server, and placed them in the http://192.168.0.100/sweethome/models directory, making sure to keep the directory structure intact (i.e. some models are in the contributions directory, etc). I did the same with the textures (putting them in the http://192.168.0.100/sweethome/textures directory).
Based on the instructions in the other thread, it would seem that's all I need to do. And yet I still have no textures or furniture in the applet.
France
Joined: Nov 7, 2005
Post Count: 9426
Status:
Offline
Re: Running the SweetHome3D java applet in a browser - textures & furniture issues
As explained in SweetHome3DApplet javadoc, the URLs in the parameters texturesCatalogURLs and furnitureCatalogURLs can be absolute or relative to the code base of the applet (not its document base). So I would first try an absolute URL, then once it works, I would check the codebase in applet's attributes (if you didn't cite this attribute it will be equal to the directory where you placed the document containing the applet).
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator
Joined: Jan 18, 2011
Post Count: 29
Status:
Offline
Re: Running the SweetHome3D java applet in a browser - textures & furniture issues
I tried using absolute URLs to no avail. However when I returned the settings to the relative ones, I suddenly got a listing of the furniture. Not sure why that happened, as I didn't change anything.
However things are still not working properly. Now when connecting from a Linux machine, the top work area (where you draw walls, etc) is grayed out and you cannot drag-and-drop items to it. However you can right-click on a furnature item and add it to the plan that way.
When connecting from a Windows machine, the work area is functional, and drag-and-drop works fine, however no images are displayed for the furniture listings, and added items show up as cubes rather than looking like the item in question.
The official version hosted on SweetHome3D works fine on both machines.
I'm completely lost as to what's happening here. Any ideas?
France
Joined: Nov 7, 2005
Post Count: 9426
Status:
Offline
Re: Running the SweetHome3D java applet in a browser - textures & furniture issues
I would build by hand the URLs of the models and check if they work. I would also try first to work with no proxy to ensure you get the direct connection to your server. Java is able to handle proxy settings but make it simple first.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator
Joined: Jan 18, 2011
Post Count: 29
Status:
Offline
Re: Running the SweetHome3D java applet in a browser - textures & furniture issues
I've partially solved this issue: by removing the trailing slash from the models and textures base directories settings, I now properly get model icons in Windows, and the drag & drop issue seems to be fixed in Linux.
For other's reference here is my SweetHome3DApplet:
Unfortuantely, I still get "block" shapes instead of proper models in the 3D section when running on Windows. Thinking it was an Internet Explorer issue, I tried using Firefox, with the same results.
My first thought was that it had something to do with how Java is set up on the Windows machine, but if that was the case, why would the official version hosted on SweetHome3D's servers work properly?
Joined: Apr 4, 2012
Post Count: 10
Status:
Offline
Re: Running the SweetHome3D java applet in a browser - textures & furniture issues
I still get "block" shapes instead of proper models in the 3D section when running on Windows. Thinking it was an Internet Explorer issue, I tried using Firefox, with the same results.