Plugin: OBJ Exporter

Dec 18, 2010 - TIG just released a new .obj exporter. TIG's plugins are usually solid, so I recommend trying TIG's. (TIG's OBJexporter on SketchUcation)
















2/5/2009 - Marten van der Honing sent me another .obj exporter that supports textures. See this post for download.


7/27/08



While the Pro version of SketchUp comes with the ability to export OBJ files, the free version does not.


This plugin was my attempt to write an OBJ exporter using SketchUp's Ruby API. My motivation was selfish curiosity more than anything, so when the plugin reached a state where it was able to export simple models, I lost interest.


There must have been a need for this exporter because some sites started linking here, and the plugin has now become one of my most downloaded - in spite of it's lack of features and abundance of flaws.


In it's current version, this exporter may or may not meet your needs:


Current "Features"
  • Exports entire model.
  • Exports top-level Groups and Instances only (not nested entities).
  • Has trouble with complex Faces.
With the growing interest in this plugin, I have decided to take another look at improving it. It is difficult to give a time-frame for this work. The first thing I should do is actually sit down and read the specification of the OBJ file format. I am looking at the OBJ exporter which comes with Blender as an example (export_obj.py). I am also looking at the features of the Pro OBJ exporter for a feature comparison.


Finally, I want to thank everyone who has already helped me and given feedback - I can use all the help I can get.


Download


obj_export_1.1.rb

42 comments:

Anonymous said...

Jim
Thanks for the obj exporter. It is very useful to me because I can take my model to Wings3d to some organic modeling on parts of the model.

Jim said...

Sure, I'm glad it works for you. I have a working (although simple) .obj importer also. Haven't posted it anywhere yet.

Papa Marteau said...

Hi Jim,

I am trying to export my sketchup file into an obj file but it looks like broken to me. Here is the model on Google 3D warehouse and here is the model exported and stored on 3Dvia.com. If you need something, don't hesitate to contact me.

Thanks for the plug-in, Thomas.

pichuneke said...

I have an idea for you, but I am not sure if you can make it (I am not a programmer).

The plugin would decrease the resolution and size of the textures, to improve the size of the skp and kmz files.

Is it possible?

Jim said...

pichuneke,

It may be possible, I do not know. Right now, the plugin does not even export textures. There is still a lot of basic functionality that needs work before adding any "extra" features. Thanks for your interest.

pichuneke said...

Anyway thanks for your plugins and good work.

And I have suscribed to your rss ;)

Anonymous said...

How do you install the plug-in?
If i press the download button i only get a page full of text thrown on my eyes..

Help please?

Jim said...

I get asked how to install plugins enough that I will write up an installation guide. It will be linked on the main page. Short answer:

Rick-click the name of the plugin, in this case obj_export_1.1.rb

Then select Save as (or Save Target As) to save the file to your comuter.

Finally, move the file into SketchUp's Plugins folder, and restart SketchUp.

David said...

Thanks for this great plugin! Would it ever be possible/do you know of an exporter for sketchup that exports Autocad (DXF) files?

Jim said...

Hi David,

It's possible to do a simple DXF converter. DXF is a well documented text format. It's on my list. Search this blogt for dxf - there's a German example I was going to use as a base.

Richard L said...

Excellent blog - as a Sketchup junkie I wish I'd discovered it sooner! Great link also to the Catmull subdivision script - will save a lot of time.

Cheers
Richard

D Train said...

This is a great plugin and everything but when I open the .obj file in milkshape some of the faces are messed up and some that didn't exist in sketchup are present in milkshape. Any Ideas?

Jim said...

d train, can you email a screenshot of the problem?

Anonymous said...

Thank you so much for spending your time creating such helpful plugins.
This makes our life much easier!

gregory.pageot__AT__free.fr said...

Thx for your job.

I just try to start from youtr plugin to do mine(in a non commercial format)

And I was stuck in a bug that it's doesn't manage ComponentInstance

For now i just replace
"
if(entity.typename == "Face") then
"
by
"
if(entity.typename == "ComponentInstance") then
my_str+="Plugin doesn't manage ComponentInstance"
end
if(entity.typename == "Face") then
"

