Convert Autodesk FBX (Filmbox) to KML

Liz Sanderson
Liz Sanderson
  • Updated

FME Version

Introduction

This example converts an FBX model into KML for viewing in Google Earth. We will be georeferencing a 3D Duplex building and placing it on the soccer field of Unwin Park in Surrey, BC. The workspace preserves the original textures in the FBX model. We will also be customizing KML properties such as setting a pop-up balloon in Google Earth when the model is selected.


Step-by-step Instructions

1. Read in FBX Source Data

The source data is an FBX model of a duplex originally from buildingSmart Alliance’s Common Building Information Model Files. Download the template workspace or read in the duplex_A.fbx dataset using the FBX reader in FME.

fbx-source-duplex.png

The FBX source duplex model viewed in the FME Inspector.

 

2. Create a Single Mesh

The ideal geometry to write out to KML is a single mesh. We will use the Triangulator to first break down the FBX geometry into a mesh, and then the MeshMerger to unify the triangular units into a single output mesh. The Meshmerger ensures that we are storing the geometry in the most efficient way, and also makes the translation significantly faster. Without this step, the geometry output cannot be drawn in Google Earth.

 

3. Style KML Output

Use the KMLPropertySetter to customize the balloon pop-up in the output KML. Here, we will specify a name, description, and file summary for the model. Notice that the Content will be visible in the balloon pop-up while the Summary is only visible in the Google Earth toolbar ‘Places’. For these parameters I have used:

  • Name: Duplex A
  • Summary: With the power of FME and the ability to georeference your models, no soccer field on Google Earth is safe from Duplex A.
  • Content: I was originally an FBX model! Now I am KML
  • Altitude Mode: Absolute

While these are the parameters that I have used, feel free to get creative and use your own text.

 

4. Set Coordinates

We will use the LocalCoordinateSysemSetter to set the origin location of our model on Earth, which we have chosen as Unwin Park in Surrey, BC. The point 0,0 on our FBX model is the corner of the building on the ground, and this is the point that will be georeferenced.

coordinates-map.png

Normally, to write to KML, data must always be reprojected to the lat/long coordinate system LL-WGS84. Since the FBX model has no current coordinate system, we will set the origin coordinate system to LL-WGS84, which is the FME equivalent to the WGS84 datum, the same one that supports Google Earth and Google Maps. Our source data is tagged with the coordinate system information as it goes through this transformer.

The coordinates for Unwin Park have been collected from Google Maps, and are in latitude and longitude.

  • Origin X: -122.853505 (longitude)
  • Origin Y: 49.128212 (latitude)

 

5. Write Out to KML

Utilize the KML writer by running the translation. If you are creating your workspace from scratch, remember to set Workspace parameters to Continue Translation in “Rejected Feature Handling”. You can find this by going through Workspace Parameters in your Navigator, and selecting Translation.

**Note**

Due to a known issue, PR# 52475, you may need to first read in a SketchUp file using the Trimble SketchUp Reader and run the translation to convert it to KML, before swapping out the reader for the FBX reader. This will prime your workspace to retain the FBX textures in your KML output. Please try this workaround if your output KML buildings appear all gray. You can use this SketchUp file: duplex-A-skp.zip

 

Completed Workspace

fbx-to-kml-workspace.pngResults

Open up your output in Google Earth. Congratulations! You have georeferenced your FBX model and preserved its original textures, adding on some style by customizing the pop-up balloon. Below, you can see the duplex model placed successfully in Unwin Park in Surrey, BC.

result-with-balloon.png

The output KML properly georeferenced in Unwin Park with a balloon pop-up description.

result-close-up.png

A closer look at the output model in Google Earth showing the original textures from the FBX model.

 

Data Attribution

Data is originally from BuildingSmart Alliance’s Common Building Information Model Files and Tools. The Duplex A model comes from a Revit file in Project 1 Duplex Apartment, under the section Coordination Model View, and it is the dataset 2011-09-14-Duplex-RVT

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.