confused How to add new 3d models for SweetHome3D JS?

This topic has been viewed 126414 times and has 11 replies
Thread status: Active
Questions about extending features and developing plug-ins [img]http://www.sweethome3d.com/images/flags/en_small.gif[/img]
son87a
Posts: 12
Joined: Thu Oct 28, 2021 7:35 am

How to add new 3d models for SweetHome3D JS?

Post by son87a »

Hey guys,
I want add some 3dmodels for SweetHome3D JS.
I checked file DefaultFurnitureCatalog.json but it's hard to read.
I can't read the format type.
Any suggest here or i just missing something ?
Thank you
User avatar
hansmex
Posts: 4027
Joined: Sat Sep 26, 2009 11:36 am
Country: Netherlands

Re: How to add new 3d models for SweetHome3D JS?

Post by hansmex »

Have you thought of using libraries (*.sh3f) ??

H
Hans

new website - under constuction
hansdirkse.info
son87a
Posts: 12
Joined: Thu Oct 28, 2021 7:35 am

Re: How to add new 3d models for SweetHome3D JS?

Post by son87a »

How to import *sh3f with SweetHome3D JS ?
I thought *.sh3f file only using for Desktop version. Am I wrong ?

S
User avatar
hansmex
Posts: 4027
Joined: Sat Sep 26, 2009 11:36 am
Country: Netherlands

Re: How to add new 3d models for SweetHome3D JS?

Post by hansmex »

Sorry, I missed the "JS"in your message... :-(


H
Hans

new website - under constuction
hansdirkse.info
User avatar
Puybaret
Posts: 9440
Joined: Mon Nov 07, 2005 12:00 pm
Country: Paris, France
Contact:

Re: How to add new 3d models for SweetHome3D JS?

Post by Puybaret »

In a way Hans wasn't completely wrong, because reading the [font=courier new]DefaultFurnitureCatalog.json[/font] generated file and [font=courier new]PluginFurnitureCatalog.properties[/font] file coming from SH3F (zipped) files, you should quickly understand own to build your own catalog (I would suggest to start by creating your own [font=courier new]DefaultFurnitureCatalog.json[/font]).
Emmanuel Puybaret, Sweet Home 3D creator
son87a
Posts: 12
Joined: Thu Oct 28, 2021 7:35 am

Re: How to add new 3d models for SweetHome3D JS?

Post by son87a »

Hi Puybaret,
How to I can get the new DefaultFurnitureCatalog.json from my own *.sf3f file ?
son87a
Posts: 12
Joined: Thu Oct 28, 2021 7:35 am

Re: How to add new 3d models for SweetHome3D JS?

Post by son87a »

I looking the PluginFurnitureCatalog.properties and see this:

Code: Select all

id#293=Scopia#football-goal
name#293=Football goal
tags#293=Outdoor, Garden, Soccer, Hockey, Sport
creationDate#293=2019-07-02
category#293=Exterior
icon#293=/scopia/football-goal.png
model#293=/scopia/football-goal/football-goal.obj
multiPartModel#293=true
width#293=152.4
depth#293=89
height#293=120
dropOnTopElevation#293=-1
movable#293=true
doorOrWindow#293=false
creator#293=Scopia
So, I just need convert them to json type, its right ?
One more question, I have MyOwnFurnitureCatalog.json, how to add it to sweethome3djs ?
Thank you
User avatar
Puybaret
Posts: 9440
Joined: Mon Nov 07, 2005 12:00 pm
Country: Paris, France
Contact:

Re: How to add new 3d models for SweetHome3D JS?

Post by Puybaret »

You can convert a .sh3f file to a .json file with PropertiesToJson application.
Adding more furniture libraries to SweetHome3DJSApplication can be done with the [font=courier new]furnitureCatalogURLs[/font] optional parameter. See the HTML source code of the SweetHome3DJSApplication used on sweethome3d.com for a real example.
Emmanuel Puybaret, Sweet Home 3D creator
son87a
Posts: 12
Joined: Thu Oct 28, 2021 7:35 am

Re: How to add new 3d models for SweetHome3D JS?

Post by son87a »

Thank you helping me you're the best, Puybaret!
son87a
Posts: 12
Joined: Thu Oct 28, 2021 7:35 am

Re: How to add new 3d models for SweetHome3D JS?

Post by son87a »

Hi Puybaret,
How to run PropertiesToJson.java class ?
Post Reply New Topic

Who is online

Users browsing this forum: No registered users and 1 guest