Joined: Nov 24, 2015
Post Count: 5
Status:
Offline
JAVA: How to change the default furniture catalog?
Hello guys,
I want to modify the default folders and furniture, that are displayed on startup. I have set up Sweet Home 3D in Eclipse. I am fairly new to Java, I must confess.
You can also find the DefaultFurnitureCatalog class at this location.
Could you please point me in the right direction? What do I have to do to add my own furniture models to the default menu? Is there another config file? In which folder do I have to put the model files?
Joined: Nov 24, 2015
Post Count: 5
Status:
Offline
Re: JAVA: How to change the default furniture catalog?
Ok, I've finally found the right file, where I can set the path of the default furniture files. Apparently all furniture files, that have been added in this file, have the extension ".obj" (exception: the light sources are also categorized as furniture, but they don't have an obj-file).
1. All files, that are nessesary to change the default categories/folders and default furniture are in this folder or in it's subfolders:
What is the right way to do this? Do I really have to add the obj and png files in the classes folder (it doesn't make sense to me)? I am sorry, for those basic programming questions.
New Zealand
Joined: Dec 28, 2014
Post Count: 95
Status:
Offline
Re: JAVA: How to change the default furniture catalog?
The properties and resources in the source (src) hierarchy are copied to the build output class hierarchy when the software is built by the build process. You would need to run ant to do a build.
New Zealand
Joined: Dec 28, 2014
Post Count: 95
Status:
Offline
Re: JAVA: How to change the default furniture catalog?
The properties and resources in the source (src) hierarchy are copied to the build output class hierarchy when the software is built by the build process. You would need to run ant to do a build.
I should have mentioned - see "copy todir" in the build.xml file.
New Zealand
Joined: Dec 28, 2014
Post Count: 95
Status:
Offline
Re: JAVA: How to change the default furniture catalog?
I assume you're using eclipse. The directory SweetHome3D-5.1-src/classes is used by eclipse to store class files it compiles. This is used by internally by eclipse, and also when running/debugging from within eclipse. Eclipse automatically includes the Project's source folders in it's run class paths, so it it is unnecessary to copy source resources and property files to eclipse's class folder.
If you wanted to use eclipse's class folder outside of eclipse, you could do what eclipse does, and add the src folder to the class path of your java command (then both will searched).
If I wanted to run outside of eclipse, I would build with ant and create all the necessary jars in the output build folder, then put the jars on the classpath (using the run scripts in the install folder as a guide). In practice, I just copy jars from the Ant build into my original "official" SH3D installation replacing the official ones with my own.
Note: Ant builds are a separate thing from eclipse's automatic compiles. Eclipse uses it's own compiler, own dependency tracking, and own classpath definitions, all normally quite separate from Ant's. Plus eclipse also has it's own separate run/debug-time classpaths. Keeping eclipse and Ant in agreement is a headache - various tools are available to help better integrate eclipse with external build tools such as Ant, but none are completely perfect. It's not uncommon to burn time on sorting out dependency problems when eclipse and the external build tools get subtlety out of sync.