Create forniture from Sketchup

This topic has been viewed 40370 times and has 11 replies
Thread status: Active
How can I do this? [img]http://www.sweethome3d.com/images/flags/en_small.gif[/img]
mariobrosss
Posts: 3
Joined: Mon Nov 30, 2009 3:47 pm

Create forniture from Sketchup

Post by mariobrosss »

Greetings.

I'm new to the forum and new to the product.

I started using sweethome3d, and I found that it didn't meet my requirements, I needed more power to model the changes I want to do to my house.

I have read a lot about how can I do this changes. I downloaded Sketchup from Google, learned how to do models. Easy, no problem, I have used modelling software like this before.

So I tried to extract models from sketchup to sweethome3d, but there was no direct way to do so, and what I have read about was incomplete and didn't tell the full explanation about how to do it.

After a bit trying, I have found out how to do it, so I want to share it, maybe it will help somebody trying the same.

I do know programs used in this explanation are not free-of-use, although they are free-of-cost. So maybe this howto can be not legal if you use it to make profit, so be careful if you use it in commercial ways, ensure yourself the legal use reading the licenses. I use it only for personal purposes, so I didn't read that boring stuff... :)

Steps:
1) Download Autodesk FBX converter. It's free for downloading, at http://usa.autodesk.com/adsk/servlet/pc ... id=6837478

2) Use Sketchup to model something. You can use textures as well.

3) Export the sketchupmodel in Google Earth file (kml).

4) Change kml file extension to zip (yes... it's a zip. Everybody now uses zips! Office 2007... X3 reunion...)

5) Unzip.

6) Go to see the model in COLLADA (models/xxx.dae).

7) Convert the dae to fbx using FBX (just last version of fbx works fine).

8) Convert the fbx to obj, using FBX again. It will generate two files, .OBJ (mesh) and .MTL (materials)

9) Textures: FBX doesn't convert the textures. So we must do it manually. Go for the textures directory (root of unzipped file/textures), copy all of them to the models directory.
Then, open the MTL file generated by FBX when converting to OBJ, as text, look for the materials yo have used, and insert this line:

newmtl material_0_1_0ID
Ka 0.000000 0.000000 0.000000
Kd 0.800000 0.800000 0.800000
map_Kd texture0.jpg <--- NEW LINE TO BE ADDED.
illum 1
Tr 1.000000

Don't use relative paths, just the name of the texture, since we will put it in the root of the zip where we will pack everything. If you are not sure what textures are to be added to what materials, refer to the COLLADA file (.dae), open it as text (is an XML), and search ".jpg" string...

Pack the .obj file, the .mtl file, and all the textures used in a zip, throw it to the import forniture window of SweetHome3D, and you have it.

Best regards, and thanks for this excellent product (and now even more powerfull!!!)
mariobrosss
Posts: 3
Joined: Mon Nov 30, 2009 3:47 pm

Re: Create forniture from Sketchup

Post by mariobrosss »

Ups! an error! the Google Earth file is .KMZ extension, not .KML... sorry.
User avatar
alied
Posts: 40
Joined: Tue Sep 08, 2009 9:53 pm
Country: Rosario, Santa Fe, Argentina

Re: Create forniture from Sketchup

Post by alied »

I think there is a more straightforward way.
You can set this parameter to spacify any aditional loader: -Dcom.eteks.sweethome3d.j3d.additionalLoaderClasses=the.collada.loader.class
Tha jar containing that class should be on the program classpath.
You can visit this page to find any suitable Collada loader (I couldn't recommend any, since i haven't used collada)
Also, you can search in the Java3d forums:
http://forums.java.net/jive/forum.jspa?forumID=70
I hope this is usefull
User avatar
alied
Posts: 40
Joined: Tue Sep 08, 2009 9:53 pm
Country: Rosario, Santa Fe, Argentina

Re: Create forniture from Sketchup

Post by alied »

mariobrosss
Posts: 3
Joined: Mon Nov 30, 2009 3:47 pm

Re: Create forniture from Sketchup

Post by mariobrosss »

Buf.

I have tried to apply your solution, alied. But I couldn't.

