Unreal Studio for Engineers Part 1: Importing CAD Data with Datasmith

Recently, we took a look at Unreal Studio* from Epic Games, which is an Unreal Engine workflow designed to help product designers, architects and engineers create awesome presentations for communicating their ideas.

For those who need a reminder, Unreal Engine is best known as a game engine that has been used to create games such as Unreal Tournament and, most recently, Fortnite.

In our previous article, we mentioned that Unreal Engine has found a following primarily in the architectural and product design domains, with engineering applications taking something of a back seat.

Well, Epic Games would also like you engineers to experience the joys of real-time rendering, and so we will be working with the company to bring you this four-part series explaining how you can import your engineering CAD data into Unreal Engine (via Unreal Studio), create attractive presentation scenes, and then export the finished product for your own and your customers’ viewing pleasure.

At the end of the series, you should be able to enjoy the benefits of real-time rendering that Unreal Engine offers—all packaged in the gamer-friendly environment that is Unreal Engine itself.

Unreal Studio Beta is now available for free, so if you don’t have it already, then click this link to obtain it, or take a look at our previous article for more details about where to obtain the software, plus instructions on how to install it.

Let’s Go!

Before we get started with the Datasmith functions, let’s review some terms that will help us navigate Unreal Editor. Also, if you’re trying this at home, you can rely on Unreal Engine Online Learning to get free training for free and to learn more about the tools and workflow.

When you load up Unreal Editor from Epic Games Launcher, you will see the Project Browser screen (see Figure 1). From here, you can select an Unreal Studio template.

Figure 1. Unreal Editor Project Browser.

We took a look at the product viewer in the last article. This time, we want to use the blank template, which will allow us to go through the process of setting it all up from scratch.

Double-clicking the Blank template will load up Unreal Editor, after which point you will see a checkered floor plan. This is our floor, where everything will go.

Let’s familiarize ourselves with the layout of the screen.

Figure 2.The Unreal Editor main screen and Viewport.

In the center of the screen is the main Viewport. This is where you will be building your world, and dropping your models and doing all the graphical work. On the right-hand side is the World Outliner, which is where you will see the model file structures, as well as other information about the “actors,” such as lighting, atmospherics and so on. In Unreal Editor, you can select actors by clicking on them in the Viewport, or you can scroll down the World Outliner to locate individual components.

When you click on a component using either of those methods, the details of that actor will be displayed in the Details pane below the World Outliner panel.

Details include the location of the actor, which you can manipulate by using the Transform menu (see Figure 3), which contains coordinate data in the X-/Y-/Z-axes, as well as Rotation and Scale information that you can use to move and scale things.

Figure 3.The Unreal Editor Transform menu.(Image courtesy of Epic Games.)

Clicking on any of the actors will bring up a red/blue/green set of arrows on your model in the Viewport as can be seen in Figure 4. These arrows are called widgets, and by manipulating them, you can control the transformation, rotation or scale within the Viewport itself.

Figure 4. Transform widget arrows, which can be dragged to move your assets in the Viewport. The colors of the arrows correspond to the axes displayed in the Transform menu. You can read more about transforming actors at this link.

Controls

You can use your mouse to navigate the camera and look around the Viewport. The mouse controls are listed in Figure 5.

Figure 5. Mouse controls for navigating the Viewport. (Image courtesy of Epic Games.)

And because this is a game engine, you can also navigate with the WASD keys, much as you would in your favorite first-person shooter. To use the WASD method of control, simply hold the right mouse button down, and press the WASD keys to navigate.

Content Browser

At the bottom of the screen, beneath the Viewport, you will notice the Content Browser pane.

When you import assets into Unreal Editor, they will be displayed in this area, and you can drag and drop them into the Viewport. To do this, you can import them from the File menu at the top of the screen, or you can import them using the Import option on the Content Browser itself. All of the imported project content resides in this area. You can see an example in Figure 6.

Figure 6. The Content Browser.

Now, you have the basics of navigating around Unreal Editor. Let’s crack on with importing some content.

Datasmith

Alrighty, then.

For this first article, we will be using SOLIDWORKS and SketchUp files as the native CAD data to show you how to import using two different Datasmith import methods. Once you become familiar with these two methods, you can apply the same method to different CAD files depending on which file type you are using.

The Datasmith-compatible engineering CAD files are listed in Figure 7, along with details on the functionality of each file type.