ps : sorry for my english :/

Anonymous said...

Thank you! It helped a lot :)

Anonymous said...

Cheeser Muffin!

Anonymous said...

Where is the Sketchup's Plugin folder?

Thank you!

Yorik said...

Incredibly useful, thanks a lot for making this!

Xuriwan said...

Have you seen this:

http://www.sketchucation.com/forums/scf/viewtopic.php?f=180&t=14299

It should be complementary with your work I think.

"Exports top-level Groups and Instances only (not nested entities)." That's just fine - I do the nesting in the webdialog.

Would you be kind enough to email me a copy. Can't open googlepages, but thanks to the Olympics I can open blogspots!

Many thanks

Chris Glasier

Fred IIVX said...

I am trying to use the exporter so that i can open the file in NifSkope, but when I import it, it says "please triangulate your mesh before import" , any ideas?

Great plug-in though

Anonymous said...

Dos not appear to work with Sketch 7....

Jim Foltz said...

Doesn't work with SU7? Let me look into it... Thanks for taking the time to give feedback.

Jim Foltz said...

Fred IIVX, the OBJ format does not require the mesh to be triangulated - that must be a requirement of NifSkope (not sure what that is.) In the short term, I have little time to work on this.

MASA said...

Hi Jim
Thanks for the obj exporter.

I want to use the obj exporter in the unit mm
So, "v #{pt.x.to_f} #{pt.y.to_f} #{pt.z.to_f}\n" in the plugin file
again in the "v #{pt.x.to_mm} #{pt.y.to_mm} #{pt.z.to_mm}\n", if I could use?
Also, if I could re-distribute the file on my HP?

Anonymous said...

It seems to not work with SU7, as previously said. It appears the "export" window, but the file is not actually saved. Any news about that?
Thank you for your job.

Pg9 said...

Hi Jim!
Thank you for the exporter!
Unfortunately it's not working for me either. See details here:
http://www.sketchucation.com/forums/scf/viewtopic.php?f=79&t=17307&p=138076#p138076

WindWarrior said...

:( it didn't worked for me...

I have my model, go to plugins > obj_export_1.1.rb and appears the filename window, i write the name of the file, the "kind of file" is empty.

I click on save but it does not make a file.

Also tried to write the name including the ".obj" at the end, but that didn't work either... anyone have a suggestion?

WindWarrior said...

Sorry! problem fixed :)

I'm new in the SU world je je je, and i wasn't aware that the path of the file when you are going to save it is very important.

It should not have any special character, only plain letters, numbers and - or _

My path had a "รก" so that was the problem, i exported it to another folder and that worked :)

Thanks you very much for this plugin!!!

Jeff W. said...

Not working for me and SU 7. I tried WindWarrior's suggestion of no special characters and it still daved a <1KB size file.

Anonymous said...

how do I install it on mac? I've placed it on plugin's folder, but it doesn't recognize..

Anonymous said...

i'm o sketchup 7

cosmo said...

Does anyone know how I could insert a 3D model made with sketchup 7 into a html? I was thinking converting it to flash, but I haven't found a converter to that purpose. Can anyone help me? I would be gracefull

Anonymous said...

from ITtelkom Indonesia..

Thanks bro.. it really help for robotic project in campus...

luvablepancake said...

I think this is a very useful tool but how do i use it?

Mike said...

This is a very useful program, but something that would make it even MORE useful is the option to triangulate all faces, like SketchUp has the option of doing. Some 3D applications only support triangular faces.

Jim said...

Here are couple plug-ins for triangulation on SketchUcation.com:

Triangualate Quads

Triangualate Faces

J. M. Strother said...

It works great, the exported OBJ imported to Blender very nicely. Are there any plans to add textures? They all seem to get lost in the translation. Still, terrific plugin for folks with the free version of SketchUp (like me!). Thanks. ~jon

Krillatron said...

The download link doesn't seem to be working?

guest said...

Why must the link not work ;.;

Jim Foltz said...

Use this version.

Flosil Flores said...

please help me how to download Plugin: OBJ Exporter

Popular Posts (Last 30 Days)