Pages

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

43 comments:

  1. 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.

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

    ReplyDelete
  3. 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.

    ReplyDelete
  4. 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?

    ReplyDelete
  5. 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.

    ReplyDelete
  6. Anyway thanks for your plugins and good work.

    And I have suscribed to your rss ;)

    ReplyDelete
  7. 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?

    ReplyDelete
  8. 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.

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

    ReplyDelete
  10. 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.

    ReplyDelete
  11. 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

    ReplyDelete
  12. 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?

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

    ReplyDelete
  14. AnonymousMay 18, 2008

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

    ReplyDelete
  15. AnonymousMay 24, 2008

    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 :/

    ReplyDelete
  16. AnonymousJuly 18, 2008

    Thank you! It helped a lot :)

    ReplyDelete
  17. AnonymousJuly 22, 2008

    Cheeser Muffin!

    ReplyDelete
  18. Where is the Sketchup's Plugin folder?

    Thank you!

    ReplyDelete
  19. Incredibly useful, thanks a lot for making this!

    ReplyDelete
  20. 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

    ReplyDelete
  21. 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

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

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

    ReplyDelete
  24. 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.

    ReplyDelete
  25. 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?

    ReplyDelete
  26. 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.

    ReplyDelete
  27. 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

    ReplyDelete
  28. :( 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?

    ReplyDelete
  29. 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!!!

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

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

    ReplyDelete
  32. i'm o sketchup 7

    ReplyDelete
  33. 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

    ReplyDelete
  34. AnonymousJuly 02, 2009

    from ITtelkom Indonesia..

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

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

    ReplyDelete
  36. 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.

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

    Triangualate Quads

    Triangualate Faces

    ReplyDelete
  38. 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

    ReplyDelete
  39. The download link doesn't seem to be working?

    ReplyDelete
  40. Why must the link not work ;.;

    ReplyDelete
  41. please help me how to download Plugin: OBJ Exporter

    ReplyDelete
  42. So, is there not a free/legal way to do this anymore? Link from here is dead and store seems to behind a registration paywall

    ReplyDelete