Figure 7. Compatible CAD file types. (Image courtesy of Epic Games.)

Choose Your CAD File

You’ll notice from the list in Figure 7 that files coming from software such as SOLIDWORKS or Autodesk Inventor use what is called a Native workflow. This simply means that you can export these files in their native file type from their respective programs, as well as import them using Datasmith without any further conversion or processing.

Conversely, you can see in Figure 7 that software such as SketchUp or Autodesk 3ds Max both use an export plug-in workflow type. This means that you need to download the appropriate plug-in for each respective software from the Epic Games launcher.

Later in this article, we’ll l have a quick recap of how to export from SketchUp using the Datasmith exporter plug-in for SketchUp.

Exporting and Importing

First up, let’s take a look at exporting and importing SOLIDWORKS files, because it’s a popular engineering CAD platform that many of our readers use.

For our presentation scene, we want to really show off Unreal Engine’s rendering capabilities, and we are especially interested in seeing how much of the information is transferred from SOLIDWORKS into Unreal Engine.

According to Epic Games, material appearances and lighting can be imported from SOLIDWORKS into Unreal Engine.

In order to work with a model that had multiple different materials, we used this model of a 2015 Mercedes AMG GT. Special thanks to Yusuf Buwanguzi for letting us use his model for this article (go check his work out—it’s awesome).

It’s a sweet looking car, and it has some matte rubber bits, some chrome, tinted glass and some spraypaint, so it should remain looking pretty impressive when we import it using Datasmith. The model in SOLIDWORKS is shown in Figure 8.

Figure 8. Our model in SOLIDWORKS.

As mentioned, SOLIDWORKS uses a native type workflow, so exporting from the software is easy. Just save as a SLDPRT or SLDASY file, and it’s done.

A cool feature of Unreal Studio is the ability to import assembly files (such as SLDPRT files). Importing an assembly file from SOLIDWORKS, PTC Creo, or Siemens NX will preserve the structure of the assembly upon import into Unreal Studio. In our Mercedes model, we have constructed the front wheels and brake assemblies as actual assembly components, and have exported from SOLIDWORKS as an SLDASY file.

For this test, we opened up a blank Unreal Studio template to import the car into.

Importing with Datasmith is easy enough. Once Unreal Editor is open, simply locate the Import Datasmith icon on the top ribbon, click the arrow to expand the menu, and select Import CAD from the drop-down menu, as shown in Figure 9.

Figure 9. The top ribbon. Here's where you import with Datasmith.

This is the point where Datasmith begins to weave its magic.

After you select the CAD file that you wish to import, you will be presented with a Datasmith Import Options box with some options for what type of data you wish to import, as well as options for geometry and tessellation control, an example of which can be seen in Figure 10.

Some of these options will vary, depending on the type of Datasmith data you are importing. In the case of the Import CAD route, you will be given options for Chord Tolerance, Maximum Edge Length and Normal Tolerance.

Figure 10. Datasmith import options for CAD files.

To help you understand what’s going on when you try it for yourself, here’s a brief description of what those tessellation options do:

  • Chord Tolerance sets the maximum distance between any point in a generated triangle and the original surface.
  • Max Edge Length sets the maximum length of any edge in any generated triangle.
  • Normal Tolerance sets the maximum angle between any adjacent triangles generated from a surface.

Engineering files tend to use a lot of curve-based surfaces, and having these options available during import allows you to control the parameters of the tessellation process as Datasmith converts those curved surfaces into triangular meshes.

Obviously, a better-fitting mesh requires more triangles, which also increases computing resource usage (and storage), and conversely, a coarser mesh is more economical but not as accurate. We turned the coarseness right up, and the final result looks just fine.

Keep in mind that this is a gaming engine, not a precision engineering CAM operation. There’s really no need for such high-precision here. Don’t be afraid to reduce the number of triangles …it’s only going to reduce the file size and make it easier to work with, and you really won’t notice much difference anyway. Game model files are significantly smaller than CAD engineering files—sometimes by factors of hundreds. You really want to be aiming to reduce the size of your complicated CAD geometry to match. And Datasmith helps you do that with those options.

The Result

You can see the result of the import into Unreal Engine via Datasmith in Figure 11.

Figure 11. The car is now in Unreal Editor.

As you can see from the figure, our rubbery tires are still intact, as is the material of the red brake calipers, the front grille, the paint and the tinted glass. The lighting and assembly structure has been imported too.

