Joined: Jun 29, 2012
Post Count: 1
Status:
Offline
Adding new elements
hello,
I'm new in this project and I want to develop new tools, objects... I learned how to develop a simple plugin from the tutorial, now my objective is to add a new personalized element (for exemple in room "chambre" ) also how to create a new category like the folder "chambre" in the application , the problem is that I' cant find the part of code in which i make these changes , so i participate in this forum hoping to find assistance .
France
Joined: Nov 7, 2005
Post Count: 9423
Status:
Offline
Re: Adding new elements
Objects shown in the furniture catalog tree are CatalogPieceOfFurniture instances stored in FurnitureCategory and FurnitureCatalog objects. The furniture catalog in use in the program can be retrieved from UserPreferences instance that is proposed in plug-ins and many other places. The best way to learn how catalog pieces are handled is to study the DefaultFurnitureCatalog and FileUserPreferences classes. Modifying the current catalog will be automatically reflected in the catalog tree component, so try to understand first how to create these pieces and add them in the user preferences catalog with these two classes.
By the way, it would be nice to explain what is your goal?
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator
Joined: Jan 15, 2013
Post Count: 17
Status:
Offline
Re: Adding new elements
I am trying to do the same thing. I want to add new objects to the current library within my plugin. I am really struggling because i am new to sweet home 3d and java.
It would be a great help if someone knew how it can be done. I am basically trying to create a plugin to import a bathroom template with basic furniture but some furniture is not in the library so i want to import it through java code. i have a create new object method but it doesnt work
Poland
Joined: Nov 10, 2010
Post Count: 50
Status:
Offline
Re: Adding new elements
So you wish to embed OBJ models in your plugin, so that your users did not need to download separatelly a plugin and a library of furniture. In my opinion you can either:
- use aformentioned classes, - copy furniture library to a folder from which SH3D loads them
the first way gives you models immediatelly, but they disappear after startup. The second way is persistent, but models will be visible after restarting the application.
As you can see i have created a new object, but it doesnt want to appear, are you saying that i copy the furniture library to my eclipse project folder?