Skip to content

johnnyshield/blender_to_sketchup

Repository files navigation

Blender addons

Batch export Blender to Collada

This addon allows you to export all objects in a Blender file to separate Collada DAE files.

Credits

The code is not mine, so I have left the original author - Patrick Jezek - attributed, the guts are based on the Batch Export template from Blender. All I have done is trimmed down a much more capable addon to only do bulk DAE export, and then update it to work for Blender 2.8x.

Why I created this

Sketchup is awesome, importing from CAD to Sketchup can be a pain.

STL files are the most commonly exported file type from parametric CAD (e.g. SolidWorks), unfortunately Sketchup's STL importer is flaky for complex models, so an intermediate step of converting STL to Collada (DAE) is necessary if you want to avoid buying a plugin.

STL files also are normally exported as a single object from CAD programs, so they need to be split by geometry, then saved to separate collada files.

I am aware of two free options for doing this:

  1. Meshlab
  • Split by geometry easily (right click on mesh layer at top right, split in connected components), this spits out all the components to separate layers.
  • Unfortunately there isn't a method to bulk export all objects after splitting, though someone may have a plugin, or written something for Meshlab Server
  1. Blender
  • Select the object (click), go into Edit mode (Tab), then press P, then select "By Loose Parts". Go back to object mode (Tab).
  • Bulk export all components with this addon

Batch import of the Collada files is then done via TIG's Sketchup addon Import all from folder

Planned upgrade

Though blender doesn't seem to be able to export separated geometry to a single file, the Collada format can accept it, and Sketchup can import it provided it is all in the same scene.

Method likely will be:

  1. Export each object to temp collada file
  2. Extract text between geometry tags
  3. Extract text between node tags
  4. Insert into a merged file

As a proof of concept I mashed together a powershell script to extract geometry & node information from each Collada file in a folder and put them into a single collada xml. You can see the inputs and outputs (test file with some primitives), screenshot below.

Note, that the PS script isn't quite right yet - I manually edited it based on the guidance here It now imports to Sketchup fine (thanks Andy Maloney!) which still does not recognise the names.

dae

Installing and using the addon (2.80)

If you're new to Blender, download the .py addon file, then to install go to Edit, Preferences

menu

Click install, then select the file. Click the checkbox to enable it.

addon

The toolbar (UI) is hidden by default so click here to expand it

ui

Collada exporter will show up down the bottom of the tool bars, save the blender file and select your export folder before clicking export.

how to use

About

Blender plugins

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published