Puybaret
Expert
France
Joined: Nov 7, 2005
Post Count: 9141
Status:
Offline
|
|
Re: Sweet Home 3D JS Online
|
I forgot to mention textures libraries. Actually, it works more or less the same with SH3T files and the two additional texturesCatalogURLs / texturesResourcesURLBase to configure application JavaScript variable in index.jsp.
For example, if you try with Contributions.sh3t available here saved in SweetHome3DJS root folder and Tomcat installation folder in /Applications/apache-tomcat-9.0.41, the following PropertiesToJson command will extract .json and texture image files :
java -cp tools/json/lib/json-20190722.jar:tools/json/src com.eteks.sweethome3d.json.PropertiesToJson . Contributions.sh3t /Applications/apache-tomcat-9.0.41/webapps/SweetHome3DJS-7.1/lib/resources Contributions /Applications/apache-tomcat-9.0.41/webapps/SweetHome3DJS-7.1/lib/resources/textures/Contributions lib/resources/textures/Contributions true
Comparing with the PropertiesToJson command previously used for furniture libraries, you just need to change file and folder names.
Then, adding the Contributions library to the configuration of JavaScript application in index.jsp will give:
var application = new SweetHome3DJSApplication( {furnitureCatalogURLs: [urlBase + "/lib/resources/DefaultFurnitureCatalog.json", urlBase + "/lib/resources/BlendSwap-CC-0.json"], furnitureResourcesURLBase: urlBase + "/", texturesCatalogURLs: [urlBase + "/lib/resources/DefaultTexturesCatalog.json", urlBase + "/lib/resources/Contributions.json"], texturesResourcesURLBase: urlBase + "/", readHomeURL: urlBase + "/readHome.jsp?home=%s",
and adding it to the textures libraries managed by user preferences in writeHomeEdits.jsp will lead to the following declaration:
serverUserPreferences = new ServerUserPreferences( new URL [] {new URL(serverBaseUrl, "lib/resources/DefaultFurnitureCatalog.json"), new URL(serverBaseUrl, "lib/resources/BlendSwap-CC-0.json")}, serverBaseUrl, new URL [] {new URL(serverBaseUrl, "lib/resources/DefaultTexturesCatalog.json"), new URL(serverBaseUrl, "lib/resources/Contributions.json")}, serverBaseUrl);
Good luck!
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
|
[May 1, 2023, 7:11:12 PM]
|
|
[Link]
|
|