Support

Export an STK movie to Unreal engine

Posted 5 months ago by Matt Halferty

Post a topic
Answered
M
Matt Halferty Admin

I want to create a video and then export to Unreal engine. Is this possible?

0 Votes

Alexander Ridgeway

Alexander Ridgeway posted 5 months ago Admin Best Answer

Great question! I have been looking into this. The connect to STK to Unreal possible, but it requires some work to get the content exported from STK and then imported to Unreal, also it requires Cesium for Unreal. 

1. Build your scenario in STK to include all of your objects and 3D models so you know what you want to include in the video project. STK provides the full force models and real physics, so you can take full advantage of this. Also please use the Cesium Tiles for terrain imagery and building data as they can be used in Unreal.  

2. Export your data. Currently there is not STK to Unreal exporter. So you will need to pull the data out that you need. Currently we are looking into exact formats and exact content required in Unreal, but in general, you need Position and Attitude information along with the 3D model used in STK, for each and every object in your scenario.

3. Use Cesium for Unreal. Cesium provides the 3D Globe and 3D Tiles to Unreal. So connect your Unreal project to Cesium using a pluging. Here is a great guide from Cesium.   

https://cesium.com/learn/unreal/unreal-quickstart/ 

Also some videos. 
Unreal Engine 5 - Google Maps API & Cesium - Full tutorial PT 1 (youtube.com)

Cesium for Unreal: The World in 3D - YouTube

 4. Ingest STK content. This part depends on the scenario itself. It depends on the type of data. Below is a description of how to bring in CSV data into Unreal Engine.

Creating a pathway in Unreal Engine (UE) from a CSV file containing Latitude, Longitude, Altitude (or XYZ points) and making a 3D model follow this route involves several steps. Here’s a comprehensive guide to help you achieve this:

1. Prepare the CSV File

Ensure your CSV file is properly formatted. A simple example might look like this:

Lat,Lon,Alt

40.712776,-74.005974,10

40.713776,-74.006974,15

40.714776,-74.007974,20

Or for XYZ coordinates:

X,Y,Z

100,200,10

110,210,15

120,220,20

2. Import the CSV File into Unreal Engine

  1. Blueprint Importing CSV:
    • Create a new Data Table in Unreal Engine from your CSV file.
      • Right-click in the Content Browser -> Miscellaneous -> Data Table.
      • Select the Row Structure that matches your CSV data. You may need to create a custom structure to match your CSV columns.
  2. Create a Structure:
    • Create a new Structure (Blueprints -> Struct) that matches the data columns in your CSV file (e.g., Lat, Lon, Alt or X, Y, Z).

3. Read the CSV Data

  1. Blueprint Function:
    • Create a new Blueprint Actor.
    • Add a function to read and parse the CSV data from the Data Table.
    • Use the Get Data Table Row Names and Get Data Table Row nodes to loop through the rows and store the coordinates in an array.

4. Create the Pathway

  1. Spline Component:
    • Add a Spline Component to your Blueprint Actor.
    • Loop through your array of coordinates and add spline points using the Add Spline Point function.

ForEach Loop (Array of Coordinates)

  Add Spline Point (Convert Lat/Lon/Alt to X/Y/Z if necessary)

5. Convert Lat/Lon/Alt to XYZ (if needed)

  • If your data is in Lat/Lon/Alt format, you'll need to convert it to Unreal Engine's coordinate system. This typically involves converting geographic coordinates to a flat coordinate system (e.g., using a geographic projection).

6. Move the 3D Model Along the Pathway

  1. Timeline Component:
    • Add a Timeline component to your Blueprint.
    • Create a float track in the Timeline that will drive the movement along the spline.
  2. Movement Logic:
    • Use the Get Location at Distance Along Spline node to get the position along the spline.
    • Update the position of your 3D model using this location in the Timeline’s update.

Timeline (Track 0-1)

  Update:

    Get Location at Distance Along Spline (Spline Length * Track Value)

    Set Actor Location (3D Model)

7. Handle Multiple Pathways

  1. Multiple Spline Components:
    • Add multiple Spline Components to your Blueprint Actor or create separate Blueprint Actors for each pathway.
  2. Select Pathway:
    • Implement a mechanism to switch between different splines, e.g., using a dropdown menu in the UI or a selection function in your Blueprint.

Example Blueprint Pseudo-code:

Event BeginPlay

  Read CSV Data into Array

  ForEach Coordinate in Array

    Add Spline Point to Spline Component


Event Timeline Update

  Get Location at Distance Along Spline (Current Spline Length * Timeline Value)

  Set 3D Model Location


Event Switch Pathway (New Pathway Index)

  Set Current Spline Component

