Monday 13 May 2013

Importing models from Google SketchUp


After a little play with Unity, I realize that this is not good program for modelling.
I have luck to have fiancee who work with Google SketchUp, so She will be modelling for me.

I was very surprised how easy it is to import such model to Unity. You need to export it from SketchUp to Collada (DAE) format and simply drag file to Assets folder in Unity. Such imported model will not have material, and texture, so You have to copy textures from SketchUp project and drag them on the models in unity. This is how it looks:



Some people have problem that after import model is invisible, to fix it you can:
1) Using SketchUp PRO export model as FBX
2) Using SketchUp FREE Export model as .dae -> import to Blender -> export as FBX

To see how to import model from different application like 3DS Max, Blender etc look here.

After import such model will not have any collidors. To add them, click on the model and in the Inspector view mark Generate Colliders.

 

This will generate Mesh Colliders for all Meshes in the model. Now You can drag model to the scene to create game object. By default mesh Colliders will not collide with other Mesh Colliders. To change it, click on game object and in Inspector window in Mesh Collider Component mark Convex. This will work only if object has maximum 255 polygons. Otherwise will be a message "The hull has more than 255 polygons". If it's impossible to reduce number of polygons You have to replace mesh Collider with group of primitive Colliders like Box or Sphere Colliders. One game object can have just one Collider, but we can use a hint from unity manual: "To add multiple Colliders for an object, create child GameObjects and attach a Collider to each one. This allows each Collider to be manipulated independently. "

Example below: 2 Sphere Colliders marked yellow, forms bowling pin Collider:
  


No comments:

Post a Comment