FR
Joined: Jun 25, 2017
Post Count: 54
Status:
Offline
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 ?
France
Joined: Nov 7, 2005
Post Count: 9426
Status:
Offline
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
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?
France
Joined: Nov 7, 2005
Post Count: 9426
Status:
Offline
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