This approach will create a dynamic path in Unreal Engine from your CSV data and move your 3D model along this path. Adjustments might be needed based on your specific requirements and coordinate system.


0 Votes


1 Comments

Alexander Ridgeway

Alexander Ridgeway posted 5 months ago Admin Answer

Great question! I have been looking into this. The connect to STK to Unreal possible, but it requires some work to get the content exported from STK and then imported to Unreal, also it requires Cesium for Unreal. 

1. Build your scenario in STK to include all of your objects and 3D models so you know what you want to include in the video project. STK provides the full force models and real physics, so you can take full advantage of this. Also please use the Cesium Tiles for terrain imagery and building data as they can be used in Unreal.  

2. Export your data. Currently there is not STK to Unreal exporter. So you will need to pull the data out that you need. Currently we are looking into exact formats and exact content required in Unreal, but in general, you need Position and Attitude information along with the 3D model used in STK, for each and every object in your scenario.

3. Use Cesium for Unreal. Cesium provides the 3D Globe and 3D Tiles to Unreal. So connect your Unreal project to Cesium using a pluging. Here is a great guide from Cesium.   

https://cesium.com/learn/unreal/unreal-quickstart/ 

Also some videos. 
Unreal Engine 5 - Google Maps API & Cesium - Full tutorial PT 1 (youtube.com)

Cesium for Unreal: The World in 3D - YouTube

 4. Ingest STK content. This part depends on the scenario itself. It depends on the type of data. Below is a description of how to bring in CSV data into Unreal Engine.

Creating a pathway in Unreal Engine (UE) from a CSV file containing Latitude, Longitude, Altitude (or XYZ points) and making a 3D model follow this route involves several steps. Here’s a comprehensive guide to help you achieve this:

1. Prepare the CSV File

Ensure your CSV file is properly formatted. A simple example might look like this:

Lat,Lon,Alt

40.712776,-74.005974,10

40.713776,-74.006974,15

40.714776,-74.007974,20

Or for XYZ coordinates:

X,Y,Z

100,200,10

110,210,15

120,220,20

2. Import the CSV File into Unreal Engine

  1. Blueprint Importing CSV:
    • Create a new Data Table in Unreal Engine from your CSV file.
      • Right-click in the Content Browser -> Miscellaneous -> Data Table.
      • Select the Row Structure that matches your CSV data. You may need to create a custom structure to match your CSV columns.
  2. Create a Structure:
    • Create a new Structure (Blueprints -> Struct) that matches the data columns in your CSV file (e.g., Lat, Lon, Alt or X, Y, Z).

3. Read the CSV Data

  1. Blueprint Function:
    • Create a new Blueprint Actor.
    • Add a function to read and parse the CSV data from the Data Table.
    • Use the Get Data Table Row Names and Get Data Table Row nodes to loop through the rows and store the coordinates in an array.

4. Create the Pathway

  1. Spline Component:
    • Add a Spline Component to your Blueprint Actor.
    • Loop through your array of coordinates and add spline points using the Add Spline Point function.

ForEach Loop (Array of Coordinates)

  Add Spline Point (Convert Lat/Lon/Alt to X/Y/Z if necessary)

5. Convert Lat/Lon/Alt to XYZ (if needed)

  • If your data is in Lat/Lon/Alt format, you'll need to convert it to Unreal Engine's coordinate system. This typically involves converting geographic coordinates to a flat coordinate system (e.g., using a geographic projection).

6. Move the 3D Model Along the Pathway

  1. Timeline Component:
    • Add a Timeline component to your Blueprint.
    • Create a float track in the Timeline that will drive the movement along the spline.
  2. Movement Logic:
    • Use the Get Location at Distance Along Spline node to get the position along the spline.
    • Update the position of your 3D model using this location in the Timeline’s update.

Timeline (Track 0-1)

  Update:

    Get Location at Distance Along Spline (Spline Length * Track Value)

    Set Actor Location (3D Model)

7. Handle Multiple Pathways

  1. Multiple Spline Components:
    • Add multiple Spline Components to your Blueprint Actor or create separate Blueprint Actors for each pathway.
  2. Select Pathway:
    • Implement a mechanism to switch between different splines, e.g., using a dropdown menu in the UI or a selection function in your Blueprint.

Example Blueprint Pseudo-code:

Event BeginPlay

  Read CSV Data into Array

  ForEach Coordinate in Array

    Add Spline Point to Spline Component


Event Timeline Update

  Get Location at Distance Along Spline (Current Spline Length * Timeline Value)

  Set 3D Model Location


Event Switch Pathway (New Pathway Index)

  Set Current Spline Component

This approach will create a dynamic path in Unreal Engine from your CSV data and move your 3D model along this path. Adjustments might be needed based on your specific requirements and coordinate system.


0 Votes

Login or Sign up to post a comment