Sketchup (SKP) importer

Importer for Sketchup 6-2015

I made this importer based to the official Sketchup API/SDK, This makes it work really well as file format compatibility is great as you would expect. This is also the greatest weakness in that this is incompatible with the GPL.

Added sketchup 2016 and blender 2.77 support

Supports:

  • Components
  • Groups
  • Meshes
  • Materials ( to cycles only)
  • Cameras
  • UV coordinates, including correct STQ to UV and scales
  • Setting up viewport transparency for objects that have transparent materials
  • Reusing existing materials by name ( the script does not import materials if they already exist in the scene, this to facilitate reimporting / rendering work-flows )
  • Use dupli vert / face for cases where very many instances need to be imported
  • Skip UV importing if object has no materials with textures
  • Import all camera’s
  • Honor ‘hidden’ flag
  • Importing Scenes ( you have to know the scene name )

Todo:

  • Import ortho cameras
  • import sun with position / rotation
  • map sketchup layers onto blender layers
  • Fix dupli verts mode. ( not a priority as dupli face mode is superior)

Cannot be done:

  • Linux support ( the libraries used are only released for Windows and OS X)

Known issues:

  • Current render engine is set to cycles by importer
  • This is not GPL compatible and cannot ever be distributed together with blender.
  • if current camera is ortho script fails
Source:https://github.com/martijnberger/pyslapi

Downloads:


6 Likes

WOW thanks man

cool! looking forward to test it, I have never managed to export camera from sketchup so I hope this addon will solve the problem :slight_smile:

I need to redo the camera math as there is something not 100% right currently. I have had this working in a previous unreleased importer for Maxwell renders scenes, so it should work soonish :slight_smile:

Excellent script
would also make possible the exporter from blender to sketch-up
TANKS

1 Like

WOW ! Thanx a lot !

Works great but…if no material assigned.
Importer cant find relevant material if assigned and does not import at all…

location: <unknown location>:-1
[Sketchup 2015-Jan-21 12:24:06] importing skp 'F:\X_PROJEKTY_Tato\DOM_ERGA\D5
20140929.skp’
[Sketchup 2015-Jan-21 12:24:07] Done parsing skp ‘F:\X_PROJEKTY_Tato\DOM_ERGA
\D5_20140929.skp’ in 0.8180 sec.
c: emp;950ec55c577812fab2390bb0a8371759.jpg
Traceback (most recent call last):
File "E:\Blender_Foundation\Blender\2.73\scripts\addons_contrib\sketchup_impor
ter_init
.py", line 317, in execute
return SceneImporter().set_filename(keywords[‘filepath’]).load(context, **ke
ywords)
File “E:\Blender_Foundation\Blender\2.73\scripts\addons_contrib\sketchup_impor
ter_init_.py”, line 113, in load
self.write_materials(skp_model.materials)
File “E:\Blender_Foundation\Blender\2.73\scripts\addons_contrib\sketchup_impor
ter_init_.py”, line 148, in write_materials
img = bpy.data.images.load(tmp_name)
RuntimeError: Error: Cannot read ‘c: emp;950ec55c577812fab2390bb0a8371759.jpg’:
No such file or directory

location: <unknown location>:-1

location: <unknown location>:-1

Ill look into that.

Just updated the script to also do UV coordinates.

Yes exporting is also very possible but for my current situation importing is much more needed.
I don’t have to much free time and working on blender / cycles itself eats the majority so not giving an ETA :slight_smile:

Juicyfruit: I installed version for OS X. I’m not able to even enable the add-on.
Can you recognize the reason? Thank you for help.

Traceback (most recent call last):
  File "/Users/filip/Downloads/Blender-Builds/blender-2.73-fdddd4e-OSX-10.6-x86_64/blender.app/Contents/MacOS/../Resources/2.73/scripts/modules/addon_utils.py", line 299, in enable
    mod = __import__(module_name)
  File "/Users/filip/Library/Application Support/Blender/2.73/scripts/addons/sketchup_importer/__init__.py", line 32, in &lt;module&gt;
    from . import sketchup
ImportError: dlopen(/Users/filip/Library/Application Support/Blender/2.73/scripts/addons/sketchup_importer/sketchup.so, 2): Library not loaded: @rpath/slapi.framework/Versions/Current/slapi
  Referenced from: /Users/filip/Library/Application Support/Blender/2.73/scripts/addons/sketchup_importer/sketchup.so
  Reason: image not found

wow, works much better than sketchup dae export, thanks! couldn’t activate it on mac though, same error as vklidu reported.

@ Juicyfruit - Nice progress so far! You said me in the other thread that the importer was already operating a Remove Doubles on all objects, so it’s weird, because from my tests, it don’t.
Also there is a scale problem with the UV mapping. It doesn’t seem to take into account the texture scale specified in the Sketchup Edit tab from the Materials panel. It seems to export the default scale (10cm x 10cm).
Here are my tests files: https://www.dropbox.com/sh/xf6hybwvnq8t9py/AAC24MPBu2vZVfefI_j2zpbHa?dl=0

Edit: I tried on another model, an everything worked fine… so that’s great news :smiley: ! But I’m really wondering what’s wrong with the import of my test scene… If you have time I’d like you to check the files in order to know if there are rules to make the import consistent.
Thank you Juicyfruit for this addon!

Fantastic Script ! Thank you !

The only thing that confuses me a bit are the wrong displayed Faces in Solid-Mode:



Texture-Mode works:


Kind regards
Alain

Crazy thing happening when viewing in orthographic mode in blender:


Also, I’m unable to render with an external renderer when there is some geometry imported from sketchup (with Cycles, everything works fine). Blender automatically crashes when I press F12. The same geometry imported via Collada worked.

Maybe this is what you meant by “current render engine is set to Cycles by importer”…

One question: What versions of Sketchup are compatible with this addon?

I have tried versions 6 to 2015 but pre version 6 may also work

wuhu this is fantastic!

Thank you for your effort on bringing this to life. For me is working just fine under OSX.

But will be better to preserve the geometry as quads instead of triangles. Maybe an option to chose this at the importing time will be great. Right now I need to convert all the tris to quads manually.

Also an .skp exporter for Blender will be of great help. I need to save some objects from Blender to .skp format and send the .skp files to Vcarve for nesting and CNC mechanisation. Unfortunately to this moment Vcarve can import only .skp files and is a tedious task to export blend models to SketchUp and from there to save in .skp format and after that to open .skp files in VCarve.

Oh I noticed often materials and such are missing. Any idea why? I have the feeling colors or textures applied to individual faced dont transfer but applied to a group works!

Having an issue with the add-in and not quite sure why. I’m running on Windows and get the following error message when I try to import:


Any Ideas what is going on here?

Sorry for the noob question but I can’t get this to show up in the add ons menu. I am using Blender 2.72 and install from file option, double click on python file to install it. Should it come up under import/export in the add ons menu and does it show as ‘import SKP file’?