31 December

Exporting Sketchup Models Into Unreal 4 Game Engine

Written by 

Unreal 4I have been exploring the use of gaming engines lately because it is definitely possible to do a high end interactive architectural presentation to a client using these programs. I already looked at Unity in a previous article and now the more popular and flashy Unreal 4. Sketchup has a bad name in the Unreal 4 Gaming Engine community. The main issue that appears to cause the most mirth is Sketchup’s proprietary texturing system which does not work with UV coordinate systems commonly favoured by gaming engines. When you export a Sketchup model straight into Unreal you will get overlapping UV Coordinate error messages when you go to build your lighting solution, causing terrible artifacting as shown in the screenshot below. It might be possible to fix the problem with the overlapping coordinates inside Unreal, but after reading many forum threads, there does not appear to be an obvious solution. So then this issue must be fixed before exporting to Unreal. For the nay-sayers that believe exporting Sketchup models directly to Unreal 4 is too hard, I have worked out a reasonably simple workflow that allows you to import your Sketchup models with all of its textures into Unreal 4. Read on or watch the movie…

If you have ever tried to import a decent sized level from Sketchup into Unreal 4, you might get a result something like the picture below - it looks okay when you first import the model, but once the lighting solution builds things go bad. This is caused by overlapping texture UV coordinates. I have put the error message in the bottom right corner.

It is fixable but you need to do a couple of things in Sketchup first.

Preparing your Sketchup model for exporting:

When creating your model, you need to model things carefully. Make sure that all front faces of your objects face outwards. Check that they are by changing your Style to display front and back colours, flipping anything which is not correctly oriented. Make sure that you group shared geometry and apply basic layering which will help you in the exporting process later on to turn parts on and off, because it is better to export small items into Unreal and combine them to form larger objects from what I have found.

Be wary of putting too much detail into your model. One mistake that caused me a lot of grief was to use a complex follow-me astragal shape that had lots of rounded edges. Avoid this where possible because the UV texturing process that I am about to describe can stuff up - but even then you can still get around it (though I’m not going to go into that here).

SketchUVTexturing Your Model:

Contrary to popular belief, you can texture your model in Sketchup no problem; you just need to set up the UV Coordinate system on your models for the texture maps and colours. The way to do this is to use a plugin call SketchUV (by Whaat) which is available from the Sketchup Extensions Warehouse for free. You need to follow the instructions for the plugin, but to describe the process in basic terms, you use your camera alignment to apply a special grid using the various texturing options in the SketchUV plugin. The Sketchup texture is remapped according to this grid. And that is pretty much it. If you have an organic shape and need to be a bit more careful with the location of texture seams, you can use the special rainbow coloured grid to help you line things up, then save the UV coordinate solution, apply the final texture and reload in the saved UV coordinate solution again so that it remaps the Sketchup material into UV coordinates. Watch the demo of the chair on the plugin page as an example of this method.

If you are exporting an object with 3d curved faces that has non-triangulated faces, like a sphere or revolved solid for example, you need to use the triangulate faces tool inside SketchUV, otherwise you will get a separate material for each face of your object - so for example, a 100 sided object will generate 100 similar materials in Unreal - something not desirable at all.

Once your model has been assigned UV textures (and triangulated), it is ready for export. If you miss doing the UV process on any particular part of your model, you can still go back to your Sketchup model later, apply the UV texture and then re-export it out again. Unreal allows you to reload/update an existing model file very easily.

Exporting from Sketchup:

Unreal 4 can handle FBX and OBJ files and Sketchup Pro can export to either of these formats. (I believe there is a plugin called OBJexporter available on Sketchucation for people that only have Sketchup Make).

In most articles/videos that I have read/watched about exporting Sketchup models to Unreal, they export as FBX; but I have found OBJ exporting to work a little better than FBX. With the OBJ exporter, textures stay linked to the model unlike the FBX exporter. Sketchup’s FBX export puts the texture maps into a separate folder and you have to move the map files back into the same folder as the FBX file manually for them to be recognised by Unreal 4. I have also found objects with smooth curved faces, like a sphere for example, maintain their smoothness better when exported to OBJ format for some reason but not sure exactly why.

When you exporting your model, use the following settings for FBX and OBJ:

  

You don't need to tick anything else. Although it sounds like a good idea, don't use Export two-sided faces and in my experience, it is not necessary to use Triangulate all faces. For the textures to work properly, you must use SketchUV to triangulate your 3d curves in the previous step. And when using FBX, don't forget to move the model and textures into the same folder after it is finished.

Importing into Unreal 4:

This may not happen to everyone, but when I go to import my OBJ file from the top pulldown menu choosing File->Import Into Level, Unreal 4 crashes on my PC; so if this happens to you, use the Import button in the content browser instead; it is much more convenient anyway.

Once the file is imported and model and materials are linked up inside Unreal, you can create subfolders and separate out the textures and materials from the model files. Use the content browser in Unreal to move them so that they remain linked to their source files.

I learnt many other things while briefly mucking around with Unreal. One particularly annoying thing was if you imported multiple objects in the one import file, Unreal will create a collision object between all of the objects. The effect of this is you will not be able to walk between the objects, or if your player is spawned inside the bounds of this object, you won’t be able to move! You have to use Unreal’s object editor to go in and delete the collision object. Not such a big deal but if you have to work it out yourself and the collision object is not visible by default, you can spend several hours like me scratching your head wondering what is wrong!

Anyway to sum it all up, Sketchup and Unreal 4 can work together quite well and hopefully my little video below is proof of this. I should also mention that there is another Sketchup plugin (paid) which I believe automates some of the processes described above. It is called Play Tools which can be found here. A secondary plugin must also be installed into Unreal 4 which looks a bit fiddly when I eyeballed the instructions, but if you can get it working, US$50 is nothing if you are serious about making content for Unreal 4 with Sketchup.

 Unreal 4 is free to download at: https://www.unrealengine.com/

Read 1308 times Last modified on Wednesday, 04 January 2017 13:24
Rate this item
(1 Vote)

Subscribe to our Newsletter

Get all of the news, new hints & tips, special offers and course dates emailed to you!