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 529 times and has 4 replies Next Thread
nvc60166
Newbie




Joined: Dec 6, 2023
Post Count: 2
Status: Offline
Reply to this Post  Reply with Quote 
Export project that was started while not being logged in (online)

Hi, so I discovered this nice software the other day and thinking I'd just do something very basic didn't bother signing up at first. But now I've done quite a bit of work in that browser window and would like to save it. But as I was not logged in, there is no option to save anything. Or is there a hidden export button???

I'm quite proficient with programming and JavaScript, so if anyone has an idea how I could pull the information from the code that would also work. I already poked around a bit and found that `this.application` seems to contain the entire state, but sadly it's not as simple as `JSON.stringify`ing it in the working browser window and `JSON.parse`ing it in the fresh one where I'm logged in now...

If anyone could help me that'd be amazing! <3
[Dec 6, 2023, 3:40:14 PM] 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: 9381
Status: Offline
Reply to this Post  Reply with Quote 
Re: Export project that was started while not being logged in (online)

I never thought about this but there must be a trick for sure. Let me think about it…
Meanwhile, I would recommend to take some screenshots of your design to keep a trace of your ideas, just in case your browser decides to reload the page by itself.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
[Dec 6, 2023, 5:32:07 PM] 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: 9381
Status: Offline
Reply to this Post  Reply with Quote 
Re: Export project that was started while not being logged in (online)

Open the JavaScript console of your browser and execute the following script:

new HomeRecorder().writeHome(application.getHomes()[0], "", {
homeSaved: function(home, blob) {
var downloadLink = document.createElement('a');
downloadLink.setAttribute("href", URL.createObjectURL(blob));
downloadLink.setAttribute("download", "home.sh3x");
document.body.appendChild(downloadLink);
downloadLink.click();
}
});

This will save the edited home in the file home.sh3x found in your downloads folder.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
[Dec 6, 2023, 7:20:57 PM] 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: 9381
Status: Offline
Reply to this Post  Reply with Quote 
Re: Export project that was started while not being logged in (online)

After doing some more tests, it looks like the previous script won’t work if you accessed the Online version from http: and not https:. If it’s the case, you’ll have to provide also an implementation of window.crypto.subltle.digest method.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
[Dec 6, 2023, 8:53:55 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
nvc60166
Newbie




Joined: Dec 6, 2023
Post Count: 2
Status: Offline
Reply to this Post  Reply with Quote 
Re: Export project that was started while not being logged in (online)

Wow, excellent solution! I pasted the snippet into the console and it worked beautifully. I 'downloaded' the file and was able to import it into my account, where it looks exactly as before. This was less hacky than I expected :D Thanks a lot Emmanuel for realising my feature request, especially so quickly! Great support! :)
[Dec 7, 2023, 10:02:50 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 2024 Space Mushrooms - All rights reserved