|
Sweet Home 3D Forum » List all forums » » Forum: Developers » » » Thread: plugin dev and JSOnline |
|
| Print at Dec 15, 2025, 2:55:34 PM | View all posts in this thread on one page |
| Posted by buzzz at Apr 7, 2023, 4:51:55 AM |
|
plugin dev and JSOnline Hi All, Im just started a new dev with SW7.1, I want to add plugins in this new version. I did that a long time ago with SW5. I was looking at the website and I discover the online JS version. I'm really surprised ! I would like to test that But, if I develop my new plugin with the Java SW7.1, may I be able to migrate this plugin to the JS version ? Or do I have to develop this plugin a second time for the JS version ? Thx for your precious advise |
| Posted by Daniels118 at Apr 7, 2023, 9:07:09 AM |
|
Re: plugin dev and JSOnline As far as I know you cannot import plugins to the online version. |
| Posted by Puybaret at Apr 7, 2023, 8:57:03 PM |
|
Re: plugin dev and JSOnline There's no plug-in mechanism prepared for Sweet Home 3D JS at the moment. Not sure there will be one day, because JavaScript is much more flexible than Java and you may add user interface elements and code easily in JavaScript (even from the console prompt). Note that JavaScript API is close to Java API, so starting to program shouldn't be too difficult if you already used Java API. In the demo test as well as in server index page, the "entry point" of Sweet Home 3D JS is the variable named application which will let you access to all Sweet Home 3D data. In the current version, changes to the displayed home can be saved only if embedded in an undoable operation that incremental recorder will handle, but an other direct recorder should be soon available also. ---------------------------------------- Emmanuel Puybaret, Sweet Home 3D creator |
| Posted by buzzz at Apr 8, 2023, 12:49:19 PM |
|
Re: plugin dev and JSOnline Hi all. Than you for your answers. I look at the README.txt file in the JSOnline source archive : https://sourceforge.net/projects/sweethome3d/files/SweetHome3DJS-source/ I find this : Part of the JavaScript code required to run examples is generated from Sweet Home 3D Java code After that, the author explains the process : To generate the missing JavaScript code and run tests, install JDK 11 or more recent, Node version 14 available at https://nodejs.org/ and Ant available at http://ant.apache.org/ then run ant command in the directory where you uncompressed this archive followed by the "viewerLibraries" or "applicationLibraries" target names. The "applicationLibraries" target will create missing JavaScript code in lib/generated for Sweet Home 3D JS Editor and required to run the test/testHome.html found in this archive with any compatible browser. I don't see the purpose of this message. Is it a way to explain how to transfer java code from SW java to SW JS ? What are these examples that the author talks about? Are they plugins? |
| Posted by Puybaret at Apr 9, 2023, 12:17:03 PM |
|
Re: plugin dev and JSOnline This just explains how to generate the missing .js files required to run an example like testHome.html provided in the test folder of SweetHome3DJS project. These .js files are converted form Java to JavaScript with JSweet. ---------------------------------------- Emmanuel Puybaret, Sweet Home 3D creator |
|
|
Current timezone is GMT Dec 15, 2025, 2:55:34 PM |