We will be swapping some of these materials out later, as Unreal Engine has plenty of automotive material available from the Epic Games Launcher store.

The Export Plug-In Workflow

We previously mentioned non-native, or export plug-in-based workflow types. These are file types that require a plug-in from Epic Games to run within their native software in order to facilitate the Datasmith export/import process.

Both Autodesk 3ds Max and SketchUp require a plug-in to export, so in this section we are going to import some scenery for our presentation scene from SketchUp using the SketchUp Datasmith import plug-in.

We (or, more accurately, my wife) designed this hangar (see Figure 12), which we will use for a bit of scenery. We’ve put some skylights in there, so we can play around with shadows, and we’ve added the materials in SketchUp too.

Figure 12. Hangar ready for export from SketchUp.

To export from SketchUp (or 3ds Max),you will need to use a plug-in that is available from Epic Games Launcher. You can find instructions on how to obtain the plug-in and install it right here.

It’s very easy. Once the plug-in has been installed, you will need to go into SketchUp and load it up into Extensions.

You can check that this step has been performed correctly by going into SketchUp, clicking File>Export>3D Data. This will open an export dialog box, and if you click on the File Type drop-down menu, you will notice the option to export as a Datasmith file.

Naturally, this is what you want, so go right ahead and select it, and then click Export.

It may take a moment to prepare the file, but that’s totally fine. It’s going to save you a lot of time in the long run.

Once the Datasmith file is exported via the plug-in, it is ready to be imported into Unreal Editor.

Importing Datasmith Files in Unreal Editor

OK, so remember how we imported the CAD data earlier?

You will be doing that process again here, but instead of selecting Import CAD from the Import Datasmith icon, you will select Import Datasmith option (see Figure 13).

Figure 13. Importing Datasmith files proper.

This will invoke the import dialog box again.

Remember how we said that some of the import options will change depending on the file type you are using? You can see the new options in Figure 14. As before, you still have the options to include geometry, materials/textures, lights and cameras into the scene (or “level”). However, when importing Datasmith files proper, you will get an extra set of options in the Static Mesh Options section (see Figure 14).

Figure 14 Importing actual Datasmith files from the dialog box.

A static mesh is a piece of geometry that consists of a set of polygons that can be cached in video memory and rendered by the graphics card. Static meshes are the basic unit used to create world geometry for levels created in Unreal Engine. In other words, it’s your imported model.

These new options are related to the lightmap resolution within Unreal Engine.

We won’t go into detail about lightmaps in this article. That’s for the next article, where we will look at lighting, textures and all that other wonderful aesthetic stuff. For now, you will leave it as default and click Import.

Again, this is where Datasmith is working its magic and may take a moment or two to load the model into Unreal Editor (see Figure 15).

Figure 15. The hangar is now in Unreal Editor.

And it really is that simple.

Now that your assets (or “actors”) are inside Unreal Editor, you can start to move them around and set your scene up a little bit. You can use the transform features to move things and scale them as we discussed at the beginning of this article. In this scene, we have scaled up the floor plane actor in the World Outliner, just so we could fit the hangar on there.

The Finished Result

As you can see in Figure 16, the basic scene is set up and you are ready to progress onto the next stage—adding lights and new materials. And we will be going into more detail on how to do that in the next article.

Figure 16. The actors are aligned and all is good.

Just to give you a little taste of the Epic Games Automotive Materials pack, we have replaced the imported materials on the car with some of those from the Materials pack.

You can see the difference between the native materials on the model and the automotive materials in Figure 17. We are quite sure you will agree…the automotive materials look mighty fine!

Figure 17. Our car using materials from the Automotive Materials pack.

Coming Up Next

So, there it is.

You now know how to export files from their native CAD platforms and import them using Datasmith. You also know how to navigate around Unreal Editor and how to move your actors around.

Next time, we will take a closer look at the aesthetic side of things, and we will learn more about features such as Play mode, which allows you to view the scene as it would appear in a game or in a presentation.

And remember to get over to Epic Games to download Unreal Studio for yourself and see how Unreal Engine can really make your presentations pop!

Until then…ciao for now!


*Editor's note: With the release of Unreal Engine 4.24, all Unreal Studio features have been rolled into Unreal Engine. Datasmith is also included as a standard Unreal Engine feature.


Epic Games has sponsored this post. They have had no editorial input to this post. Unless otherwise stated, all opinions are mine. —Phillip Keane