Download

Online

Gallery

Blog

  Index  | Recent Threads  | List Attachments  | Search
 Welcome Guest  |  Register  |  Login
Login Name  Password
 

Sweet Home 3D Forum



No member browsing this thread
Thread Status: Active
Total posts in this thread: 5
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 831 times and has 4 replies Next Thread
buzzz
Member



FR
Joined: Jun 25, 2017
Post Count: 54
Status: Offline
Reply to this Post  Reply with Quote 
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 smile

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
[Apr 7, 2023, 2:51:55 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Daniels118
Advanced Member
Member's Avatar

Italy
Joined: Nov 17, 2021
Post Count: 407
Status: Offline
Reply to this Post  Reply with Quote 
Re: plugin dev and JSOnline

As far as I know you cannot import plugins to the online version.
[Apr 7, 2023, 7:07:09 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Puybaret
Expert
Member's Avatar

France
Joined: Nov 7, 2005
Post Count: 9182
Status: Offline
Reply to this Post  Reply with Quote 
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 developer
[Apr 7, 2023, 6:57:03 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
buzzz
Member



FR
Joined: Jun 25, 2017
Post Count: 54
Status: Offline
Reply to this Post  Reply with Quote 
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?
[Apr 8, 2023, 10:49:19 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Puybaret
Expert
Member's Avatar

France
Joined: Nov 7, 2005
Post Count: 9182
Status: Offline
Reply to this Post  Reply with Quote 
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 developer
[Apr 9, 2023, 10:17:03 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
[ Jump to Last Post ]
Show Printable Version of Thread  Post new Thread

    Get Sweet Home 3D at SourceForge.net. Fast, secure and Free Open Source software downloads
   
© Copyright 2006-2024 eTeks - All rights reserved