There was no collada loader in the links you provided. Searching forums, I found this thread:
http://forums.java.net/jive/thread.jspa ... ID=371298񚩢

When I went to the project that is referenced in last post, 3dworkbench, I didn't found the loader (the post is 26th november 2009... maybe it's not deployed yet).

So, I tried the link in the first post, looking the loader from Shiva. This is the only loader I have found.

http://shinoblogbyshiva.blogspot.com/se ... el/Collada

Down, there is a link to the jar version of the loader.

http://www.ylab.ai.kyutech.ac.jp/~shiva ... loader.jar

So I have downloaded that zip, put in classpath, set the windows registry
HKEY_USERS\...\Software\JavaSoft\Prefs\com\eteks\sweethome3d\j3d\additionalLoaderClasses=KmzLoader, and then go for some sketchup staff, export in kmz, and try to import to sweethome3d... but it says "format not recognized".

Obviously I'm so far away to know where I fail. I will try something, like calling the class with full name... but I will give up soon if I find no clues about what I'm doing bad.

Thanks for your help, if I have more information, I'll tell.
User avatar
alied
Posts: 40
Joined: Tue Sep 08, 2009 9:53 pm
Country: Rosario, Santa Fe, Argentina

Re: Create forniture from Sketchup

Post by alied »

So I have downloaded that zip, put in classpath, set the windows registry HKEY_USERS\...\Software\JavaSoft\Prefs\com\eteks\sweethome3d\j3d\additionalLoaderClasses=KmzLoader, and then go for some sketchup staff, export in kmz, and try to import to sweethome3d... but it says "format not recognized".
What you need to assign to

Code: Select all

-Dcom.eteks.sweethome3d.j3d.additionalLoaderClasses=the.collada.loader.class
is the full quallified class name that implements the loader interface (should be something like

Code: Select all

com.shiva.collada.loader
). There must be some javadoc along with the jar or on the web site. (I repeat, I know nothing of collada, but I know of Java3d and SweetHome3D) Unless there is a problem with the collada file, or the Loader does not support some feature, it should work. I did it with a Loader made by my self and it worked straightforward. It saved me lots of pain in the ... brain.
Hope it works
User avatar
Puybaret
Posts: 9440
Joined: Mon Nov 07, 2005 12:00 pm
Country: Paris, France
Contact:

Re: Create forniture from Sketchup

Post by Puybaret »

As support for DAE/Collada format was added in version 2.4, there's a simpler way to reuse 3D models created with Sketchup in Sweet Home 3D now: export it at Collada format directly from Sketchup! [:)]
Emmanuel Puybaret, Sweet Home 3D creator
zarg404
Posts: 1
Joined: Mon Jun 07, 2010 3:38 pm

Re: Create forniture from Sketchup

Post by zarg404 »

Hello !
Do you know what are the good options to exports models from sketchup ?

My problem is that the DAE exported file does not have any texture nor color in 3D sweet home. Another small problem: the default size of the object is not the same as it is in sketchup.

Any idea ?

Thank you
User avatar
Puybaret
Posts: 9440
Joined: Mon Nov 07, 2005 12:00 pm
Country: Paris, France
Contact:

Re: Create forniture from Sketchup

Post by Puybaret »

I made a small change about the importation of normals in DAE files in the current beta version 2.5. I don't think it will change anything in your case but could you check if it works better?
Could you also post here or send me your SKP file and a screen capture of the options you chose at DAE exportation time? If you don't want to share your whole model, try to create a smaller one that has the same problem.
Emmanuel Puybaret, Sweet Home 3D creator
User avatar
Puybaret
Posts: 9440
Joined: Mon Nov 07, 2005 12:00 pm
Country: Paris, France
Contact:

Re: Create forniture from Sketchup

Post by Puybaret »

Thank you for sending me your model. It helped me to fix a bug in DAE/Collada import program.
Until the next release, the correction can be tested in the current beta version 2.5. Some issues I saw in other DAE models were fixed too.
Emmanuel Puybaret, Sweet Home 3D creator
Post Reply New Topic

Who is online

Users browsing this forum: No registered users and 1 guest