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: 24
Posts: 24   Pages: 3   [ 1 2 3 | Next Page ]
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 22005 times and has 23 replies Next Thread
MrMarkie
Newbie



Sweden
Joined: Apr 15, 2010
Post Count: 2
Status: Offline
Reply to this Post  Reply with Quote 
How to import furniture in Applet

Hi I'm playing around with Sweet Home 3D and have managed to serve it as an applet from a webserver. Only problem is I have no furniture in the applet, how and where do I put which files to remedy this?

Best Regards
Markus Larsson
[Apr 15, 2010, 1:25:59 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: 9141
Status: Offline
Reply to this Post  Reply with Quote 
Re: How to import furniture in Applet

Short answer: read the information about parameters named furnitureCatalogURLs and texturesCatalogURLs in SweetHome3DApplet javadoc.

If you look at the source code of the Online version hosted on sweethome3d.eu, you'll see these two parameters are the files furnitureCatalog.zip, additionalFurnitureCatalog.zip and texturesCatalog.zip.
The PluginFurnitureCatalog.properties and PluginTexturesCatalog.properties contained in these zip files reference all the icon and 3D model files hosted on this server.
You can edit them and replace the code base http://www.sweethome3d.eu/ by the one of your server and copy all the 3D model and icon files you want on your server.

Important note: in no case, I give you (or other people reading this thread) the authorization to host unmodified versions of the files furnitureCatalog.zip, additionalFurnitureCatalog.zip and texturesCatalog.zip on your server. You must reference 3D model and icon files hosted on your server, and not files on sweethome3d.eu server.
Don't host the files furnitureCatalog.zip, additionalFurnitureCatalog.zip and texturesCatalog.zip on your server if you don't understand the exact meaning of the required changes.


[01/18/2011 - Update from developer : In version 2.4, the two furnitureResourcesURLBase and texturesResourcesURLBase parameters were added to SweetHome3DApplet class to simplify catalogs deployment.
Thus, the furnitureCatalog.zip, additionalFurnitureCatalog.zip and texturesCatalog.zip hosted on this server don't contain absolute URLs anymore but URLs relative to the furnitureResourcesURLBase and texturesResourcesURLBase parameters I added to the applet of the Online version.
Feel free to use these files unmodified now, as long as you take care to change the URL base to avoid using models hosted on sweethome3d.com server in your applet.
]
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
----------------------------------------
[Edit 1 times, last edit by Puybaret at Jan 18, 2011, 7:18:35 PM]
[Apr 18, 2010, 11:56:46 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
MrMarkie
Newbie



Sweden
Joined: Apr 15, 2010
Post Count: 2
Status: Offline
Reply to this Post  Reply with Quote 
Re: How to import furniture in Applet

I see, thank you for the quick response. I will make those changes and make sure all things point where they should point.

Thanks again for the response and for this very useful application.

Sincerly
Markus Larsson
[Apr 19, 2010, 7:16:07 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
bellskar
Newbie




Joined: Apr 26, 2010
Post Count: 8
Status: Offline
Reply to this Post  Reply with Quote 
Re: How to import furniture in Applet

I just did following but Applet is still loading without any feature.
Added the following parameters in SweetHome3DApplet.html
var parameters = {java_arguments:"-Xmx512m -Dcom.eteks.sweethome3d.deploymentInformation=Online",
showMemoryStatus:"true",
userLanguage:"en",
furnitureCatalogURLs:"/online/furnitureCatalog.zip /online/additionalFurnitureCatalog.zip",
texturesCatalogURLs:"/online/texturesCatalog.zip",

listHomesURL:"",
readHomeURL:"",
writeHomeURL:""

};


- I downloaded the same Catalogs from in zip archives you linked above.
- Then uncompressed these zip files to modify the reference URLS to my own server and then again zipped in the same way.
- I downloaded one or two models from the sweethome3d.eu as were linked in the *catalog.properties and placed on my own server with the same directory structure. I selected only one or two items/models to test the working.

the final *.properties files were as below. I am not disclosing the actual URL considering the privacy. but I tested the urls after placing the models if they work on direct access or not. and they are actually working.
furnitureCatalog.zip!\PluginFurnitureCatalog.properties
name#1=Bed 140x190
category#1=Bedroom
icon#1=http://my_url/models/bed140x190.png
model#1=jar:http://my_url/models/bed140x190.zip!/bed140x190.obj
width#1=158
depth#1=208
height#1=70
movable#1=true
doorOrWindow#1=false

name#2=Chest
category#2=Bedroom
icon#2=http://my_url/models/chest.png
model#2=jar:http://my_url/models/chest.zip!/chest.obj
width#2=100
depth#2=55
height#2=80
movable#2=true
doorOrWindow#2=false

name#3=Bedside table
category#3=Bedroom
icon#3=http://my_url/models/bedsideTable.png
model#3=jar:http://my_url/models/bedsideTable.zip!/bedsideTable.obj
width#3=38
depth#3=38
height#3=50
movable#3=true
doorOrWindow#3=false

texturesCatalog.zip!\PluginTexturesCatalog.properties
name#1=Wooden floor
category#1=Floor
image#1=http://my_url/textures/woodenFloor.jpg
width#1=42.5
height#1=42.5

additionalFurnitureCatalog.zip!\PluginFurnitureCatalog.properties
name#1=Triple window
category#1=Doors and windows
icon#1=http://my_url/models/contributions/DianaWindow.png
model#1=jar:http://my_url/models/contributions/DianaWindow.zip!/DianaWindow.obj
width#1=389.6
depth#1=25.6
height#1=210.0
movable#1=false
doorOrWindow#1=true
creator#1=Artist373



lastly, is there any way to download all the models from sweethome3d.eu in an archive rather than downloading them each individually. Ofcourse if it's authorised by sweethome3d.eu.

thanks
[Apr 29, 2010, 4:52:37 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: 9141
Status: Offline
Reply to this Post  Reply with Quote 
Re: How to import furniture in Applet

The first thing I would do is to simply import the ZIP files you created in the offline version of Sweet Home 3D after changing their extension from zip to sh3f, and check if the models listed in them appear in Sweet Home 3D catalog.
If this succeeds, you should check if http://my_url/online/furnitureCatalog.zip is accessible. As you kept a slash in front of "/online/furnitureCatalog.zip", online directory should be at root. If you remove the first slash from "/online/furnitureCatalog.zip", online will be relative to applet "codebase" attribute.

lastly, is there any way to download all the models from sweethome3d.eu in an archive rather than downloading them each individually. Ofcourse if it's authorised by sweethome3d.eu.
The two things that forbids me to do this is time and bandwidth.
Time is a concern since I would have to update this archive each time I add models in additionalFurnitureCatalog.zip, and this would be one more task I shouldn't forget.
Bandwidth is my main concern since this archive weights 32 MB at this time, and I'm always frightened by the idea of hosting such a big file (Sweet Home 3D installers are big files too but they are hosted on SourceForge.net servers).

If you feel comfortable with regular expressions, you can transform the lines containing ".zip" and ".png" in PluginFurnitureCatalog.properties into wget commands, taking care of subdirectories.
If not, the only solution I see at this time is to create that file on demand and publish it temporarily.
If you don't have a better idea, send me a private message or an email.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
[Apr 29, 2010, 7:08:31 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
bellskar
Newbie




Joined: Apr 26, 2010
Post Count: 8
Status: Offline
Reply to this Post  Reply with Quote 
Re: How to import furniture in Applet

The first thing I would do is to simply import the ZIP files you created in the offline version of Sweet Home 3D after changing their extension from zip to sh3f, and check if the models listed in them appear in Sweet Home 3D catalog.
If this succeeds, you should check if http://my_url/online/furnitureCatalog.zip is accessible. As you kept a slash in front of "/online/furnitureCatalog.zip", online directory should be at root. If you remove the first slash from "/online/furnitureCatalog.zip", online will be relative to applet "codebase" attribute.

Great!!! it was the slash. I actually was using a specific folder named SH3D as the application on the root. but didn't remove the "/". after your post I just got that and removed the "/" before "online" to use it as relative to "codebase" which in my case was "http://my_url/SH3D/"

lastly, is there any way to download all the models from sweethome3d.eu in an archive rather than downloading them each individually. Ofcourse if it's authorised by sweethome3d.eu.
The two things that forbids me to do this is time and bandwidth.
Time is a concern since I would have to update this archive each time I add models in additionalFurnitureCatalog.zip, and this would be one more task I shouldn't forget.
Bandwidth is my main concern since this archive weights 32 MB at this time, and I'm always frightened by the idea of hosting such a big file (Sweet Home 3D installers are big files too but they are hosted on SourceForge.net servers).

I got that. it's understandable.

If you feel comfortable with regular expressions, you can transform the lines containing ".zip" and ".png" in PluginFurnitureCatalog.properties into wget commands, taking care of subdirectories.

Won't it be the other part from downloading the catalogs from sweethome3d server. the hell is actually to download each zip file :P
any ways. the use of regular expressions in "*.properties" is also a good for me but ofcourse I would have to download the zip files separately each.

If not, the only solution I see at this time is to create that file on demand and publish it temporarily.
If you don't have a better idea, send me a private message or an email.

I'll contact you via email. That would be great and so kind of you.
Thanks a lot.
[Apr 30, 2010, 1:19:01 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Carina2011
Newbie




Joined: Feb 15, 2012
Post Count: 6
Status: Offline
Reply to this Post  Reply with Quote 
Re: How to import furniture in Applet

Hello, i have make this like your description, but my furniture shows not in the sweethome3d when it starts.

urls like this http://my_url/online/furnitureCatalog.zip works and found my zip

i have also tested this with a backslah / or not or with the relativ url.

must i make other changes in another class of sweethome 3d ?
[May 25, 2012, 8:16:01 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: 9141
Status: Offline
Reply to this Post  Reply with Quote 
Re: How to import furniture in Applet

Could you paste here the properties of one of your object, as well as the params you used in your applet?
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
[May 25, 2012, 8:51:41 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
ndhduong
Newbie




Joined: Jun 19, 2012
Post Count: 5
Status: Offline
Reply to this Post  Reply with Quote 
Re: How to import furniture in Applet

I use source v3.5 downloaded from here (3.5 src )

I tried to run the code locally as an applet within Eclipse, and v3.5 source is a little different from what is explained in this post:
1.There is no zip files for catalog or texture. All the models and textures are individual files in io/resources folder. The .properties files are located in io folder
2.Parameters has to be set in Run Configurations option of Eclipse

So I followed the instructions and did the following:
1.Change path for models and textures in .properties files, as
icon#1=./resources/bed140x190.png

model#1=./resources/bed140x190.obj

2.Set parameters as followed:
Name:pluginFurnitureCatalogURLs
Value:"./io/"

Name:pluginTexturesCatalogURLs
Value:"./io/"

However, the applet run without any models on the top left section.

I have intentionally changed the path for models to a wrong one then Eclipse produced error of "Unknown resource", which means the paths I used above should be processed properly.

About the parameters, I have tried both relative and absolute path (C:/...) but none worked.

Please give me some inputs.
Thank you
[Jun 20, 2012, 9:42:06 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: 9141
Status: Offline
Reply to this Post  Reply with Quote 
Re: How to import furniture in Applet

The program doesn't handle paths but URLs. I hoped that the URL suffix in the parameter names would be enough to suggest it. sad
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
[Jun 20, 2012, 4:10:13 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Posts: 24   Pages: 3   [ 1 2 3 | Next Page ]
[ 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